Console.log Everything
1 / 5

Console.log Everything

The simplest debugging tool

code
console.log('Value:', variable);
console.log({ obj, data });
Use Breakpoints
2 / 5

Use Breakpoints

Pause execution and inspect state

code
debugger; // Pauses here in DevTools
Read Error Messages
3 / 5

Read Error Messages

Error messages tell you exactly what went wrong

code
// TypeError: Cannot read property 'x' of undefined
// This means the object is undefined!
Rubber Duck Debugging
4 / 5

Rubber Duck Debugging

Explain your code out loud to find bugs

code
// 🦆 Talk through your logic step by step