When working with long complex blocks of code it's a good practice to leave comments that explain the
function of the code.
This helps you remember the purpose of the code and is especially useful if a third party will be working
on the same script such as another programmer or a team of programmers.
JavaScript allows for a single line or multi line comments in this HDMI file.
We have a sample of both.
The first is a single line comment represented by the double slash it's placed above an executable javascript
function.
This means the javascript function will still be executed.
We can see the result in our web browser.
The word test is output.
Using the inner HMO function
in our next example we've prevented a line of javascript code from executing by converting it into a
comment.
You can see that we've placed a double slash in front of the javascript code.
So for this reason the word paragraph is not output it in our browser.
Despite using the inner HDMI function if we remove the comment
the code does execute.
Lastly we have an example of a multi line comment and these are best used for explanations of large
code blocks to create one.
Use the slash and asterisk combination.