Results 1 to 4 of 4
Jan 15, 2008, 04:41 #1
Jan 16, 2008, 02:27 #2
Another thing. In the book it is said that it is more appropriate and secure to declare/assign variables always with the "var" keyword expecially inside function so we can mantain the local scope in which the variable was declared. Then on the chapter that talks about events on page 125 for example, the author assign a value to a variable called "event" but without the "var" keyword. Is the author creating a global variable here inside this function?
Jan 22, 2008, 15:16 #3
Jan 22, 2008, 19:17 #4
- Join Date
- Jan 2007
- Christchurch, New Zealand
- 61 Post(s)
- 3 Thread(s)
You are one of the very few people with that book, so we can't see the code you're talking about.
Please post sample code about what you're questioning, and answers can be provided.
About the event variable, if it is passed as a function argument, it shouldn't be redefined in the function itself. Do you have a code sample to post so we can clarify this?Programming Group Advisor
The 2013 SitePoint Awards - Nominate your heroes now!