For example you have the following code;

function reverse(str) {
let reversed = "";
for (let char of str) {
reversed = char + reversed;
}
return reversed;
} module.exports = reverse;

If you want to debug is in Node, you can do:

function reverse(str) {
let reversed = "";
for (let char of str) {
debugger; // add debugger
reversed = char + reversed;
}
return reversed;
} reverse("awefw"); // call the function module.exports = reverse;

Then in cmd, run:

node inspect index.js

Then just type 'continue' or just 'c'.

It will pause on liine of 'debugger;' Now for example you want to see, what is the variable 'str':

you can type: 'repl':

Then after you enter 'str', you will see the output.

最新文章

  1. 【转】windows环境下安装win8.1+Mac OS X 10.10双系统教程
  2. 完美C++(第5版)(双色)
  3. noi 2989 糖果
  4. C/C++获取系统时间
  5. Linux 中open系统调用实现原理【转】
  6. 狗狗40题~(Volume B)
  7. org.elasticsearch.bootstrap : JNA not found. native methods will be disabled
  8. JAVA 命令行参数解析,org.apache.commons.cli的使用
  9. springboot打包不同环境配置与shell脚本部署
  10. MFC映射
  11. 网络流24题——分配问题 luogu 4014
  12. springboot缓存注解——@CacheEvict
  13. Kubernetes实战(一):k8s v1.11.x v1.12.x 高可用安装
  14. 你还在为无法完美卸载SQL Server 2008 R2而烦恼吗?
  15. IAR for stm8 memory窗口的功能
  16. homewor
  17. Codeforces 801C Voltage Keepsake(二分枚举+浮点(模板))
  18. Gunicorn+Flask中重复启动后台线程问题
  19. OC开发_Storyboard——AutoLayout
  20. ueditor与mvc4中坑 -编辑时显示源码问题

热门文章

  1. TP5.1框架中的模型关联
  2. C++ STL String学习 (待续)
  3. fiddler笔记:快捷工具栏
  4. Devexpress xaf BO中字段为RuleRequiredField必输字段时,文本标签默认添加*标记
  5. 解决python在cmd运行时导入包失败,出现错误信息 "ModuleNotFoundError: No module named ***"
  6. MySQL - 性能优化 & MySQL常见SQL错误用法(转载)
  7. 浅谈后缀数组SA
  8. Lua虚拟机中的数据结构与栈
  9. Swagger学习(二、配置swagger)
  10. iOS UIControl 事件的说明(转)