Filtering-Arrays
Filtering Arrays in JS
In JS there is a built in function for arrays called .filter()
which takes the given array and returns a new array with all the values which match the arguments in the function.
Example
const someStuff = [1,2,3,4,5];
const filteredStuff = someStuff.filter(
(val) => val > 3,
);
console.log(filteredStuff);
// Expected results
// > Array [4, 5]
#JavaScript