How to Find the Exact Line of an Infinite Loop Bug in the code

Infinite Loop

Example Project Used
https://stackblitz.com/edit/js-vub9fd?file=index.js

Steps

  • Find the cause of the infinite loop in the UI (ex: a button click)
  • Open the Performance Tab in the DevTools
  • Click record

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store