Open jobs2817 opened 2 years ago
Array.prototype.map = function(fun, ctx) { if (Object.prototype.toString.call(fun) !== '[object Function]') { throw new Error(${fun} is not function) } const arr = [] for (let i= 0; i<this.length; i++) { arr.push(fun.call(ctx, this[i], i)) } return arr }
${fun} is not function
Array.prototype.map = function(fun, ctx) { if (Object.prototype.toString.call(fun) !== '[object Function]') { throw new Error(
${fun} is not function
) } const arr = [] for (let i= 0; i<this.length; i++) { arr.push(fun.call(ctx, this[i], i)) } return arr }