The pop() method removes the last element of an array, and returns that element. pop() method also changes the length of an array after removing the last element.
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.pop();
fruits.pop();
The result of fruits will be:
Banana,Orange,Apple