Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save TheMajical/a6bb512c3abcedaeda40f675bf1b29e4 to your computer and use it in GitHub Desktop.
Save TheMajical/a6bb512c3abcedaeda40f675bf1b29e4 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