小编New*_*bie的帖子

地图默认值

我正在寻找类似Map的默认值的东西。

m = new Map();
//m.setDefVal([]); -- how to write this line???
console.log(m[whatever]);
Run Code Online (Sandbox Code Playgroud)

现在结果是未定义,但我想获取空数组[]。

javascript arrays dictionary default-value

2
推荐指数
2
解决办法
4583
查看次数

标签 统计

arrays ×1

default-value ×1

dictionary ×1

javascript ×1