EasyHoisting💻 Output Question

Function declaration fully hoisted

💡

Hint

Function declarations hoist completely. Function expressions do not.

What does this output?

console.log(greet('Alice'));
function greet(name) { return 'Hello, ' + name; }

Correct Output

Hello, Alice

Why this output?

Explanation: Function declarations are fully hoisted — name and body both. You can call them before they appear in source.

Key Insight: Function declarations hoist completely. Function expressions do not.

More Hoisting Output Questions

Easyvar declaration hoisted as undefinedEasyFunction expression not hoistedMediumLocal var shadows outer — from start of functionMediumFunction declaration takes priority over var in hoisting

Practice predicting output live →

66 output questions with instant feedback

💻 Try Output Quiz