4 ms·
String#padStart already exists: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart https://developer.mozilla.org/e
by alexlur 7y ago
String#padStart already exists: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- soulofmischief 7y agoBut we still have trimLeft() and trimRight() and in true JS tradition we need some more redundancy for symmetry's sake.
- deleted 7y ago[deleted]
- STRML 7y agoAs in the MDN article: All major engines have also implemented corresponding trimLeft and trimRight functions - without any standard specification. So ES2019 implements trimStart() and trimEnd(), which are symmetrical to padStart() and padEnd(), but trimLeft() and trimRight() aliases are maintained as not to break working code.
- soulofmischief 7y agoYou're right, I was just being tongue-in-cheek.
- ZenPsycho 7y agoThat makes sense, "left" trimming rtl text could be confusing.