Get Started with Debugging JavaScript in Chrome DevTools
This tutorial teaches you the basic workflow for debugging any JavaScript issue in DevTools. Step 1: Reproduce the bug Finding a series of actions that consistently reproduces a bug is always the first step to debugging. Click Open Demo . The demo opens in a new tab. OPEN DEMO Enter 5 in the Number 1 text box. Enter 1 in the Number 2 text box. Click Add Number 1 and Number 2 . The label below the button says 5 + 1 = 51 . The result should be 6 . This is the bug you're going to fix. Figure 1 . The result of 5 + 1 is 51. It should be 6. Step 2: Get familiar with the Sources panel UI DevTools provides a lot of different tools for different tasks, such as changing CSS, profiling page load performance, and monitoring network requests. The Sources panel is where you debug JavaScript. Open DevTools by pressing Command + Option + I (Mac) or Control + Shift + I...