← BYTES
JavaScript·Intermediate·Ref: 3.2.5
What is 'hoisting' in JavaScript?
Have a question about this video? Mention reference 3.2.5 when you contact us.
a.The behavior where variable and function declarations are conceptually moved to the top of their scope before code executes
b.A way to speed up network requests
c.A CSS layout technique
d.A method for compressing JavaScript files
JavaScript's compilation phase registers var and function declarations at the top of their containing scope before any code actually runs -- so a var can be referenced (as undefined) before its declaration line, and a regular function declaration can be called before it appears in the source. let/const are also hoisted but remain in an inaccessible 'temporal dead zone' until their actual declaration line executes.
Find this on YouTube & Instagram
Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:
#BYTES#BYTES325#JavaScript