A

Admin • 828.03K Points
Coach

Q. The pop() method of the array does which of the following task ?

  • (A) decrements the total length by 1
  • (B) increments the total length by 1
  • (C) prints the first element but no effect on the length
  • (D) None of the mentioned
  • Correct Answer - Option(A)
  • Views: 9
  • Filed under category JavaScript
  • Hashtags:

Explanation by: Admin
Arrays have a pop() method (it works with push()) that reduces the length of an array by 1 but also returns the value of the deleted element.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.