Answers for "take off element form end of array"

26

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

take off element form end of array

const colors = ["Blue", "Green", "Red", "Yellow"];
colors.pop();

console.log(colors); // ["Blue", "Green", "Red"]
Posted by: Guest on October-13-2020

Code answers related to "take off element form end of array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language