Single line comment (Definition)

A pair of slash characters (//) indicates single line comments.

Single line comments are indicated by a pair of slash characters (//) and are completed by a line terminator.

The pair of slash characters and everything following them to the end of the line is considered to be a comment. Comments are discarded during the interpretation phase of a line of script. A pair of slash characters would not behave as a comment delimiter if one of them were escaped with a backslash character or if they appeared inside a single or double quoted string literal.

See also:Comment, Comment (// and /* ... */), Line

Cross-references:

ECMA 262 edition 2 - section - 7.3

ECMA 262 edition 3 - section - 7.4

Wrox Instant JavaScript - page - 17