How to comment in javascript?

Posted by

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> 
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x