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
Post a Comment