Web features explorer

String padStart() and padEnd()

Widely available
Tags: javascript Groups: JavaScript > Primitive types > Strings

The padStart() and padEnd() methods of strings return a string lengthened to a minimum number of characters by adding characters to the start or end of the string. To learn more, see String.prototype.padEnd(), String.prototype.padStart() at MDN.

Compatibility (view on caniuse.com)

Specifications