ecmascript 6 - In which cases should I prefer ES6-maps instead of JavaScript-objects? -
i'm learning new language-features come javascript es6.
javascript-objects have know other languages hash-maps or associative arrays.
now language has maps. ask myself: there cases wouldn't possible accomplish same thing using object data-structure?
okay ..., maps have few comfortable methods extra. nevertheless: haven't been able figure out use-case in same couldn't done using object.
does know why maps have become incorporated language? or better: can show me use-case in better off using map instead of object?
objects fine when you're using using strings keys. maps let use other data types keys. also, when iterate on keys , values, have predictable order (the order in inserted elements).
Comments
Post a Comment