I'm writing a javascript app that uses a lot of global variables:
window.x = 0;
window.y = 0;
I'd like to be able to use an alias for the window object:
w = window;
w.x = 0;
w.y = 0;
However, when I set w to window, it seems to recursively add itself to the DOM:
w = window;
// In the DOM Explorer:
> w page.html
> w page.html
> w page.html...
This seems like it would ruin the memory, but the app is running fine. Is there a better way to create global variables or a window alias?