Is it true that JavaScript automatically attempts to define undefined variables to:
document.getElementById('someUndefVarName')
As in, the following appear to be equivalent:
<div id="myUndefVar">:)</div>
<script>
alert(myUndefVar); // why does this work!?
alert(document.getElementById('myUndefVar'));
</script>
See JSFiddle example: http://jsfiddle.net/AH35k/1/
Or is something else happening that I don't understand? This really caught me off-guard as I expected some sort of error since I'm using "use strict".