Open luo29 opened 8 months ago
` Object.prototype.map = function(callback){ if(typeof callback !== "function"){ throw new TypeError("param must be a Function") } const newObj = {} for(const key in this){ if(this.hasOwnProperty(key)){ newObj[key] = callback(this[key],key,this) } } return newObj }
`
` Object.prototype.map = function(callback){ if(typeof callback !== "function"){ throw new TypeError("param must be a Function") } const newObj = {} for(const key in this){ if(this.hasOwnProperty(key)){ newObj[key] = callback(this[key],key,this) } } return newObj }
`