Tag Archives: hoisting

HOISTING IN JAVASCRIPT (Variables & Function)

A Person with another programming background is definitely confused with hoisting in Javascript. So let’s deep dive into the hoisting in javascript The Javascript engine creates the global execution context when we execute a piece of Javascript code. Global Execution Context has two phases : (i) Creation Phase (ii) Execution Phase Definition: During the creation Continue Reading »

Hoisting in javaScript

Hoisting is a phenomenon in javaScript by which you can access variables and functions even before you have initialized them or you have put some value on them. you can access it without any error. Hoisting allows functions to be safely used in code before they are declared. for Example: var x=7; function getName(){ console.log(“hoisting Continue Reading »