What the difference between Creation Phase and Execution phase in hoisted variables and functions. also how Execution Context is working at this case in javascript console
Refer to this example :
b();
console.log(a);
var a = 'Hello World';
function b() {
console.log('Called b!');
}
Output:
Called b!
undefined
How can you explain this scenario:
in function case it returns Called b!
in variable case it returns undefined