Array.prototype.myMap=function(fn, args){if(Object.prototype.toString.call(fn)!=='[object Function]'){throw(fn +' is not a function')}let newArr =[]let that =thisfor(let i =0; i < that.length; i ++){
newArr[i]=fn.call(args, that[i], i , that)}return newArr
}