Web features explorer

String padStart() and padEnd()

Widely available since 2019-10-05
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.

Learning resources on MDN

Browser support (view on caniuse.com)

Specifications