[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/String/padEnd [Back]  [Original]

String.prototype.padEnd() - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

String.prototype.padEnd()

Baseline Widely available

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2017 ..

padEnd() String ( ) , . .

In this article

const str1 = "  ";

console.log(str1.padEnd(25, "."));
// : "  ........"

const str2 = "200";

console.log(str2.padEnd(5));
// : "200  "

js
padEnd(targetLength)
padEnd(targetLength, padString)

padString , targetLength, : , . " "

targetLength

. str.length, .

padString

, str. padString , targetLength, : , . " " (U+0020).

String targetLength padString, str.

padEnd

js
"".padEnd(10); // "       "
"".padEnd(10, ""); // ""
"".padEnd(6, "123456"); // "123"
"".padEnd(1); // ""

Specification
ECMAScript 2027 LanguageSpecification
# sec-string.prototype.padend


Web Proxy Viewer  |  New URL  |  Original Page