Glossary term
What is hoisting? Meaning for developers
The effect of the memory creation phase: names exist before the line that declares them. Functions are fully usable early; var reads as undefined; let and const throw until their line runs.
Learn it properly · JavaScript CoreLesson 3: Var, Let, and ConstAll three get hoisted. What happens after that — what value they start with, where they're actually stored in memory, and when you're allowed to touch them — is where they completely part ways.