I have this code
var Variable = "hello";
function say_hello ()
{
alert(Variable);
var Variable = "bye";
}
say_hello();
alert(Variable);
Now, when I first read this code, I thought it will alert "hello" two times, but the result I get is that it alerts "undefined" the first time, and "hello" second time. can someone explains to me why ?