In the method myArray.map(callback), what is the second argument passed to the callback?

  • Element's Index (optional)
  • Current Array (optional)
  • Previous Element (optional)
  • Current Index (optional)
In the map() method, the second argument passed to the callback is the current array itself. While the first argument represents the current element, the second argument provides access to the entire array if needed for mapping logic.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *