SOURCE

const apples = {name: 'Apples'};
const bananas = {name: 'Bananas'};
const oranges = {name: 'Oranges'};

// 创建新的 Map
const fruits = new Map();

// Add new Elements to the Map
fruits.set(apples, 500);
fruits.set(bananas, 300);
fruits.set(oranges, 200);

console.log(fruits.get(apples)); //get value, no key
console.log(fruits[500]); 
console.log(fruits.keys().next().value);
console.log(fruits.values().next().value);

const iterator = fruits.entries();
console.log((iterator.next().value)[0].name);
console.log(iterator.next().value);
console.log(iterator.next().value);
console 命令行工具 X clear

                    
>
console