How does a return statement inside a try/catch block work?
function example() { try { return true; } finally { return false;
When you use finally, any code within that block fires before the method exits. Because you're using a return in the finally block, it calls return false and overrides the previous return true in the try block.
finally
return false
return true
try
(Terminology might not be quite right.)