String padStart() and padEnd()
Widely available since 2019-10-05
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)
- Chrome 57 Released on 2017-03-09
- Chrome Android 57 Released on 2017-03-16
- Edge 15 Released on 2017-04-05
- Firefox 48 Released on 2016-08-02
- Firefox for Android 48 Released on 2016-08-02
- Safari 10 Released on 2016-09-20
- Safari on iOS 10 Released on 2016-09-13
Specifications
- ECMAScript Language Specification (#sec-string-objects), from TC39 (Ecma International).