JavaScript: Filter array values

Photo by Joan Gamell on Unsplash

JavaScript: Filter array values

Table of contents

No heading

No headings in the article.

// Filter array values that are not present in array b 
let a = [1,2,3,5];
let b = [2,1,4,3];
let c = a.filter(item => !b.includes(item));

console.log(c);
Output:
[ 5 ]

Execute above code here