--
JavaScript pop() method
pop() method is used to delete the last element of an array and return that element.
let fruits = ["apple", "banana", "cherry"];
let lastFruit = fruits.pop();
console.log(fruits); // Output: ['apple', 'banana']
console.log(lastFruit); // Output: 'cherry'
For more information about JavaScript, please visit the JavaScript Reference.
YouTip