String padEnd() method

Find out all the information about the JavaScript padEnd() method of the string

The purpose of string padding is toAdd characters to the string, and soReach a certain length.

padEnd()Introduced in ES2017, such characters are added at the end of the string.

padEnd(targetLength [, padString])

Example usage:

padEnd()
'test'.padEnd(4) 'test'
'test'.padEnd(5) 'test'
'test'.padEnd(8) 'test'
'test'.padEnd(8,'abcd') 'testabcd'

See alsopadStart().

Download mine for freeJavaScript beginner's manual


More js tutorials: