TypeScript--遍历Map
定义一个Map:
let map = new Map<string, string>();
map.set("a", "1");
遍历方式:
1.(推荐使用) map.forEach((value, key) => { }) (参数顺序:value在前, key在后)
2. let iterator = map.values();
let r: IteratorResult<string>;
...
原创
2021-04-01 21:17:22 ·
6751 阅读 ·
0 评论