Last Updated: February 25, 2016
·
1.685K
· jcreamer898

Breakpoint in JS Code

A quick way to force a browser to hit a breakpoint in a block of JS code is with the debugger keyword.

//codecodecode
debugger;
someMethodToDebug();
//morecodecodecode

When the browser is running the JS code it will automatically cause a breakpoint to occur in the code. Neat eh?

2 Responses
Add your response

Just don't forget to remove it before committing :)

over 1 year ago ·

haha, good point!

over 1 year ago ·

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.

Security insights from Cside