Closure characteristics When the function is assigned, the function remember values and functions that are around the function.
In other words, when the function is assigned, the function remember values and functions that are in the same level scope.
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.