Where is JSFiddle putting my variables? How do I access them?
It's putting it where you're telling it to. JSFiddle defaults to put all your code in a window.onload
function which means everything you declare with var
is local to that callback. (You can of course set properties on window
explicitly). Here is such an example.
This setting is changeable from the left hand menu - if you move it to head
or body
you will have access to them from the developer tools. Moreover, it's worth mentioning that if you invoke the debugger while that code is running you will have access to those variables even if they are in a closure.