[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 ...
随机推荐
- Is It A Tree? POJ - 1308(并查集判树)
Problem Description A tree is a well-known data structure that is either empty (null, void, nothing) ...
- 最长回文 HDU - 3068(马拉车算法)
Problem Description 给出一个只由小写英文字符a,b,c...y,z组成的字符串S,求S中最长回文串的长度. 回文就是正反读都是一样的字符串,如aba, abba等 Input 输入 ...
- 剑指offer47:位运算+递归。求1+2+3+...+n,要求不能使用乘除法、for、while、if、else、switch、case等关键字及条件判断语句(A?B:C)。
1 题目描述 求1+2+3+...+n,要求不能使用乘除法.for.while.if.else.switch.case等关键字及条件判断语句(A?B:C). 2 思路和方法 (1)递归,不能使用if等 ...
- javascript获取当前用户访问的宽带IP地址
javascript获取当前用户访问的宽带IP地址 <script src="http://pv.sohu.com/cityjson?ie=utf-8"></sc ...
- Go语言之依赖管理
Go语言之依赖管理 Go语言的依赖管理随着版本的更迭正逐渐完善起来. 依赖管理 为什么需要依赖管理 最早的时候,Go所依赖的所有的第三方库都放在GOPATH这个目录下面.这就导致了同一个库只能保存一个 ...
- MongoDB的复合唯一索引
一 创建 JavaScript Shell db.room.ensureIndex({'floor':1,'num':1}) Spring Data @Data // lombok @Document ...
- ScrumBasic开发记录
ScrumBasic 是基于asp.net core 1.0的开源敏捷管理软件.目前第一版.目前只有很基础的东西.希望我能将这个项目演变下去. 地址:https://github.com/CAH-Fl ...
- python滴啊用caffe时的小坑
在使用caffe的python接口时, 如下,如果标黄的部分不加上的话,两次调用该函数,后面的会将前面的返回值覆盖掉,也就是fea1与fea2相等,但是fea1_ori会保留原来的fea1 解决方法为 ...
- LeetCode 腾讯精选50题--链表排序
解题思路:归并 先把链表拆开,分为两部分,一直拆到只剩一个元素后,进行合并,利用一个临时节点记录重排后的链表的起始位置 合并不难,困难点在于如何拆分链表,自己的大体思路是利用两个指针,一个一次移动两位 ...
- 第七章、Ajango自带auth模块
目录 第七章.Ajango自带auth模块 一.什么是auth auth是django自带的用户认证模块 二.auth模块的常用方法 三.拓展默认的auth_user表 第七章.Ajango自带aut ...