using Google Chrome
REPL in Google Chrome
stops execution and starts debugger tool
click on the gutter to the left of where you want to add a breakpoint
refresh the browser
debug( functionName );
> function foo(){ return "bar"; }
<- undefined
> debug(foo);
<- undefined
> foo();
pauses execution and begins the debugging session
function foo(){
var value = "bar";
debugger;
value = "baz";
return value;
}
foo();
step by step execution
1 2 3 4 5 6
displays the value of an expression while you step through
Click the [+] button to add a watch expression
add the variable named value
the value is updated while stepping through the program
displays what variables are visible in the current scope