What is Hoisting?

In JavaScript, variables and functions are moved, or “hoisted,” to the top of their containing scope. This process is known as hoisting. When a variable or a function is declared, the declaration is hoisted to the top of its containing scope. This mean…


This content originally appeared on DEV Community and was authored by Mohammad Mojahidul Islam

In JavaScript, variables and functions are moved, or "hoisted," to the top of their containing scope. This process is known as hoisting. When a variable or a function is declared, the declaration is hoisted to the top of its containing scope. This means we can access them before they are explicitly declared in the code. However, their values are not hoisted, so we can only access the value of a variable after the line where it is initialized.


This content originally appeared on DEV Community and was authored by Mohammad Mojahidul Islam


Print Share Comment Cite Upload Translate Updates
APA

Mohammad Mojahidul Islam | Sciencx (2024-08-12T04:45:36+00:00) What is Hoisting?. Retrieved from https://www.scien.cx/2024/08/12/what-is-hoisting/

MLA
" » What is Hoisting?." Mohammad Mojahidul Islam | Sciencx - Monday August 12, 2024, https://www.scien.cx/2024/08/12/what-is-hoisting/
HARVARD
Mohammad Mojahidul Islam | Sciencx Monday August 12, 2024 » What is Hoisting?., viewed ,<https://www.scien.cx/2024/08/12/what-is-hoisting/>
VANCOUVER
Mohammad Mojahidul Islam | Sciencx - » What is Hoisting?. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/08/12/what-is-hoisting/
CHICAGO
" » What is Hoisting?." Mohammad Mojahidul Islam | Sciencx - Accessed . https://www.scien.cx/2024/08/12/what-is-hoisting/
IEEE
" » What is Hoisting?." Mohammad Mojahidul Islam | Sciencx [Online]. Available: https://www.scien.cx/2024/08/12/what-is-hoisting/. [Accessed: ]
rf:citation
» What is Hoisting? | Mohammad Mojahidul Islam | Sciencx | https://www.scien.cx/2024/08/12/what-is-hoisting/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.