Students Empire

Learn Something New

Javascript Comments

Javascript uses C-style comments for both single-line and block comments.

A single-line comment begins with two forward-slash characters, such as this:

                //single line comment 

A block comment begins with a forward slash and asterisk (/*) and ends with the opposite (*/), as in this example:

                * This is a multi-line 
                * Comment 
                <!DOCTYPE HTML>
                  <script type="text/javascript">
                      //this is a comment
                    document.writeln("This is a statement");
                    document.writeln("This is also a statement");
                    /* more comments
                       more comments
                       more comments
                       more comments