Problem
Implement polyfills for the core array methods as Array.prototype.myMap, myFilter, myReduce, and myEvery. Match the native callback signature (element, index, array) and, for reduce, the optional initialValue.
Array.prototype.myMap = function (callback, thisArg) {
// your code
};
Array.prototype.myFilter = function (callback, thisArg) {
// your code
};
Array.prototype.myReduce = function (callback, initialValue) {
// your code
};
Array.prototype.myEvery = function (callback, thisArg) {
// your code
};