1、forEach
this.list.forEach(items => {
if (items.name.indexOf(keywords) != -1) {
newList.push(items);
}
});
2、some
3、filter
4、findIndex
以上都会对数组中的每一项进行遍历
1、forEach
this.list.forEach(items => {
if (items.name.indexOf(keywords) != -1) {
newList.push(items);
}
});
2、some
3、filter
4、findIndex
以上都会对数组中的每一项进行遍历