Removing an Item from Javascript Array | JavaScript Array pop() Method Example | JavaScript Tutorial


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();

The result of fruits will be:

Banana,Orange,Apple