容易遗忘的Array跟Map的语法

从 string 生成数组
1 | Array.from('foo'); |
从set生成数组
1 | const set = new Set(['foo', 'bar', 'baz', 'foo']); |
从map生成数组
1 | const map = new Map([[1, 2], [2, 4], [4, 8]]); |
从类数组对象(arguments)生成数组
1 | function f() { |
在 Array.from 中使用箭头函数
1 | // Using an arrow function as the map function to |
数组去重合并
1 | function combine(){ |