I wrote the following code
function square_root(n){
console.log(“In first function”);
console.log(Math.sqrt(n));
return;
}
var square_root = function(n){
console.log(“In second function”);
console.log(Math.sqrt(n));
}
in the console when i call square_root(5) it gives the following output
“In second function”
2.28…
so what is the order of preference here… does flag hoisting doesn’t work in this scenario?