Question · JavaScript and TypeScript course · Module 2: Functions, Arrays and Objects

Array Basics - pop() Method

What does the Array.prototype.pop() method do?

Answer options

  • Sorts the array in descending order
  • Removes and returns the last element of the array
  • Returns the array length
  • Adds an element to the end of the array
Show the answer

Correct answer:

  • Removes and returns the last element of the array