The order is interpreted as shown below due to variable hoisting. Note that as @ShadowCreeper correctly points out, function a(){}
is actually creating a local variable a
inside of function b which is hoisted as shown below.
var a;
var b;
a = 6;
b = function() {
var a;
a = function(){};
a = 10;
console.log(a); //10
}
b();
console.log(a); //6