javascript - Associative arrays - ES6 -


i know can declare associative "array" like:

var mydata = {     foo: 'val1',     bar: 'val2',     baz: 'val3' }; 

what's standard practice in declaring associative arrays in es6?

objects associations of string keys , arbitrary values.

es6 introduces maps, associations of arbitrary keys , arbitrary values.

var m = new map([   ['a', 'b'],   [1, 2],   [true, false] ]); m.get('a'); // 'b' 

there no "standard practice", maps can considered when want associate values.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -