arr pop js code example
Example 1: javascript remove last element from array
var colors = ["red","blue","green"];
colors.pop();
Example 2: js array pop
var array = ['A', 'B', 'C'];
// removes and returns last element
lastElement = array.pop();
Example 3: javascript array pop
let animals = ["dog","cat","tiger"];
animals.pop(); // ["dog","cat"]
animals.push("elephant"); // ["dog","cat","elephant"]