ES6 Map All In One 二维数组 字典
Map with initializing
initial value
// ✅ 二维数组,作为初始值
const map = new Map([["(", ")"]]);
// Map(1) {"(" => ")"}
const map = new Map(["(", ")"]);
// ❌ Uncaught TypeError: Iterator value ( is not an entry object at new Map (<anonymous>)
const map = new Map({"(": ")"});
// ❌ Uncaught TypeError: object is not iterable (cannot read property Symbol(Symbol.iterator))