Atul Sharma
What is Function Hoisting ?
By Atul Sharma in JavaScript on Jan 10 2017
  • Bidyasagar Mishra
    Aug, 2019 2

    In JavaScript, a variable can be declared after it has been used.
    In other words; a variable can be used before it has been declared.
    JavaScript only hoists declarations, not initializations.

    • 0
  • Naveen Bisht
    Feb, 2017 16

    you are using function before declaring it.

    • 0
  • Atul Sharma
    Feb, 2017 10

    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.

    • 0
  • Atul Sharma
    Jan, 2017 10

    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.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS