The var statement declares variables, and optionally initializes them.
var variable [ = value ] [, variable2 [ = value2], ...]
var, its value may optionally be initialized.for or while look like "functions" and their counters are often declared within their parentheses, (EG: var i = 0) but those variables are not local to the loop, but rather are in the same scope as the loop statement.var), then it is implicitly declared automatically and assumes the scope it was written in. There is no JavaScript equivalent to "Option Explicit" which forces explicit declarations.\uXXXX).Indicates that starting point of a statement block.
labelName: statements
this.property
Refers to the current object and is commonly used when setting multiple properties. EG:
function Car(color, make, model) {
this.color = color;
this.make = make;
this.model = model;
}
Another common usage is to pass the current form to a function. EG:
<input type="button" value="Run" onClick="RunMe(this.form)">
typeof expression typeof (expression)
Returns string indicating the type in JS. The 6 types in JS are as follows.
true or false.There are some particular about applying typeof on different global objects or functions. EGs:
with (object) {
statement;
}
Establishes the default object for the statement. Assumes that each variable in the statement is a property/object of the default object.
The following table lists reserved words that cannot be used as JavaScript variables, member names, function parameters, or statement labels. Oddly enough, only the ones in bold below are even used by JavaScript, the rest are reserved according to the ECMAScript specifications.
|
abstract boolean break byte case catch char class const continue debugger default delete do double |
else enum export extends false final finally float for function goto if implements import in |
instanceof int interface long native new null package private protected public return short static super |
switch synchronized this throw throws transient true try typeof var void volatile while with |
These are top level properties that are neither user defined variables or properties associated with objects.
infinity. The value of this infinity is always greater than any number including itself.NaN. Not-a-Number. The value of this NaN is always not equal to any number including itself.undefined. The value and type of a variable if it has not been defined yet.Page Modified: (Hand noted: 2003-05-15 00:00:00Z) (Auto noted: 2008-10-16 21:19:56Z)