Statements |
See subtopics: /* ... */, //, this, and var.

//, /*...*/ | NN 2 IE J1 ECMA n/a
Comment statements that let you enter nonexecuting text in a script. Any text following the // symbol anywhere in a statement line is ignored by the language interpreter. The next line of script, unless it begins with another // symbol, is interpreted by the browser. For longer comment blocks, you can begin a block with the /* symbol. Comment blocks may run any number of lines. The block is closed with the */ symbol, after which the interpreter engages subsequent statements.
Example
    // convert temp from C to F

    /*
    many lines
    of
    comments
    */

this | NN 2 IE J1 ECMA 1
A keyword that refers to the current object. For example, in a form element object event handler, you can pass the object as a parameter to the function:
    <INPUT TYPE="text" NAME="ZIP" onChange="validate(this)">
Inside a custom object constructor, the keyword refers to the object itself, allowing you to assign values to its properties (even creating the properties at the same time):
    function CD(label, num, artist) {
        this.label = label
        this.num = num
        this.artist = artist
    }
Inside a function, the this keyword refers to the function object.
Example
    <INPUT TYPE="text" NAME="phone" onChange="validate(this.value)">

var | NN 2 IE J1 ECMA 1
A keyword that defines the creation of a new variable. Although the keyword is optional for global variables (those not declared or initialized inside a function), it is good form to use this keyword for each new variable. Using the var keyword inside a function makes the variable local to statements inside the function. You may simply declare one or more variable names, in which case their initial values are null. Or you can also initialize a new variable with a value.
Example
    var a, b, c

    var myName = "Susan"