“If debugging is the process of removing bugs, then programming must be the process of putting them in.”
Log statements:
console.log;
console.time;
console.error;
console.warn;
if (someBoolean) console.log;
Debugger statements:
debugger;
if (someBoolean) debugger;
Inspector
Logs:
Breakpoints:
Challenge: There’s some code to display the birthday for an array of users. They’re all fine besides this one. I know the user’s name is “Mark” but we have thousands of users and the API returns them in a different order each time. Set a conditional breakpoint in the code that iterates over the users and then find the bug. Is it an issue with the code or with the data?
While Debugging:
Challenge: There’s some function that doesn’t work correctly. We’re pretty sure we have a fix for it (include the fix here). Place a breakpoint near that code than run the code that could fix it in the console to see if it returns what we’re expecting.
Styles editor Challenge: Which styles rule do you have to disable in order for