String.prototype.padStart(), String.prototype.padEnd()External Link

BaselineWidely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since October 2019.

The padStart() and padEnd() methods pad the current string with a given string (eventually repeated) so that the resulting string reaches a given length. The pad is applied from the start (left) of the current string for padStart(), and applied from the end (right) of the current string for padEnd().

IE
Edge
Firefox
Chrome
Safari
Safari iOS
Opera Mini
Chrome Android
Android Browser
Samsung Internet
Globals: 97.39% of all users can use this feature, 97.39% fully supported, 0% partially supported
✓Supported
✗Not supported
Partial support