“Hoisting” a Amazing Jargon in JavaScript.

1. Simple Functions declarations/ Function Statement

Function statement or Function declaration

2. Function Expression

Function expressions

So what is Hoisting?

Function statement call 1

a. In this we called the billPaid(bill) function at line no 8.

Function statement call 2

b.In this we called the billPaid(bill) function at line no 4.

Function Expression call 1

c.In this we called the billToBePaid(billAmt) function at line no 27.

Function Expression call 2

d.In this we called the billToBePaid(billAmt) function at line no 23.

Variable declared above console
Variable declaration below console.

Functions Statement are scanned and made available by JavaScript interpreter.

Function expression declarations are scanned and made undefined by JavaScript Interpreter.

Conclusion

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store