数组

const arra = ['a', 'b', 'c', 'd', 'e'];
const arrb = ['b', 'e'];
console.log("some: " + arra.filter(v => !arrb.some((item) => item === v)));
console.log("find: " + arra.filter(v => !arrb.find((item) => item === v)));
console.log("findIndex: " + arra.filter(v => arrb.findIndex((item) => item === v) < 0));
console.log("includes: " + arra.filter(v => !arrb.includes(v)));
console.log(arra);

posted @ 2023-02-03 14:46  nate_pan  阅读(11)  评论(0编辑  收藏  举报