0
Q:

.pop js

var cars = ['mazda', 'honda', 'tesla'];
var telsa=cars.pop(); //cars is now just mazda,honda 
10
const plants = ['broccoli', 'cauliflower', 'cabbage', 'kale', 'tomato'];

console.log(plants.pop());
// expected output: "tomato"

console.log(plants);
// expected output: Array ["broccoli", "cauliflower", "cabbage", "kale"]
1
var array = ['A', 'B', 'C'];
// removes and returns last element
lastElement = array.pop();
1
let cats = ['Bob', 'Willy', 'Mini'];

cats.pop(); // ['Bob', 'Willy']
1
let monTableau = ['un', 'deux','trois', 'quatre'] ;
monTableau.pop() ; 
console.log(monTableau) ;
 
0
let cats = ['Bob'];

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

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

New to Communities?

Join the community