The character sequence /* introduces a multi-line comment. That comment block is terminated by the next occurrence of the */ character sequence. This means you cannot nest these comments within one another. That is arguably bad coding technique anyway.
If you are used to C language you will most likely have used conditional compilation blocks controlled via the pre-processor. Most implementations of JavaScript do not support this, however one or two recent implementations, especially those that operate outside the context of a web browser, are beginning to introduce many C language like facilities. One of those is the pre-processor with its macro directives. This is particularly useful to developers even though it is somewhat non-standard.
Multiple line comments are replaced with a single line terminator during the interpretation phase. When the /* ... */ does not have a line terminator inside, it is simply removed prior to interpretation of the remaining line content.
Everything between the start and end of a multi-line comment is ignored.
See also: | Comment, Comment (// and /* ... */), Lexical convention, Line |
ECMA 262 edition 2 - section - 7.3
ECMA 262 edition 3 - section - 7.4
Wrox Instant JavaScript - page - 17
Prev | Home | Next |
Multi-dimensional arrays | Up | Multiplicative expression |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |