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