Possible Duplicate:
Difference between using var and not using var in JavaScript
Should I use window.variable or var?
I have seen two ways to declare a class in javascript.
like
window.ABC = ....
or
var ABC = ....
Is there any difference in terms of using the class/ variable?
window.ABCscopes the ABC variable to window scope (effectively global.)var ABCscopes the ABC variable to whatever function the ABC variable resides in.