Quiz on JavaScript Function Hoisting



1. What is function hoisting in JavaScript?
2. Which type of functions are subject to hoisting?
3. What will be the output of the following code: `console.log(foo()); var foo = function() { return 'Hello'; }`?
4. Can you access a function before its declaration due to hoisting?
5. In which scenario will hoisting NOT occur?

Advertisements