JavaScript Hoisting

Photo by Tao Yuan on Unsplash

JavaScript Hoisting

Hoisting in JavaScript is a behavior in which a function or a variable can be used before declaration.

Example:

console.log(name); // undefined

var name = 'Shubham Prajapat';