1var array = ['A', 'B', 'C'];
2// removes and returns last element
3lastElement = array.pop();
1var cars = ['mazda', 'honda', 'tesla'];
2var telsa=cars.pop(); //cars is now just mazda,honda
1const plants = ['broccoli', 'cauliflower', 'cabbage', 'kale', 'tomato'];
2
3console.log(plants.pop());
4// expected output: "tomato"
5
6console.log(plants);
7// expected output: Array ["broccoli", "cauliflower", "cabbage", "kale"]
1let animals = ["dog","cat","tiger"];
2
3animals.pop(); // ["dog","cat"]
4
5animals.push("elephant"); // ["dog","cat","elephant"]
1let myFish = ['angel', 'clown', 'mandarin', 'sturgeon'];
2
3let popped = myFish.pop();
4
5console.log(myFish); // ['angel', 'clown', 'mandarin' ]
6
7console.log(popped); // 'sturgeon'
8