Using Map for Key-Value Pairs in Javascript


Create a collection of keyed data items using Map.

Source Code

let myMap = new Map([['key1', 'value1'], ['key2', 'value2']]);
console.log(myMap.get('key1')); // "value1"
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments