CJCoding With Joseph
15free / daySign inCreate account
Back to Code Walkthrough

var Hoisting Inside a Function

JavaScript code walkthrough · Question 24
mediumScope

Code

Read carefully. What does this print?
1function test() {
2 console.log(x);
3 var x = 5;
4 console.log(x);
5}
6test();

Your answer