# Generator Function

A function declared with function\* that can pause and yield several values.

## What is **Generator Function** in JavaScript?

**Generator Function** — A function declared with function* that can pause and yield several values.

```javascript
function* countdown() {
    yield 3;
    yield 2;
    yield 1;
}
```

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

Updated: September 27, 2026

Source: https://www.ask-codey.com/glossary/generator-function
