Can you guys please explain why this function logs "undefined world" ??? I'm confused...
var a = 'hello';
function b() {
console.log(a);
var a = 'world';
console.log(a);
}
b();
Can you guys please explain why this function logs "undefined world" ??? I'm confused...
var a = 'hello';
function b() {
console.log(a);
var a = 'world';
console.log(a);
}
b();