Scripter Javascript Tutorial
javascriptmusiclogicscripterbookexcerpttutorial7 Comments
MDN: Grammar and types: Comments
Comments allow for the inclusion of any text within the script without it being processed like code. Typically, these are used to help explain what the code is doing at a particular point and can also prevent execution of code.
Single line comments start with //
and end with a line
break.
// assign the string to a variable
var say_hi = "Hello, world!";
// call Trace using the variable as the argument
Trace(say_hi);
In the above example, lines 2 and 4 are comments. JavaScript ignores those lines until the line break. Take away the comment tokens at the beginning of the lines and Scripter will throw an error.