A record of every reference a function utilizes.

Here's a small example:

## JavaScript

`function example(x, y) {`

let sum = x + y;

document.getElementById("span-for-result").innerHTML = sum.toString();

}

The closure is `[x, y, document]`

.

· One min read

A record of every reference a function utilizes.

Here's a small example:

`function example(x, y) {`

let sum = x + y;

document.getElementById("span-for-result").innerHTML = sum.toString();

}

The closure is `[x, y, document]`

.