What is the difference between comments /*...*/ and /**...*/ in JavaScript?


/*…*/ and /**…*/ are multi-line comments. The following is a multi line comment in JavaScript.

/*
   * This is a multiline comment in JavaScript
   * It is very similar to comments in C Programming
*/

The following example shows how to use multi-line comments in JavaScript.

<script>
   <!--
      /*
         * This is a multiline comment in JavaScript
         * It is very similar to comments in C Programming
      */
   //-->
</script>

The comment /** */ is for  PHPDocumentator ,  which is used to make automatic documentation.

Updated on: 12-Sep-2019

467 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements