Removing an element from the end of the array in Javascript

JavascriptWeb DevelopmentFront End Technology

Removing an element from the end of the array

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

Example

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

Output

This will give the output −

["Onion"]
raja
Published on 26-Jun-2018 17:20:31
Advertisements