Skip to content

📚 3.forEach

💻 代码实现

typescript
Array.prototype._forEach = function (callback) {
    for (let i = 0; i < this.length; i++) {
        callback(this[i], i, this)
    }
}

Released under the MIT License.