fruits = ['香蕉','苹果','梨子','水蜜桃','橘子','橙子']; eatfruit = ['香蕉','水蜜桃','橘子']; other = []; this.other = this.fruits.filter(item => { return this.eatfruit.every(item2 => { return item != item2; }); }).map((item) => { return item; });
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