参考资料

先进后出

const stack = [];
stack.push(...[1, 2, 3]);
while (stack.length > 0) {
  console.log(stack.pop());
}
ON THIS PAGE