How do you launch the JavaScript debugger in Google Chrome?

前端 未结 15 1572
失恋的感觉
失恋的感觉 2020-11-22 03:33

When using Google Chrome, I want to debug some JavaScript code. How can I do that?

15条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-22 04:14

    Try adding this to your source:

    debugger;
    

    It works in most, if not all browsers. Just place it somewhere in your code, and it will act like a breakpoint.

提交回复
热议问题