Hoisting of javascript

Hoisting in javascript

Now a days javascript is getting powerful and enormous in nature. There are so many frameworks available in javascript that some times we can also forget what’s new in javascript.

Put that aside and if we talk about basic javascript few things will never change and we have to understand those. So one concept among many in javascript is javascript hoisting.

I came across this when i was preparing for my job interview so what the heck is hoisting anyways? Well in simple plain english hoisting means uplifting something like uplifting a huge cement pipe like above pic, or uplifting some load on a pulley or uplifting variables in javascript is also know as hoisting in javascript.

Again what the heck does that mean huh?

Ohh sorry you came for meaning i know. Well then do you know global ????


then something global scope?

Of course not, then why would you be even here right?

Enough now…

Global scope means something is available globally, everywhere, to everyone. Well global space in your index.js file is whole page, In your browser will be the current window you are open now. Means if you declare a variable on line one, out side of every block you would write will be available for entire code of index.js file.