Run and Debug JavaScript
This lesson is browser-only. No Node.js setup is required for this roadmap.
Run in browser
- Open an HTML file in your browser.
- Open developer tools (
F12orCtrl+Shift+I). - Use Console for quick experiments.
Breakpoints
Open Sources panel, find your script, and click a line number to pause execution.
Inspect state
- Watch variables in Scope panel.
- Evaluate expressions in Console while paused.
- Step over, step into, and step out to trace flow.
Network debugging
Use Network panel to inspect API requests, status codes, payloads, and timing.
Debug checklist
- Reproduce issue with minimal steps.
- Read console and stack traces.
- Set breakpoint near failure.
- Confirm assumptions with inspected values.
- Retest after fix.