来看我吧怎么接话(Sb来看我啊)
来看我吧怎么接话(Sb来看我啊)
一、数组遍历元素的方法1.forEach()forEach()用于遍历整个数组,中途不能中断
let arr: any[] = [1 2 3 4];
arr.forEach((item index)=>{
console.log('值:' item '索引:' index);
});
find() 方法返回满足条件(函数内判断)的数组的第一个元素的值,find() 并不会改变数组的原始值。