/images/avatar.png

Javascript hoisting

What is the hoisting? It’s a characteristic that is assigned in the top level when it’s assigned with var in the interpreting progress. 1 2 3 4 5 6 console.log(foo); // undefined var foo; foo = 'It is foo.'; console.log(foo); // It is foo. This characteristic occurs wrong situation like below code. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 console.log(foo); // undefined var foo; foo = 3; console.