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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!