JavaScript Array pop() Method


The JavaScript array pop() method removes the last element from the given array and return that element. This method changes the length of the original array.

Javascript array pop() method removes the last element from an array and returns that element.

Syntax

array.pop()

Example

var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.pop();

Example -