Your concept about Hoisting in JavaScript is wrong

Dhiman Das
May 30, 2021

--

Probably this is the most popular definition for hoisting -
Hoisting is a JavaScript mechanism where variables and function declarations are moved to the top of their scope before code execution

Which is often interpreted as that variable and function declarations are physically moved to the top of your code but this is not in the fact what happens behind the scenes.
Instead the variable and function declarations are put into memory during the compile phase, but stay exactly where you typed them in your code.

Thank you for investing your time…

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Dhiman Das
Dhiman Das

Written by Dhiman Das

A software developer, who also loves to read self-help book, love to do cycling, love to play music and also entered into the world of content writing.

No responses yet

Write a response