Which of the following methods in JavaScript will remove the last element from an array and return that element?

  • pop()
  • shift()
  • splice()
  • unshift()
The pop() method in JavaScript is used to remove the last element from an array and return that element. It modifies the original array by removing the last element. The other options (shift(), splice(), and unshift()) are used for different array operations.
Add your answer
Loading...

Leave a comment

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