fruits = [ 'banana', 'apple', 'pear', 'peaches', 'orange', 'orange' ]; eatfruit = [ 'banana', 'peaches', 'orange' ]; OTHER = [] ; the this .OTHER = the this .fruits.filter (Item => { return the this .eatfruit.every (ITEM2 => { return Item =! ITEM2; }); }) Map ((Item). => { return Item; } );
Reproduced in: https: //www.cnblogs.com/yuyedaocao/p/11009229.html