I have an element:
<div id="someElement"></div>
I have a global variable:
var someElement;
On Chrome, Edge, IE, FireFox, Opera... if I console.log(someElement)
, it is undefined. I initialize someElement to a widget later, so I utilize the fact that it is undefined for certain if-statement checks to only execute certain code after the widget is initialized.
However, in Safari.... someElement is evaluating to
<div id="someElement"></div>
My understanding was any global variables overshadow any 'globals' made with element ids, so this should not be happening...
I guess I am not fully understanding the Safari behavior when every other browser is behaving as expected. What is going on here?