How to delete an element from the array and get the deleted element as the return value?
This method is used to delete the last element of an array and to return the deleted element. The length of the array gets affected by this function. Syntax:
var ele = stack.pop();