Finally Catches Exception

no-email (Damien Seguy), Damien Seguy
Fri, 12 Jan 2024 00:00:00 +0000

In this code, finally is executed after the throw. Since it contains a return, the function is finalized before the throw is executed. The exception is then lost, and the scripts displays 1. This is why it is recommended to avoid return in a finally clause.