may i know how this code execute?
function scope() {
return hosting;
function hosting() {
var hosting = '15';
}
var hosting = 12;
}
console.log(typeof scope())
here this code return function, we now js engine will move the declaration to top so we get function,
function scope() {
return hosting;
var hosting = 12;
}
console.log(typeof scope())
but now why its not return number?, but i know we need to use let to avoid this