Home / Javascript Tips Generated By ChatGPT / 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"