Browser Developer Tools
Your most important tool
Every browser has DevTools: press F12 or Ctrl+Shift+I (Cmd+Option+I on Mac), or right-click → Inspect.
| Tab | What you do there |
|---|---|
| Elements | inspect and live-edit HTML and CSS, see the box model |
| Console | see errors, run JavaScript, console.log output |
| Network | every request: status, size, timing, headers, response |
| Sources | read code, set breakpoints, step through JavaScript |
| Application | localStorage, cookies, service workers |
| Lighthouse | audit performance, accessibility and SEO |
Everyday tricks
- Device toolbar (Ctrl+Shift+M): test phone and tablet sizes.
- Right-click a request → Copy as fetch to reproduce an API call.
console.table(arrayOfObjects)shows data as a table.- Tick Disable cache in the Network tab while developing.
- Throttle the network to Slow 4G to see how real users experience your site.
Reading errors
Red errors in the Console show the file and line number; click to jump there. Most bugs announce themselves here first.
Example
// Handy console helpers — try them in DevTools
const users = [
{ name: "Ana", role: "admin" },
{ name: "Ben", role: "editor" },
];
console.table(users); // neat table
console.warn("This is a warning");
console.error("This is an error");
console.time("loop");
for (let i = 0; i < 1e6; i++) {}
console.timeEnd("loop"); // loop: 3.2ms