-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Global variables #1
Comments
He's using Ball as namespace. Game is receiving the constructor function. It's acting as class. — On Fri, Jan 16, 2015 at 8:57 AM, jsvoboda [email protected]
|
Yea, I get that, but implicitly declared variables (i.e. without 'var' keyword) are global no matter where they are declared. At least it looks that way, try running the following (in console for example):
|
The demo game was created at a doc sprint during weekend a few months ago and was just a proof of concept, but I never had the chance to finish it. I'll try to rewrite it as it should be, with all the good practices, and describe everything in detail in the related article. |
Ok, thank you, I was just wondering whether there's something I am missing. |
Hi,
as a javascript newb I was kind of trying to copy the structure of your game, but realized that you are extensively using global variables.
For example:
Would you mind explaining why?
Thank you,
Jaromír
The text was updated successfully, but these errors were encountered: