My understanding (Based on experience and posts like this) If my Javascript does this:
global_var = {'key' : 'value'}
Then I should be able to do this:
console.log(window.global_var)
Or
console.log(window['global_var'])
I expect those things to actually log the object to my console {'key':'value'}
. In fact both of the latter two statements print undefined
I know I can do this:
window.global_var = {'key' : 'value'}
But that's not what I want (just humor me)
I've tried this from Javascript files loaded to the page. I've also tried from the Chrome Developer Console, both directly (repeating above), and also using "Store as Global Variable"
=console.log({'key':'value'})
VM1587:1 Object {key: "value"}
undefined
{I right-click on the Object logged above and choose "save as Global Variable"}
temp1
Object {key: "value"}
window.temp1
undefined
I am using Chrome Version 47.0.2526.106 m