how to filter an array by array code example
Example 1: filter array in js
const rebels = pilots.filter(pilot => pilot.faction === "Rebels");
const empire = pilots.filter(pilot => pilot.faction === "Empire");
Example 2: js filter array
const filterArray=(a,b)=>{return a.filter((e)=>{return e!=b})}
let array = ["a","b","","d","","f"];
console.log(filterArray(array,""));//>> ["a","b","d","f"]