Answers for "pop the last elements in the array"

2

how to remove the last element of an array in javascript

let cars = ['BMW', 'Benz', 'Audi'];

cars.pop(); // ['BMW', 'Benz']
Posted by: Guest on January-12-2021
0

remove last from array javascript

var fruits = ["Banana", "Orange", "Apple", "Mango"];
document.write(fruits);
document.write("<br>");
fruits.pop();

document.write(fruits)
Posted by: Guest on April-19-2021

Code answers related to "pop the last elements in the array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language