# finally Block

*noun*

say it: **“FY-nuh-lee blok”** **/ˈfaɪnəli blɑk/**

The part of a try statement, written finally { }, that runs after the try and catch blocks whether anything failed or not, often to tidy up.

## What is **finally Block** in JavaScript?

**finally Block** — A block that normally runs after try and catch whether an exception occurred or not.

```javascript
function reserve(seats) {
    if (seats < 1) {
        throw new Error("Seat count must be positive");
    }
}
```

## In a sentence

- “The Loading message is hidden in the **finally block**, so it goes away whether the order saved or failed.”
- “I turned the Search button back on in the **finally block**, so it never stays stuck off.”
- “The **finally block** hides the "Loading..." message, whether the photo arrived or not.”

Level: Journeyman · [More JavaScript terms at this level](https://www.ask-codey.com/glossary?category=javascript&level=3)

Updated: November 9, 2026

## In other subjects

- [finally Block in C#](https://www.ask-codey.com/glossary/finally-block-c-sharp)
- [finally Block in Java](https://www.ask-codey.com/glossary/finally-block)
- [finally Block in PowerShell](https://www.ask-codey.com/glossary/finally-block-powershell)

Source: https://www.ask-codey.com/glossary/finally-block-javascript
