How to debug javascript when it goes into infinite loops and recursive calls in Javascript?

前端 未结 3 981
孤城傲影
孤城傲影 2020-12-14 05:38

When you are in the infinite loop or recursive calls, basically the browser stops responding to anything (either on Chrome or FF). You cannot see logs, cannot get into debug

3条回答
  •  长情又很酷
    2020-12-14 06:19

    Found another way of debugging. In my case the error was caught and so no errors where logged to the console. Found the bug with the checkbox Pause on caught exceptions. You find the option in den dev tools unter the Sources tab. To show and enable the checkbox click on the last icon:

    After enabling this, the debugger pauses on every caught exception.

提交回复
热议问题