var fauxConstant = "123"; function badFunction() { fauxConstant = "456"; } function goodFunction() { var fauxConstant = "456"; } function testIt() { alert(fauxConstant);//123 goodFunction(); alert(fauxConstant);//123 badFunction(); alert(fauxConstant);//456 } testIt();