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