Question: Write a higher-order function that when given an array of numbers, return a new array that only includes the even numbers. Hint: filter() function evensOnly(arr)
Write a higher-order function that when given an array of numbers, return a new array that only includes the even numbers. Hint: filter()
function evensOnly(arr) { // your code here } // test console.log(evensOnly([3, 5, 6, 8, 2, 11])); /// [6, 8, 2] javascript
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
