CodeIntermediate

Hoisting

The name for declaration behaviors that can make bindings affect a scope before execution reaches their written declaration.

In the real world

sayHi(); function sayHi() { return 'Hi'; } works because the function declaration is initialized early.

Related

Go a little deeper