This tutorial teaches you the basic workflow for debugging any JavaScript issue in DevTools. Read on, or watch the video version of this tutorial.
Reproduce the bug
Finding a series of actions that consistently reproduces a bug is always the first step to debugging.
- Open this demo in a new tab.
- Enter
5in the Number 1 box. - Enter
1in the Number 2 box. - Click Add Number 1 and Number 2. The label below the button says
5 + 1 = 51. The result should be6. This is the bug you're going to fix.