var pizza = "hello there";
function orange() {
document.write("hello there "+pizza);
}
orange();
function orange() {
document.write("what is going on"+pizza);
}
var pizza = "hello there";
Why can't you create a global variable after a function, as done in the second example. Why for a global variable to work must it be done before the function, is this a golden rule ?