JavaScript & TypeScript

Hoisting

/ˈhɔɪstɪŋ/

Definition

JavaScript's behaviour of moving var declarations and function declarations to the top of their scope at compile time.

Example in context

"console.log(x) returns undefined, not an error — var x is hoisted but not its value."

Practice this term

Master Hoisting in context by working through exercises in the JavaScript & TypeScript module. You'll see the term used in real engineering scenarios with multiple-choice, fill-in-the-blank, and matching drills.

Frequently Asked Questions

What does "Hoisting" mean?

JavaScript's behaviour of moving var declarations and function declarations to the top of their scope at compile time.

How do you pronounce "Hoisting"?

"Hoisting" is pronounced /ˈhɔɪstɪŋ/.

Can you use "Hoisting" in a sentence?

"console.log(x) returns undefined, not an error — var x is hoisted but not its value."