Answers for "remove las item from array js"

C
27

“javascript remove last element from array

array.pop();   //returns popped element
//example
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.pop();  // fruits= ["Banana", "Orange", "Apple"];
Posted by: Guest on July-10-2020
-1

remove last entry from array in Javascript

arr.slice(0, -1);    // returns [1,0]
Posted by: Guest on October-27-2021

Code answers related to "C"

Browse Popular Code Answers by Language