var a=2;
function a(){};
console.log(typeof(a));
I am wondering why the result of the above code is number
. I know the var
is hoisted but isn't it already at the first line of the code? so why the type of a is still a number instead of a function?