code better
4.6用Array.from而不是...运算符去做map遍历。因为这样可以避免创建一个临时数组。
// bad
const baz - [ ...foo].map(bar);
/ / good
const baz = Array .from(foo, bar);
4.6用Array.from而不是...运算符去做map遍历。因为这样可以避免创建一个临时数组。
// bad
const baz - [ ...foo].map(bar);
/ / good
const baz = Array .from(foo, bar);