5 hands-on exercises and 5 find-the-bug challenges for the JavaScript finally lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.
Record the three steps in order.
Show that finally runs when nothing failed.
Turn the flag off whatever happens.
Show that finally runs even when the try block returns.
Clean up but let the error keep travelling.
finally does the job once instead of twice.
Cleanup placed in the try block is skipped when it throws.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspaceA return in finally overrides the one in try.
finally runs last, after the catch.
The inner block should clean up but still let the error escape.