Date have very few utilities,
Array finally got some love with ES5).
Purpose of smap.js
Boris Smus makes an excellent suggestion for moving the web forward: forward polyfills. That’s exactly my intention with smap.js. I’m hoping you will think this is a great idea, and help discuss how ES6 Map should work or submit pull requests with your own ideas.
One could argue that you could just add to
Object.prototype, but that is known to cause unintended side effects that are often tough to track down.
The fact that we can stop bastardizing
Object for dictionary-like behavior is exciting.
What smap.js does
smap.js includes a polyfill based on my ES6 Map Shim for environments without a Map implementation that conforms to the (incomplete) ES6 spec; then it adds a number of
convenience methods to help you work with
Maps more easily. Here are some examples:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
You can install this via npm for node.js v0.8+
For browsers, download smap.js and include in your HTML:
Go to the GitHub project page and tell me what you think, even if it’s just to say you think it’s a good idea.
If enough people like this idea, we can submit a proposal to TC39 to have this standardized or perhaps get implementations from browser vendors.
Let’s move the web forward.