map
pop
push
最後の要素を削除して返します。
arr.pop()
下記の値を入力するとサンプルに即時反映されます。
const
stack
console
const stack = [1, 2, 3]; const last = stack.pop(); console.log(last); // 3 console.log(stack); // [1, 2]