# Hoisting, var and the Temporal Dead Zone

Before JavaScript runs a scope it notes every declaration in it, which is why a function can be called above the line that makes it, why var gives undefined there, and why let and const stop with an error instead.

![Cheat sheet: Hoisting, var and the Temporal Dead Zone](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/10/513258811e5a4f6ebdc98e4f63d3c465.webp)

- Category: JavaScript
- Level: Journeyman
- Tags: const (javascript), Function Declaration, Hoisting, JavaScript, let (javascript), Temporal Dead Zone, var (javascript)
- Updated: November 1, 2026

Source: https://www.ask-codey.com/cheat-sheets/javascript-scope-hoisting-and-var-cheat-sheet
