1. 安装 node.js
2. Sublime 依次点击 菜单栏 Tools => Build System => New Build System
3. 文件中输入下边代码
{
"cmd":["node","$file"],
"selector":"source.js"
}
4. ctrl + s 保存文件,修改文件名
5. 调试js文件
新建 t1.js 写入下边代码
for (let i = 0; i < 3; i++) {
console.log('i:', i);
}
然后 command + b 编译
reference link: https://blog.csdn.net/lyn167/article/details/51924032