The remaining array (from 'array of fruits' screened out 'eat array')

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

Guess you like

Origin blog.csdn.net/weixin_34365635/article/details/93338277