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.