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
Updated on 15-Jun-2020 08:15:06

Advertisements