Map() 构造函数
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
Map()
构造函数创建 Map
对象。
语法
参数
示例
创建一个新的 Map
js
const myMap = new Map([
[1, "one"],
[2, "two"],
[3, "three"],
]);
规范
Specification |
---|
ECMAScript Language Specification # sec-map-constructor |
浏览器兼容性
BCD tables only load in the browser