CJCoding With Joseph
← Back to Question List
JavaScript Code Walkthrough #24

var Hoisting Inside a Function

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