Here is my javascript code :
console.log(a);
c();
b();
var a = 'Hello World';
var b = function(){
console.log("B is called");
}
function c(){
console.log("C is called");
}
Now here is output :
undefined
hoisting.html:12 C is called
hoisting.html:6 Uncaught TypeError: b is not a function
My question is regarding why c() and b() behaving differently. And b should throw error something like b is not defined.