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