Javascript comments explain the code design. They can also be used to prevent the execution of a section of code if necessary. Comments are ignored while the compiler executes the code. Comments are user-friendly as users can get explanations of code using comments.
synatx
[ // ] use for single line
[ /*
...
...
*/ ] use for multiple lines
example
<script>
// It is multi line comment.
/* this a multiple
lines comment
in javascript */
</script>