[Debug] Debugger Statements
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.
[Debug] Debugger Statements的更多相关文章
- React Native & debug & debugger
React Native & debug & debugger http://localhost:8081/debugger-ui/ react-devtools # yarn: $ ...
- c# 判断当前版本是Debugger或Release
1.第一种 (常用) #if DEBUG //debugger 环境 #else //release 环境 #endif 2. 第二种 private bool IsDebug() { Assembl ...
- ARMV8 datasheet学习笔记4:AArch64系统级体系结构之Self-hosted debug
1. 前言 2. 关于self-hosted debug Debugger调试器 是操作系统或系统软件的一部分,它会处理debug exception或修改debug system register, ...
- JSLint检测Javascript语法规范
前端javascript代码编写中,有一个不错的工具叫JSLint,可以检查代码规范化,压缩JS,CSS等,但是他的语法规范检查个人觉得太“苛刻”了,会提示各种各样的问题修改建议,有时候提示的信息我们 ...
- Drools mvel方言drl断点调试方法
开发环境:myeclipse2014, jdk1.8.0.91,drools6.4.0.Final, drools-eclipse-plugin,mvel2-2.2.6.Final问题描述:drl使 ...
- 代码检查工具jshint和csslint
前面的话 Douglas Crockford大神根据自己的理念用JavaScript写了一个JavaScript代码规范检查工具,这就是JSLint.后来非常流行,也的确帮助了广大的JavaScrip ...
- sublime使用总结
上周忙呀忙~ 周一到五在忙项目,周六日搬家 在帝都平均一年就要换一次房子,从开始找房子到成功住进去前前后后大约花了半个多月的时间 什么时候就有自己的小窝了-- 之前开发一直用的都是W ...
- dfsdf
This project was bootstrapped with Create React App. Below you will find some information on how to ...
- nodejs 前端工具总结
htmlhint https://github.com/yaniswang/HTMLHint 使用 var HTMLHint = require("htmlhint").HTMLH ...
随机推荐
- SQL SERVER CONVERT函数
定义: CONVERT函数返回 转换了数据类型的数据. 语法: CONVERT(target_type,expression,date_style smallint) 参数: ①target_type ...
- oracle 创建新用户,授权dba
1.用有dba权限的用户登录:sys用户 2.创建一个新用户:create user abc identified by 123456; 3.授予DBA权限: grant connect,resour ...
- 【AtCoder】ARC064
ARC064 C - Boxes and Candies 先把每个盒子都消到x 然后从前往后推,要求第二个的上界是x-前一个 因为我们要求靠后的那个尽量小,会对后面的修改影响尽量小 #include ...
- [DEBUG] Spring boot前端html无法下载示例文件
更新:原方法打jar包的时候是可以的,后来我打war包之后下载的文件就是0字节.尴尬:) 所以现在更换一种方法,然后打war包.在服务器已测试成功. 前端不需要改变,只需要更改controller: ...
- Windows Eclipse Scala的入门HelloWorld
[学习笔记] Windows Eclipse Scala的入门HelloWorld 有关带scala版本的eclipse4.7的下载, 你可以直接去: http://scala-ide.org/dow ...
- 莫比乌斯反演--HDU模板题
题意:http://acm.hdu.edu.cn/showproblem.php?pid=1695 直接上莫比乌斯模板. #include <bits/stdc++.h> using na ...
- PHP接收前端传值各种情况整理
PHP接收前端传值各种情况整理 服务端代码: header('Access-Control-Allow-Origin:*'); var_dump($_POST); exit; 情况 1) 传null ...
- Vue路由传参及传参后刷新导致参数消失处理
项目功能需要,要从列表页跳转到第三方提供的URL上(这里第三方页面我是通过iframe引入在详情页,目的是点击返回时可以通过keepAlive让列表页不刷新,如果不通过iframe直接跳第三方链接,那 ...
- MySQL create table语法详解
前面在查建表时key和index的区别时,发现建表语句包含了太多信息,于是完整看看官方手册的这一小节. 该文章根据MySQL 5.7的手册作笔记,而MySQL 8.0该节地址如下: https://d ...
- Servlet获取JSP中的汉字乱码问题解决方案
1.String customerName=request.getParameter("customer_name");这样会出现乱码 解决方案很简单: String custom ...