Harmony collections NOW
3 years, 9 months ago
On habre article about such remarkable things as Map, WeakMap and Set, but actually actual possibilities of these API not uncover (if I all the same well using searching) already jumping.
These API was not implement by sense anywhere, except firefox (it are possible to include in chrome canary), but even there before recent time usage of HTMLElement-like objects as keys were not support. Polymer, for example, removing only three weeks ago
if (navigator.userAgent.indexOf('Firefox/') > -1)
Than they so was good? As a matter of fact Map/WeakMap can be perceiv as normal hesh-objects, only as keys it are possible to use only difficult objects (Object, Function, Array) as the binding went not on contents, and to the address to storages.
Thus there are a possibility to be anchor on frontende to
- to dom-element
- To XHR request
- To File-element
It gave the chance to us to work without id-shnik of elements, to do date-binding in times more quickly, to create mad alternate implementation of promises and so on.
We will speak about WeakMap. At all so, we will speak about exist the polifillakh for WeakMap.
Read more »