js array.pop code example
Example 1: js array pop
var array = ['A', 'B', 'C'];
lastElement = array.pop();
Example 2: pop js
const plants = ['broccoli', 'cauliflower', 'cabbage', 'kale', 'tomato'];
console.log(plants.pop());
console.log(plants);
Example 3: javascript pop
var cars = ['mazda', 'honda', 'tesla'];
var telsa=cars.pop();
Example 4: js array.pop
let cats = ['Bob', 'Willy', 'Mini'];
cats.pop();
Example 5: js array.pop
let cats = ['Bob'];
cats.unshift('Willy');
cats.unshift('Puff', 'George');
Example 6: js array.pop
let cats = ['Bob'];
cats.push('Willy');
cats.push('Puff', 'George');