pop function in javascript code example
Example 1: javascript remove last element from array
array.pop();
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.pop();
Example 2: javascript remove last element from array
var colors = ["red","blue","green"];
colors.pop();
Example 3: js array pop
var array = ['A', 'B', 'C'];
lastElement = array.pop();
Example 4: método pop javascript
const cars = ['Porsche', 'Ferrari', 'Mustang', 'Rolls Royce', 'Lamborghini'];
console.log(cars.pop());
console.log(cars);
Example 5: pop js
const plants = ['broccoli', 'cauliflower', 'cabbage', 'kale', 'tomato'];
console.log(plants.pop());
console.log(plants);
Example 6: javascript pop
var cars = ['mazda', 'honda', 'tesla'];
var telsa=cars.pop();