The Startup
Published in

The Startup

JavaScript: Understanding Hoisting

While creating an execution context, The JavaScript engine allocates memory for the variables and functions before executing them. This allows us to do some interesting things like accessing a variable before declaring it.

As the memory allocation for the variable a has already happened before executing the program line by line, we can access the variable at the very top of the execution context. In the…

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Karthick Ragavendran

Fullstack engineer @ atem.green | React, Typescript, Redux, JavaScript, UI, Storybook, CSS, UX, Cypress, CI/CD.