Pop
The pop method removes the last element from an array and returns that element.
let arr = ["one", "two", "three", "four", "five"];
arr.pop();
console.log(arr);
// Result: ['one', 'two', 'three', 'four']Last updated
Was this helpful?
The pop method removes the last element from an array and returns that element.
let arr = ["one", "two", "three", "four", "five"];
arr.pop();
console.log(arr);
// Result: ['one', 'two', 'three', 'four']Last updated
Was this helpful?