YouTip LogoYouTip

Jsref Pop

```html JavaScript pop() method |

--

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.

Β© 2023 . All rights reserved.

```
← Jsref PushJsref Lastindexof Array β†’