【REPL】Read-Eval-Print-Loop读取-执行-输出循环

373 阅读1分钟

REPL 提供了一种交互地执行 JavaScript 并查看输出的方式。它可以被用作调试、测试或仅仅尝试某些东西。

在命令行输入 node 就会进入 REPL

image.png

.break    Sometimes you get stuck, this gets you out
.clear    Alias for .break
.editor   Enter editor mode
.exit     Exit the repl
.help     Print this help message
.load     Load JS from a file into the REPL session
.save     Save all evaluated commands in this REPL session to a file

之前老是跑到浏览器的console,现在才发现这个,记录下