JavaScript filter() method for beginners
(╯°□°)╯ .filter()
We use this function in JavaScript to return a new array from the items matched true from the condition passed in the function.
Example 1
const myArray = [1, 2, 3, 4];
const newArray = myArray.filter((num) => num >= 2);
// [ 2, 3,...
lizeduplessis.hashnode.dev1 min read