joelanman,
@joelanman@hachyderm.io avatar

This feels a bit wonky to me. You can't use const like this:

try {  
 const myVar = myFunc(options)  
} catch (error) {   
 console.error(error)  
}

console.log(myVar)  

as myVar doesn't exist outside the try scope. So if you need to do a try catch, you have to use let - even if you actually want to use the variable as a const (not change it later)

let myVar  
try {  
 myVar = myFunc(options)  
} catch (error) {   
 console.error(error)  
}

console.log(myVar)  

  • All
  • Subscribed
  • Moderated
  • Favorites
  • javascript
  • GTA5RPClips
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • osvaldo12
  • ethstaker
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • ngwrru68w68
  • kavyap
  • modclub
  • cubers
  • provamag3
  • InstantRegret
  • khanakhh
  • tester
  • everett
  • Durango
  • tacticalgear
  • normalnudes
  • megavids
  • Leos
  • cisconetworking
  • anitta
  • JUstTest
  • lostlight
  • All magazines