HackerTrans
トップ新着トレンドコメント過去質問紹介求人

desert_boi

no profile record

コメント

desert_boi
·7 年前·議論
Interestingly when I was encountering this myself recently, I discovered that JS finally blocks can return after a function has nominally already returned. Consider the following closure.

    (() => {
      try {
        // finally will return prior to this console.log
        console.log('this try was executed and the return ignored')
        return 'try block'
      } catch (e) {
        return 'error block'
      } finally {
        return 'finally block'
      }  
    })()