Hoisting of Variable and Function in JavaScript

Hoisting is a JavaScript mechanism where variables and function declarations are moved to the top of their scope before code execution.

But, this is a textbook defination of hoisting in JavaScript.

Lets find out what is actually happening in background?

Under this topic we will see:

  1. Variable Hoisting in JavaScript
  2. Function Hoisting in JavaScript

Please check below video to learn hoisting with the help of an example.

Let me know your questions in comments section of the video.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s