String padStart() method

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

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

padStart()Can be used to add characters at the beginning of a string.

padStart(targetLength [, padString])

Example usage:

'test'.padStart(4) 'test'
'test'.padStart(5) 'Test'
'test'.padStart(8) 'Test'
'test'.padStart(8,'abcd') 'abcdtest'

See alsopadEnd().

Download mine for freeJavaScript beginner's manual

More js tutorials: