In Firebug, the DOM tab shows a list of all your public variables and objects. In Chrome\'s console you have to type the name of the public variable or object you want to ex
List the variable and their values
for(var b in window) { if(window.hasOwnProperty(b)) console.log(b+" = "+window[b]); }
Display the value of a particular variable object
console.log(JSON.stringify(content_of_some_variable_object))
Sources: comment from @northern-bradley and answer from @nick-craver
Try this simple command:
console.log(window)
The window
object contains all the public variables, so you can type it in the console and then expand to view all variables/attributes/functions.
Open the console and then enter:
keys(window)
to see variablesdir(window)
to see objects As all "public variables" are in fact properties of the window object (of the window/tab you are looking at), you can just inspect the "window" object instead. If you have multiple frames, you will have to select the correct window object (like in Firebug) anyway.