let a = [1, 2, 3, 4, 10, 14, 15];
// 1.current => 当前值 2.index => 当前的下标 3.array => 这个数组的对象
let b = a.filter((current, index, array) => {
console.log("current:", current) // 当前循环到的值
console.log("index:", index) // 循环到的下标
console.log("array:", array) // [1, 2, 3, 4, 10, 14, 15]
return current < 10;
})
console.log(a); // [1, 2, 3, 4, 10, 14, 15]
console.log(b); // [1, 2, 3, 4]