Browser DevTools
Master the Network, Performance, Memory, Console, Application, and Lighthouse panels to debug real apps.
Chrome DevTools is the primary instrument for diagnosing frontend problems, and a strong engineer knows which panel answers which question. The panels worth mastering are Network, Performance, Memory, Console, Application, and Lighthouse.
Use Network to trace requests, inspect timing waterfalls, and debug CORS and caching. Use Performance to record a session and read flame charts that reveal long tasks and layout/paint costs. Use Memory to take heap snapshots and hunt down leaks. Use Console for errors and logging, Application for storage, cookies, and service workers, and Lighthouse for automated audits of performance, accessibility, and SEO.
Together these panels cover the full debugging loop: Lighthouse tells you what is slow at a high level, Performance and Network show you why, Memory finds leaks over time, and Application inspects client-side state.
DevTools is your frontend observability stack. Network is request tracing / an APM waterfall (think distributed tracing spans). Performance is a CPU profiler/flame graph like async-profiler. Memory heap snapshots are your heap dump + leak analysis (like a Java heap dump in VisualVM). Console is application logs, and Lighthouse is an automated audit/health check.
- Network: trace requests, timing waterfalls, CORS, and cache behavior.
- Performance: flame charts expose long tasks and expensive layout/paint work.
- Memory: heap snapshots and allocation timelines find and confirm leaks.
- Application inspects storage/cookies/service workers; Lighthouse runs automated perf/a11y/SEO audits.
Worked Code
// Time a block of work
console.time('render');
renderDashboard();
console.timeEnd('render'); // render: 12.3ms
// Tabular view of an array of objects
console.table(expenses);
// Group related logs
console.group('API call');
console.log('request', payload);
console.log('response', data);
console.groupEnd();
// Assert an invariant — only logs when it fails
console.assert(total >= 0, 'total should never be negative', total);// Custom marks show up in the Performance panel's timeline
performance.mark('fetch-start');
await fetchExpenses();
performance.mark('fetch-end');
performance.measure('fetch-expenses', 'fetch-start', 'fetch-end');
const [entry] = performance.getEntriesByName('fetch-expenses');
console.log('fetch took', entry.duration, 'ms');Interview-Ready Q&A
Start with Lighthouse for a high-level audit and the suspected metric. Then use the Performance panel: record a load or interaction and read the flame chart to find long tasks, expensive layout/paint, and main-thread blocking. Cross-check with the Network panel's waterfall for slow or render-blocking requests. This narrows 'the page is slow' to a specific cause.
- 1Match the panel to the question: Network=requests, Performance=CPU/render, Memory=leaks, Application=storage.
- 2Lighthouse is the starting audit; Performance and Network explain the why.
- 3console.time/table/group and performance.mark/measure are quick wins for ad-hoc profiling.