Which method removes and returns the last element of an array?

JavaScript Associate Easy

JavaScript Associate — Easy

Which method removes and returns the last element of an array?

Key points

  • pop() removes the last element of an array
  • shift() removes the first element
  • splice() can remove elements at any position
  • slice() creates a new array without modifying the original

Ready to go further?

Related questions