Last active
December 14, 2015 16:48
-
-
Save willdages/5117526 to your computer and use it in GitHub Desktop.
Example of using the debugger statement in javascript code.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function add(input1, input2) { | |
debugger; | |
return input1 + input2; | |
} | |
// Debugger is like using breakpoints in the source inspector, | |
// it pauses script execution and gives you access to local variables | |
// Run this example and type in 'input1' into the console when the page | |
// goes gray -- you have access to the scope where you put the 'debugger' statement! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment