console.log(a);
console.log(c);
console.log(arr);
}
gg(1, 2, 3, 4, 5, 56, 6, 7);
剩余参数必须是最后一个参数...Array
map
映射:n -> n
let a = [12, 3, 4, 5, 6, 7, 8, 9, 10];
let res = a.map((item) => item * 2);
console.log...arr = [12, 3, 4, 5];
let brr = arr.filter((item) => item % 2 === 0);
console.log(brr);
// [ 12, 4 ]
字符串...String
字符串模板
let arr = [12, 3, 4, 5];
arr.forEach((item, index) => {
console.log(`这是第${index + 1}...return false;
};
let p = new Promise(does).then(resolve).catch(reject);
上面这个例子稍微有点问题,用异步网络请求可以演示清楚
Promise.all