How to force Chrome debugging tools to debug in pretty code?

前端 未结 6 2048
囚心锁ツ
囚心锁ツ 2021-02-02 07:33

Although I used pretty code and had set up the breakpoints in \"Pretty code\" tab, debugger keeps working in minified code. (I can\'t see exactly where I am and need to continuo

6条回答
  •  臣服心动
    2021-02-02 08:22

    simply put debugger; at top of the js code.

    ex:

    function add(n1, n2) {
      debugger;
      let sum = n1 + n2;
      return sum;
    }
    

提交回复
热议问题