With all the noise about EC6, one thing that I realized I haven’t heard about is expanding Javascript’s standard library. Javascript has a fairly sparse standard library. You need a 3rd party library to do many basic things like date manipulation.
I’d rather have more built into the browser via a standard library then have to download Javascript to do basic things.
Is this a focus of the standards body? Is it contingent on ES6 modules? Is it even correct to discuss an “Ecmascript standard library” (does the standard specify a std lib like say C++’s spec does) or is it something specific to the Javascript implementation of the Ecmascript standard?
It’s certainly something that’s considered in every standard, but I would say that yes, a more comprehensive standard library is a focus of ES6; comparing it to the changes in every other revision of JavaScript (which have, for the most part, added functions to existing types), you’ll notice that it’s… a lot more. No, the changes are not contingent on modules.
Truly new in ES6 (i.e. not a renamed or improved version of something else):
Array.from
,Array#fill
,Array#find
,Array#findIndex
Map
,WeakMap
, andSet
typesNumber.isInteger
String.fromCodePoint
,String#codePointAt
,String#startsWith
,String#endsWith
,String#contains
,String#repeat
,String#normalize
– lots to do with Unicode, not just UTF-16Object.is
,Object.setPrototypeOf
,Object.assign
,Object.observe
Math.imul
,Math.clz32
,Math.fround
– performance thingsPromise
– hugely important for asynchronous code
All in all, several things that would be very nice to have in the JavaScript standard library.
… I would rather have had more of this than modules and other breaking changes.
1