DEV Community

DEBOS DAS
DEBOS DAS

Posted on

what is hoisting in javascript?

  • Hoisting is a variable or function's default behavior before declaring in the code. example
getName();
console.log(x);

var x = 7;

function getName() {
    console.log("Namaste Javascript");
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)