Hoisting
JS phenomenon: variable and function declarations are "hoisted" to the top of their scope at compile time.
var x is declared before the code runs, but the value assignment happens where written. function f() is fully hoisted. let/const are also hoisted (in the "TDZ" — Temporal Dead Zone) but cannot be used before declaration. Classic JS gotcha.