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).

have @ mdn here more information.


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -