Errors & Debugging - SelfishHellfish/JS_Ref GitHub Wiki
Google chrome developer tools
ctrl-shift-i or f12
slow down script execution and analyze variables as they are changed
add variables to the watch window for easy monitoring
Hardcoding checks
console.log()
variables frequently in your script to see the values throughout execution
Writing code with the anticipation of possible errors
try {} catch (error) {console.log(error);} finally{}
. if the code in try
fails, the code in catch
will be executed. the code in finally
is always executed
debugging cheat sheet