String.prototype.padEnd

Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length. The padding is applied from the end of the current string.

Syntax

padEnd(maxLength, fillString?)

Parameters

Return value

The padded string.

Examples

"yes".padEnd(4)
"yes "
"yes".padEnd(10, "123")
"yes1231231"

See also