You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
return n %2===0; // true if "n" is par, false if "n" isn't
628
628
});
629
-
console.log(parNumbers); // [0, 2, 4, 6]
629
+
console.log(evenNumbers); // [0, 2, 4, 6]
630
630
```
631
631
632
632
We are using .filter on the *numbers* array, filter is iterating on each element of the array and passes it to our function. The goal of the function is to return a boolean that will determine whether the current value will be kept or not. Filter then returns the array with only the kept values.
0 commit comments