M Multi-line comment (Definition) Example code: // (My web server)
M Multi-line comment (Definition) Example code: // An example shamelessly stolen from Wrox Instant JavaSscript // Create a 2×2 array and store an identity matrix in it. var matrix = new Array(2); matrix[0] = new Array(2); matrix[1] = new Array(2); matrix[0][0] = 1; matrix[1][0] = 0; matrix[0][1] = 0; matrix[1][1] = 1; See also: Array index delimiter ([]), Copying objects Cross-references: Wrox Instant JavaScript page 16 Multi-line comment (Definition) Comment blocks that span several lines of script source text. 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 preprocessor 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. Warnings: . You cannot nest these kinds of comment delimiters within one another. See also: Comment, Comment (// and /* … */), Lexical convention, Line Cross-references: ECMA 262 edition 2 section 7.3 ECMA 262 edition 3 section 7.4 Wrox Instant JavaScript page 17 1467