let s = new Set("Foood");
console.log(s); //{}
console.log(typeof foo); // function
var foo = "string";
foo = 34;
function foo() {
//some code
}
console.log(typeof foo); // number
I was going through a codebase and came across this sort of codebase, can anyone explain the output of "typeof" operator in this code. Why for the first time it gave "function" and "number" second time.