...

/

Solution Review: Hoisting

Solution Review: Hoisting

In this lesson, we will discuss the solutions to the questions in the previous lesson.

Question 1: Solution review #

Explanation #

Run the code from the question below:

Press + to interact
function Add(){
console.log(answer)
var answer = 2
};
Add()

The above code displays undefined as an answer due to the concept of hoisting ...

Access this course and 1200+ top-rated courses and projects.

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy