面试题答案
一键面试if (!Array.prototype.map) {
Array.prototype.map = function(callback, thisArg) {
let result = [];
for (let i = 0; i < this.length; i++) {
if (this.hasOwnProperty(i)) {
result.push(callback.call(thisArg, this[i], i, this));
}
}
return result;
};
}