I understand that all variables are hoisted but the assignments are not ( never mind functions for this question - that makes sense to me - related SO ).
But I don't see how this effects the code. I wrote a fiddle to experiment.
What is the benefit if you hoist the variable and give it the value of undefined which appears to be the case.
var a = 1;
function foo (proxy){
print(proxy);
}
function print(out){
document.getElementById("out").innerHTML = out;
}
// foo("you")
print(d); // undefined
var d = 4;
print(d); // 4