Skip to content

Instantly share code, notes, and snippets.

@willdages
Last active December 14, 2015 16:48
Show Gist options
  • Save willdages/5117526 to your computer and use it in GitHub Desktop.
Save willdages/5117526 to your computer and use it in GitHub Desktop.
Example of using the debugger statement in javascript code.
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