...
Solution review: Hoisting
In this lesson, we will discuss the solutions to the questions in the previous lesson.
Run the code from the question below:
function Add(){ console.log(answer) var answer = 2};Add()
The above code displays undefined as an answer due to the concept of hoisting in Javascript.
undefined