diff --git a/151.implement-Array-prototype-map.md b/151.implement-Array-prototype-map.md index 49da932..d05af0f 100644 --- a/151.implement-Array-prototype-map.md +++ b/151.implement-Array-prototype-map.md @@ -70,7 +70,7 @@ This JavaScript code is a custom implementation of the `Array.prototype.map()`fu Here's a breakdown of the code: -1. `Array.prototype.myMap = function (callback, thisArg) {...}` This line is extending the Array prototype with a new method called `myMap`. This method takes two arguments: a `callback` function and an optional `thisArg` object that will be used as `this`] when executing the callback. +1. `Array.prototype.myMap = function (callback, thisArg) {...}` This line is extending the Array prototype with a new method called `myMap`. This method takes two arguments: a `callback` function and an optional `thisArg` object that will be used as `this` when executing the callback. 2. `const length = this.length;`: This line is storing the length of the array on which `myMap` was called. This is done to avoid potential infinite loops if the array's length is changed during the execution of `myMap`.