I am running into a strange scope issue with Javascript (see JSFiddle):
var someGlobal = 3;
function someF() {
// undefined issue
alert(someGlobal);
someF2 displays 3 because it still is 3.
In someF() you create a new variable that happens to have the same name as someGlobal. That does not do anything to the original someGlobal, it just creates a new variable locally to function someF that goes away when that function ends.
So you have local variables (e.g. created inside someF with var) and global ones.