JS: Array.prototype.pop
xArray.pop()-
- Remove and return the last item.
- If xArray is empty, return undefined.
// example of pop const xx = [3, 4, 5]; const yy = xx.pop(); console.log(xx); // [ 3, 4 ] console.log(yy); // 5
xArray.pop()// example of pop const xx = [3, 4, 5]; const yy = xx.pop(); console.log(xx); // [ 3, 4 ] console.log(yy); // 5