Hoisting

    

 


 

 Hoisting

 

  • JavaScript hoists function declarations and variable declarations to the top of the current scope.
  • Variable assignments are not hoisted ( JavaScript only hoists declarations, not initializations!).
  • Declare functions and variables at the top of your scripts, so the syntax and behavior are consistent with each other.

 

 


 

 

Comments

Popular posts from this blog

Variable Scope in javascript

Shadowing