how to use pop in javascript code example

Example 1: javascript remove last element from array

array.pop();   //returns popped element
//example
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.pop();  // fruits= ["Banana", "Orange", "Apple"];

Example 2: remove last element from array javascript

array.pop();

Example 3: js array pop

var array = ['A', 'B', 'C'];
// removes and returns last element
lastElement = array.pop();

Example 4: javascript pop

var cars = ['mazda', 'honda', 'tesla'];
var telsa=cars.pop(); //cars is now just mazda,honda

Example 5: js array.pop

let cats = ['Bob'];

cats.push('Willy'); // ['Bob', 'Willy']

cats.push('Puff', 'George'); // ['Bob', 'Willy', 'Puff', 'George']

Example 6: pop javascript

let cats = ['Bob', 'Willy', 'Mini'];

cats.pop(); // ['Bob', 'Willy']