pop
마지막 요소를 제거하고 반환합니다.
arr.pop()
아래 값을 입력하면 예제에 즉시 반영됩니다.
const
stack
console
const stack = [1, 2, 3]; const last = stack.pop(); console.log(last); // 3 console.log(stack); // [1, 2]