Skip to content

Instantly share code, notes, and snippets.

View TwoFistedJustice's full-sized avatar

Russ TwoFistedJustice

  • CA: Bay Area, SoCal, SLO
View GitHub Profile
@TwoFistedJustice
TwoFistedJustice / bubbleUp.js
Last active June 22, 2024 19:23
This gist demonstrates how errors bubble up (or not) through the call stack depending on where you place your try-catch blocks.
/* This gist demonstrates how errors bubble up (or not) through the call stack
* depending on where you place your try-catch blocks
*
* You will get different results by reverse-commenting the two versions of the
* 'result' variable in topLevel()
* */
const topLevel = function(bool=false){
let name = topLevel.name;
try {