🟒 EasyHoistingπŸ’» Output Question

Function declaration hoisting

πŸ’‘

Hint

Function declarations are hoisted completely. Function expressions are not.

What does this output?

console.log(foo());

function foo() {
  return 'hello';
}

Correct Output

hello

Why this output?

Explanation: Function declarations are fully hoisted β€” both name AND body. You can call them before they appear in code.

Key Insight: Function declarations are hoisted completely. Function expressions are not.

More Hoisting Output Questions

🟒 Easyvar hoistingβ†’πŸŸ‘ MediumFunction expression not hoistedβ†’πŸŸ‘ Mediumlet temporal dead zoneβ†’πŸ”΄ HardFunction vs var hoisting orderβ†’

Practice predicting output live β†’

66 output questions with instant feedback

πŸ’» Try Output Quiz