1
00:00:00,240 --> 00:00:04,560
This lesson, we're going to be focused on comments before we get into variables, and there's going

2
00:00:04,560 --> 00:00:09,260
to be a brief introduction of variables in this lesson because they are so important.

3
00:00:09,720 --> 00:00:17,280
So within JavaScript, we use comments and this is typically used by coders in order to provide information

4
00:00:17,280 --> 00:00:22,560
about what's happening within the code and documentation of what's happening within the code.

5
00:00:22,800 --> 00:00:26,310
So this is also ignored within the browser.

6
00:00:26,490 --> 00:00:30,750
So it's not meant for the webpage viewer, it's meant for the developer.

7
00:00:30,840 --> 00:00:33,650
And so always good practice to comment information.

8
00:00:33,750 --> 00:00:37,260
And of course, when you come back to it, you're always going to be thankful that you've made those

9
00:00:37,260 --> 00:00:37,740
comments.

10
00:00:37,890 --> 00:00:42,240
When you come back to your code after a few months or a few years, you can always pick up on where

11
00:00:42,240 --> 00:00:46,590
you left off white spaces ignored in JavaScript so you can type white space.

12
00:00:46,740 --> 00:00:50,700
And the reason for adding in white space again is to make it more readable.

13
00:00:50,790 --> 00:00:56,220
So the challenge for this lesson is to add comments and you can go ahead and create a variable, as

14
00:00:56,220 --> 00:01:02,820
we saw before, using a variable name of a and giving value to that variable within the quotes.

15
00:01:03,000 --> 00:01:07,170
And you can console log that out and then also add in some comments.

16
00:01:07,470 --> 00:01:11,100
There's some code snippet here where we can see comments being used.

17
00:01:11,280 --> 00:01:15,440
So as you can see, the comments are within the same statement line.

18
00:01:15,450 --> 00:01:21,900
So all they do is they appear with the two Ford slashes and then this information that's presented within

19
00:01:21,900 --> 00:01:22,460
the comment.

20
00:01:22,680 --> 00:01:25,270
This isn't seen within the application.

21
00:01:25,290 --> 00:01:27,000
So this is just for developers.

22
00:01:27,180 --> 00:01:29,220
And then there's also multiline comments.

23
00:01:29,400 --> 00:01:35,400
So try out both try out the single line comments, create a variable, give it a value, and then you

24
00:01:35,400 --> 00:01:38,910
can add in a comment there and then console log that out.

25
00:01:38,910 --> 00:01:45,060
And then you can also have a comment that's multiple lines indicated with the Fortgang strikes and then

26
00:01:45,060 --> 00:01:48,570
the Asterix the forward again to close off that comment.

27
00:01:48,750 --> 00:01:51,600
So positivity, try that out and I'll show you the solution.

28
00:01:51,660 --> 00:01:55,500
You can use the same JS file that we created in the earlier lesson.

29
00:01:55,500 --> 00:01:57,660
If you don't have one, then just go ahead and create one.

30
00:01:57,930 --> 00:02:04,200
Link it from your indexed HTML file and then load the index file within your browser in order to see

31
00:02:04,200 --> 00:02:05,770
the content being rendered out.

32
00:02:06,090 --> 00:02:08,040
So in this case, we want to set up a variable.

33
00:02:08,040 --> 00:02:12,960
You can use A or you can use another value in order to name the variable.

34
00:02:13,110 --> 00:02:15,720
And there's, of course, more on this in the upcoming lesson.

35
00:02:15,840 --> 00:02:23,700
And then you can type our message within the quotes and then console log out that value so you can see

36
00:02:23,700 --> 00:02:30,060
when you refresh it that you've got Hello World and then documented by adding in some comments within

37
00:02:30,060 --> 00:02:32,450
brackets, the comments are going to get grayed out.

38
00:02:32,880 --> 00:02:35,280
So this was the test.

39
00:02:35,460 --> 00:02:37,830
And then also you do a multi line comment.

40
00:02:37,850 --> 00:02:44,640
So the forward and abstracts and you can add in whatever information you want here.

41
00:02:45,000 --> 00:02:52,080
And when you come back to this file in a few years, then you'll be able to see that why you've added

42
00:02:52,080 --> 00:02:53,610
in that variable, perhaps.

43
00:02:53,880 --> 00:02:59,520
And there's also kind of where you are thinking and maybe what you need it to still do within the application,

44
00:02:59,760 --> 00:03:01,790
within the multiline comment.

45
00:03:02,220 --> 00:03:03,000
So try that out.
