In JavaScript there are two types of comment.
Single line comments start with // and finish at the end of the line:
// this is a short comment
Multiline comments start with /* and finish with */:
/* This is a longer comment
anything here will be ignored
This is a useful place to put notes
*/
anything here will be ignored
This is a useful place to put notes
*/
It’s good practice to write comments in your code. There are even utilities that can take your comments and produce documentation from them such as JSDoc Toolkit, Docco, and YUIDoc. You’ll see lots of comments throughout the code in this book.
0 Response to "Comments"
Post a Comment