Skip to content

Instantly share code, notes, and snippets.

@daaimah123
Last active July 2, 2021 17:41
Show Gist options
  • Save daaimah123/00356954a75c7dcdf2d6d76b53dfa4b1 to your computer and use it in GitHub Desktop.
Save daaimah123/00356954a75c7dcdf2d6d76b53dfa4b1 to your computer and use it in GitHub Desktop.
Debugging: Tools and Common Issues
==> TOOLS
console.warn()
console.error()
console.table() ==> formatted table with index and value
'use strict'; ==> opts out of silen errors for scripts
Google Chrome breakpoint settings ==> click the line number to pause execution at that point and
observe scope tab to determine what is occuring at the breakpoint
==> COMMON ISSUES
prompt() ==> will always return a string, will need to change number answers to literals using Number()
ReferenceError
==> Can be related to scoping issue
==> TDZ error: Cannot access variable before initialized
Nullish Coalesce (??)
==> will evaluate truthy if null or undefined (NOT 0 or '') or will evaluate to parameter after the ??
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment