Implement myMap(arr, callback)
The classic first interview polyfill. Write myMap(arr, callback) that behaves like Array.prototype.map: it calls callback(item, index, array) for every element and returns a new array of the results, without mutating the original.
myMap([1, 2, 3], (n) => n * 2); // [2, 4, 6]