How to write javascript statement
JavaScript programs are lists of individual instructions that we refer to as statements. To interpret statements correctly, the browser expects to find each statement written on a separate line:
this is statement 1 this is statement 2
Commenting Your Code
Some statements are not intended to be executed by the browser’s JavaScript interpreter, but are there for the benefit of anybody who may be reading the code. We refer to such lines as comments, and there are specific rules for adding comments to your code.
A comment that occupies just a single line of code can be written by placing a double forward slash before the content of the line:
// This is a comment
A more convenient way of entering multiline comments to your code is to prefix your comment with /* and terminate it with */. A comment written using this syntax can span multiple lines:
/* This comment can span multiple lines without needing to mark up every line */
Adding comments to your code is really a good thing to do, especially when you’re writing larger or more complex JavaScript applications. Comments can act as reminders to you, and also as instructions and explanations to anybody else reading your code at a later date.