Hoisting in JavaScript

Code Morning! Hoisting is one of the features in JavaScript which is either unknown to many programmers or misunderstood. In JavaScript all the declarations are hoisted (moved) up to the top of their scope. This applies to both function and variable declarations. Let’s take a look at variable hoisting first. …