News for hackers. Stuff that matters.
Re:What’s New in ES2019 by ZenPsycho on Tuesday July 30, 2019 @07:09AM (#20563720)
seems like a real missed opportunity to add string.leftPad()
Re:What’s New in ES2019 by AsusFan on Tuesday July 30, 2019 @07:18AM (#20563767)
Seems like a real missed opportunity to look at the Python stdlib and add a bunch of missing functionality to JS so that people don't have to import a metric ton of third party libraries (or worse, write it themselves) to add something you get for free in most other scripting languages.

Even the trim operations they added fall short of the target. In Python (and tcl, by the way) you can specify which characters to trim.

So close, yet, so far.

Re:What’s New in ES2019 by snek on Tuesday July 30, 2019 @10:34AM (#20565155)
You can use regex for other characters, the point of the trim functions is that they match the somewhat complex unicode whitespace.
Re:What’s New in ES2019 by alexlur on Tuesday July 30, 2019 @07:15AM (#20563744)
Re:What’s New in ES2019 by soulofmischief on Tuesday July 30, 2019 @09:54AM (#20564852)
But we still have trimLeft() and trimRight() and in true JS tradition we need some more redundancy for symmetry's sake.
Re:What’s New in ES2019 by STRML on Tuesday July 30, 2019 @11:08AM (#20565487)
As 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.
Re:What’s New in ES2019 by ZenPsycho on Tuesday July 30, 2019 @08:34PM (#20570665)
That makes sense, "left" trimming rtl text could be confusing.
Re:What’s New in ES2019 by soulofmischief on Thursday August 01, 2019 @10:42AM (#20584095)
You're right, I was just being tongue-in-cheek.
Re:What’s New in ES2019 by davman on Tuesday July 30, 2019 @07:15AM (#20563742)