Learning Comment on Javascript

Comment is basically used for commenting on our javascript code so that next time we see the same code or other person is doing is working on that code he can understand the code.

There are two types of comments on Javascript.

  1. Single line comments
  2. Multiple line comments

Single line comments

<script>
Document.write("Hello world"); //here is the comment
</script>

Multiple Line Comment

Multiple line comments is like /* Comment */

<scrip>
Document.write("Hello world");  /* Here is your comment
-------------------------------*/
/* Document.write("Hello world") ; */

</scrip>