Task - Callback Functions #13
Replies: 10 comments 2 replies
|
function myfilter(a, b){ } function even(a){ let a = [1,2,3,4,5,6,7]; |
|
function isEven(number) { function filter(numbers, fn) { |
|
function myFilter(my_array, callback) { let numArr = [4, 5, 6, 7, 8, 9]; let oddArr = myFilter(numArr, function (n) { console.log(oddArr); |
|
`function evenoddFinder(num) { } function evenNumberFilter(arrayNum, evenoddFinder) { function processElement() { |
|
function fnCallback(a) { function myFilter(my_arr, callback) { myFilter([4, 5, 6, 7, 8, 9], fnCallback); |
|
function filter(arr1,callback) |
|
function myfilter(a, b){ function even(a){ } let a = [1,2,3,4,5,6,7]; |
|
function myFilter(my_array, callback) { |
|
function m(my_array, callback) { |
|
var arr=[4,6,9,8,3]; |

Uh oh!
There was an error while loading. Please reload this page.
Write a myFilter function that takes 2 parameters: my_array and callback.
Here, my_array is an array of numbers and callback is a function that takes the elements of my_array as its parameter and returns a boolean true if the element is even or false if the element is odd.
The myFilter function should return the filtered array.
Write the code for the callback function and provide the implementation of myFilter function:
All reactions