a = 123; // becomes global var var b = 234; // local var function f() {} // local func g = function() {} // got a global func
now how to print
Globals become attached to the global object, which in a browser is the window.
a = 123
is the same as
window.a = 123