我想循环下面的代码。如何将列名保留在数组中并通过循环返回?
return Students.filter((singleItem) => {
singleItem["id"].toLowerCase().includes(value.toLowerCase()) ||
singleItem["name"].toLowerCase().includes(value.toLowerCase()) ||
singleItem["class"].toLowerCase().includes(value.toLowerCase())
});
例如:
var columns= ["id","name","class"];
return Students.filter((singleItem) => {
columns.map(data=>{
singleItem[data].toLowerCase().includes(value.toLowerCase()); //I have to use the "||" operation here. How can I use it in the loop?
})
});
PIPIONE
相关分类