1
00:00:00,120 --> 00:00:06,390
When working with long complex blocks of code it's a good practice to leave comments that explain the

2
00:00:06,390 --> 00:00:08,790
function of the code.

3
00:00:08,790 --> 00:00:14,730
This helps you remember the purpose of the code and is especially useful if a third party will be working

4
00:00:14,730 --> 00:00:20,390
on the same script such as another programmer or a team of programmers.

5
00:00:20,460 --> 00:00:26,430
JavaScript allows for a single line or multi line comments in this HDMI file.

6
00:00:26,430 --> 00:00:31,850
We have a sample of both.

7
00:00:31,860 --> 00:00:39,940
The first is a single line comment represented by the double slash it's placed above an executable javascript

8
00:00:39,940 --> 00:00:40,510
function.

9
00:00:42,190 --> 00:00:46,160
This means the javascript function will still be executed.

10
00:00:46,240 --> 00:00:48,340
We can see the result in our web browser.

11
00:00:49,770 --> 00:00:51,290
The word test is output.

12
00:00:51,360 --> 00:00:53,250
Using the inner HMO function

13
00:00:57,250 --> 00:01:04,480
in our next example we've prevented a line of javascript code from executing by converting it into a

14
00:01:04,480 --> 00:01:08,470
comment.

15
00:01:08,540 --> 00:01:14,120
You can see that we've placed a double slash in front of the javascript code.

16
00:01:14,360 --> 00:01:19,880
So for this reason the word paragraph is not output it in our browser.

17
00:01:19,880 --> 00:01:25,580
Despite using the inner HDMI function if we remove the comment

18
00:01:28,360 --> 00:01:33,580
the code does execute.

19
00:01:33,680 --> 00:01:39,930
Lastly we have an example of a multi line comment and these are best used for explanations of large

20
00:01:39,930 --> 00:01:43,180
code blocks to create one.

21
00:01:43,170 --> 00:01:45,570
Use the slash and asterisk combination.
