All right.
Welcome back.
So in this video we're going to talk about JavaScript comments so javascript comments can be used to
explain javascript code and to make it more readable javascript comments can also be used to prevent
execution when testing alternative code
so I'm going to show you some examples of single line comments and also multiple line comments.
So the first thing I want to do is go to the H2 Doc shortcut click on learn basic javascript and we're
going to type in first one hit control shift and type in 0 5 and we'll type in comments.
OK.
So MacOS that out.
Let's head over to sublime let's close these out and I'm gonna go to comments so let's minimize these
are real quick.
There we go.
And right click on comments to new file we'll do indexed at each team level and then do control and
control us and it may end J us.
Okay.
So
and actually delete the index today.
You know we don't really need that for this example because we're just comment in our code.
So first single line comment you can do this single line comment.
OK.
And then you would write in previous example do counseled out log hello world.
OK.
Now if we wanted to do a double or a multiple line it's the same exact thing as what you would do and
CSX which is you're gonna do a backslash a star and then your type.
This is the code I wanted to comment out on multiple lines and then you hit return or you can do it
on that line to do the star and then the backslash.
And now that's javascript comments.
So again this is something that's important to be utilizing throughout your experimented with JavaScript
because when we do the project we're going to be commenting out everything and labeling everything.
So basically gives you a way to
comment out of an execution if you want or make it more readable.
So for example if if I have this let me grab this and copy this like right click and I copy.
So I'm talking about.
So let's say that
this is our code right.
It's all the same thing.
But if you just do this and use bases out
then you can see it's really easy to read.
And then if we need to change something we just go right there and change it and then change the code
right below it.
And it's just really easy to read and kind of work through.
So I highly recommend comment in our code and also labeling code.
So you know it's what.
OK.
So thanks for watching and I'll see you in the next video.