I have heard a lot of interviews ask this question on Hoisting in JavaScript. What is this hoisting in JavaScript? Is it the same as hosting? It would be kind if someone could help me with their knowledge.

Recommended Answers

All 3 Replies

It has to do with the scope of a javascript variable. It means that the variable is hoisted (aka “lifted up”) to the top of the code block it’s in.

This has nothing to do with web hosting, and is only relevant if you are a javascript developer.

commented: Thank you for answering. 😇🌈i understood +0

I'll mark this question as solved then. Glad you understood, as I was typing from my phone, so my answers tend to be shorter.

As a fill in for other users - hoisting happens whilst using Javascript code, which is client sided, meaning happening while a user interacts with a page.
Hosting is server sided meaning that all code ran and it returns information from a server after client interaction.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.