fruits = ['香蕉','苹果','梨子','水蜜桃','橘子','橙子'];eatfruit = ['香蕉','水蜜桃','橘子'];other = [];this.other = this.fruits.filter(item => { return this.eatfruit.every(item2 => { return item != item2; }); }).map((item) => { return item;});
本文共 301 字,大约阅读时间需要 1 分钟。
fruits = ['香蕉','苹果','梨子','水蜜桃','橘子','橙子'];eatfruit = ['香蕉','水蜜桃','橘子'];other = [];this.other = this.fruits.filter(item => { return this.eatfruit.every(item2 => { return item != item2; }); }).map((item) => { return item;});
转载于:https://www.cnblogs.com/yuyedaocao/p/11009229.html