- The global
ais set to1 b()is calledfunction a() {}is hoisted and creates a local variableathat masks the globala- The local
ais set to10(overwriting the functiona) - The global
a(still1) is alerted
a is set to 1b() is calledfunction a() {} is hoisted and creates a local variable a that masks the global aa is set to 10 (overwriting the function a)a (still 1) is alerted