Answers for "when push to array javascript it delete the last thing added"

15

javascript remove last element from array

var colors = ["red","blue","green"];
colors.pop();
Posted by: Guest on January-11-2020
8

how to remove last element in js

var array = [1, 2, 3, 4, 5, 6];
array.pop();
console.log(array);
//Output in console section:
//[1, 2, 3, 4, 5]
Posted by: Guest on August-06-2020

Code answers related to "when push to array javascript it delete the last thing added"

Code answers related to "Javascript"

Browse Popular Code Answers by Language