3
Reply

What is Function Hoisting ?

Atul Sharma

Atul Sharma

7y
660
1
Reply

    you are using function before declaring it.

    console.log("From calling "+myFunction()); function myFunction() { console.log("From function "+ " Function Hoisting !!!"); return "Function Hoisting !!!"; }Output - From function Function Hoisting !!! From calling Function Hoisting !!!So, you can call a function (myFunction()) even before declaring it. This is called Function Hoisting in JavaScript.

    console.log("From calling "+myFunction()); function myFunction() { console.log("From function "+ " Function Hoisting !!!"); return "Function Hoisting !!!"; }Output - From function Function Hoisting !!! From calling Function Hoisting !!!So, you can call a function (myFunction()) even before declaring it. This is called Function Hoisting in JavaScript.