In JavaScript, all declarations varin a function are processed as if they appear at the very top of the function body, regardless of where they are actually located in the code. Therefore, your function was interpreted as if it were written like this:
function say_hello() {
var Variable;
alert(Variable);
Variable = "bye";
}
, , ; , var . , "Variable", . alert() .