myForEach
Array.prototype.myForEach = function (callback, thisArg = undefined) { if (typeof callback !== 'function') { throw new TypeError(`${callback} is not a function`); } let index = 0 const len = this.length while (index < len) { if (index in this) callback.call(thisArg, this[index], index, this) index++ } }
以自己现在的努力程度,还没有资格和别人拼天赋