# else Statement

A branch that runs when its matching if condition is falsy.

## What does **else Statement** do in JavaScript?

**else Statement** — A branch that runs when its matching if condition is falsy.

```javascript
if (stock > 0) {
    status = "Available";
} else {
    status = "Sold out";
}
```

Level: Novice · [More JavaScript terms at this level](https://www.ask-codey.com/glossary/subjects/javascript/novice)

Updated: September 27, 2026

Source: https://www.ask-codey.com/glossary/else-statement
