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]; |
Beta Was this translation helpful? Give feedback.
-
|
function isEven(number) { function filter(numbers, fn) { |
Beta Was this translation helpful? Give feedback.
-
|
function myFilter(my_array, callback) { let numArr = [4, 5, 6, 7, 8, 9]; let oddArr = myFilter(numArr, function (n) { console.log(oddArr); |
Beta Was this translation helpful? Give feedback.
-
|
`function evenoddFinder(num) { } function evenNumberFilter(arrayNum, evenoddFinder) { function processElement() { |
Beta Was this translation helpful? Give feedback.
-
|
function fnCallback(a) { function myFilter(my_arr, callback) { myFilter([4, 5, 6, 7, 8, 9], fnCallback); |
Beta Was this translation helpful? Give feedback.
-
|
function filter(arr1,callback) |
Beta Was this translation helpful? Give feedback.
-
|
function myfilter(a, b){ function even(a){ } let a = [1,2,3,4,5,6,7]; |
Beta Was this translation helpful? Give feedback.
-
|
function myFilter(my_array, callback) { |
Beta Was this translation helpful? Give feedback.
-
|
function m(my_array, callback) { |
Beta Was this translation helpful? Give feedback.
-
|
var arr=[4,6,9,8,3]; |
Beta Was this translation helpful? Give feedback.

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:
Beta Was this translation helpful? Give feedback.
All reactions