Hi Tanya,
The info can be found at
MSDN JScript and the part of interest is:
You can declare a variable without using the var keyword in the declaration and assign a value to it. This is known as an implicit declaration, and it is not recommended. An implicit declaration creates a property of the global object with the assigned name; the property behaves like a variable with global scope visibility. When you declare a variable at the procedure level, though, you typically do not want it to be visible at the global scope. In this case, youmust use the var keyword in your variable declaration.
noStringAtAll = ""; // The variable noStringAtAll is declared implicitly.
You cannot use a variable that has never been declared.
var volume = length * width; // Error - length and width do not yet exist.
Note |
---|
Declaring variables without the var keyword generates a compile-time error when running in fast mode, the default mode for JScript. To compile a program from the command line that does not use the var keyword, you must turn off the fast option by using /fast-. It is not safe to turn off the fast option in ASP.NET because of threading issues.
Sincerely
|