Which of the following array methods does NOT modify the original array?

  • splice()
  • slice()
  • map()
  • filter()
The slice() method does NOT modify the original array. Instead, it returns a new array containing a shallow copy of elements from the original array. You can specify a range of indices to slice from the original array. This is useful when you want to extract a portion of the array without altering the original data. The other methods, splice(), map(), and filter(), can modify the original array.
Add your answer
Loading...

Leave a comment

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