Computer >> Computer tutorials >  >> Programming >> Javascript

Removing an element from the start of the array in javascript


This can be accomplished using the unshift method. For example, 

Example

let veggies = ["Onion", "Raddish"];
veggies.shift();
console.log(veggies);

Output

This will give the output −

["Raddish"]