JavaScript Problem


#1

Write a function called map which accepts two parameters: an array and a callback. The map function should return a new array with the result of each value being passed to the callback function. Here’s an example:

map([1,2,3,4], function(val){
    return val * 2;
}); // [2,4,6,8]

#2

maps needs to be called on an array, see the docs:


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.