Day_12 #13
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
会用 push 加元素
会用 forEach / map / filter
能说出 map 和 forEach 的区别(map 返回新数组)
let nums = [1, 2, 3];
nums.push(4);
console.log(nums);
[1,2,3,4,5].forEach(function(n){
console.log(n);
});
const group = [1,2,3].map(function(n){
return n * 2;
});
console.log(group);
const two = [1,2,3].filter(function(n){
return n % 2 === 0;
});
console.log(two);
会用 push 加元素
会用 forEach / map / filter
能说出 map 和 forEach 的区别(map 返回新数组)