array.pop() method 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"]
Example 3: pop javascript
let cats = ['Bob', 'Willy', 'Mini'];
cats.pop(); // ['Bob', 'Willy']