🔰hoisting
lifts identifiers to top of scope.
Last updated
Was this helpful?
lifts identifiers to top of scope.
Last updated
Was this helpful?
Was this helpful?
hoists identifiers to the top of a scope (at compile-time)
var hoisting - declaration hoisted, value initialized to "undefined".
let/const/class hoisting - declaration hoisted, value "uninitialized"❗️
const requires initialization - must have with initial value❗️
function hoisting - declaration hoisted, value initialized to a function.
lexical declaration ( let / const / class )
is "uninitialized" first (at compile-time).
then initialized to its (when execution reaches its declaration at )❗
there's a between these two states, be aware❗
hoisting priority
is hoisted first ().