Array.from
Array.from([1, , 2, , 3], (n) => n || 0) // [1, 0, 2, 0, 3] function typesOf () { return Array.from(arguments, value => typeof value) } typesOf(null, [], NaN) // ['object', 'object', 'number']
Array.of() Array.of方法用于将一组值,转换为数组。 Array.of(3, 11, 8) // [3,11,8]