Hoisting is a features of JavaScript in which we can use any variable or function before initialisation.
for example
console.log(x)
x=10
var x
same as we can do for function as well.
function createFunction(){
return f;
function f(a,b){
return a+b
}
}
const f=createFunction()
console.log(f(3,4)) // 7
Please take reference from here
Top comments (0)