How to insert a breakpoint into Javascript by code

Asked

Viewed 917 times

3

I know it is possible to mark a line as breakpoint using Dev Tools, but it is possible to invoke the browser Debugger directly from the code?

1 answer

6


You can use the keyword debugger

function(){
   debugger; // quando estiver no modo de debug (F12) o cursor irá parar aqui
   alert("Is me...");
}
  • 2

    devtools must be open

Browser other questions tagged

You are not signed in. Login or sign up in order to post.