DEV Community

What is Hoisting Anyway?

Sarah Chima on March 25, 2019

Hoisting is a term you come across from time to time as a JavaScript developer. Do you know what hoisting is and how it works? Well, let us find ou...
Collapse
 
ocdalex profile image
Alex Walker

Nicely explained, have bookmarked for future reference.

Collapse
 
sarah_chima profile image
Sarah Chima

Thank you

Collapse
 
inflammatorydev profile image
inflammatorydev

'Note that this does not physically happen.' - THANK YOU! Its refreshing to read a tut on hoisting that explains that the code isnt actually being lifted around the function as so many others do.

Good write up.

Collapse
 
sarah_chima profile image
Sarah Chima

Thank you for your kind words.

Collapse
 
hdennen profile image
Harry Dennen

Useful write up :) The spec has become a lot more reader friendly in recent years too, might be worth a reference tc39.github.io/ecma262/#sec-identi...

Collapse
 
sarah_chima profile image
Sarah Chima

Thanks for sharing the link.

Collapse
 
anshulnegitc profile image
Anshul Negi

why javascript perform hoisting?
As in some cases, we mistakenly define variables or function declarations that are unused throughout the code but due to hoisting it will take all variable and function declarations to memory along with unused variables and function declarations thus slowing the speed of execution.

Collapse
 
ayaanraj profile image
ayaanraj

Great write up, really enjoyed.

Collapse
 
theodesp profile image
Theofanis Despoudis

In other words, what you see is not what you get

Collapse
 
rachanakotha profile image
Rachana Kotha • Edited

Love the way you explain concepts.
Simplicity is the key in your blogs.👏
Expecting more on JS and Frontend related concepts.

Collapse
 
sarah_chima profile image
Sarah Chima

Thank you! :)

Collapse
 
reigningkingforever profile image
Samuel Oluwadamilola Reigningking • Edited

Very simple explanation. .thanks @sarah_chima