1

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?

1 Answer 1

4

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, and Set types
  • Number.isInteger
  • String.fromCodePoint, String#codePointAt, String#startsWith, String#endsWith, String#contains, String#repeat, String#normalize – lots to do with Unicode, not just UTF-16
  • Object.is, Object.setPrototypeOf, Object.assign, Object.observe
  • Math.imul, Math.clz32, Math.fround – performance things
  • Promise – 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
  • thats all good stuff, I was kind of hoping to start seeing more build out of a standard tools like python's std lib. I'm just imagining how much bandwidth is used to transfer stuff that should just be there Commented Jul 8, 2014 at 17:18

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.