console.log(aName);
var aName = 'Martin';
I tried to execute this JS code in latest Google chrome and Edge browsers. It printed name value. i.e. 'Martin'. I got little confused here, because of JavaScript hoisting. According to hoisting only declarations are hoisted and not initialization. Since it is 'var', it should throw undefined error as per my assumption. But, when I tried with IE-11 browser, it worked as expected and threw undefined error. What is going here?