In this lecture we learn about comments so javascript comments are the way to deliver the messages.
That means it is used to add information about the cord widening or the suggestions so that the in the
user can easily interpret your code.
So if you just write some code over here in the javascript and if you just give this code to any other
in the user will just understand this code and interpret it because you'll just put something comment
over here like a disease the variable declarations so this can be the masses that can be given to the
induces so that you will just understand what you are doing over here with these commenting code over
here.
That means it is used to add information about your core to warning other stations.
So we have two types of comment.
And first one is here.
That is a single line comment.
So anything you write in this single line will be commented out or left alone.
That means it ought to be executed by the browser.
So it is basically started with this double for words less so anything up to this double for what's
less is a single line comment so you can just put any suspicion any chord that should be left out by
the execution or by the browsers.
So.
Second one is the multi line comment.
And basically it starts with single forwards less and put this is Star after that.
This is your single line come in.
That means you can give any information about your chord sedition warning in this melody line and you
have to in this multi line comment with this one as streak and backwards less over here.
And this is your clothing.
So this is your multi line comment.
And over here is your single line comment.
So you would wonder what did the advantages of this javascript comment.
So first one would be it will make easy to understand that what you are writing over here are what do
you have just made use of.
That means it is used to elaborate the code so that in the user can easily understand your code and
the next one is to avoid the unnecessary code.
It can be also used to avoid the code being executed that means anything you have written over here.
To be executed by the browser that means it will avoid the unnecessary code.
So we just add sometimes the code that is performing some X and bought after some time there.
Maybe we need to disable that code in such case it is basically better to use this comment.
So instead of just removing all of that code what if we just put this comment.
And if you this one that called again to recover that means you can simply uncommon to it and you can
just execute that code.
So these are the two advantages of the javascript comments and we'll see that JavaScript comments in
action now in the browser.
So what you need to do is simply left click over here and inspect the element.
Go to the console and over here we'll just make use of these double for it's less.
And I'll just say var which is basically the way to create a variable.
And if I just say one that means here we'll just see undefined but if I just created a variable without
this double for SLAs then you see that variability has been created over here is 1.
So that means that this line of code is not executed.
So what if I just say something like this is the line and it was so as something that is a syntax error
because this is not any syntax but if I just put the same line that it this line in this double for
it's less that means it will not execute.
That means it will be left out by the compiler or basically this browser is in.
So this is your single line comment so we'll see now the multi line comment and that starts with this
part was less than a streak and put these this is my tie line and should be comment and disclose this
comment with the same forward SLAs and this streak.
And if I just sit into that means this is your multi line comment.
It won't be executed by the browser.
So the main advantage is is to make the code easy to understand.
And the second would be to avoid unnecessary code.
So this will be there for this Alexis you in the next.