JavaScript Comments

In JavaScript we have been learned two types of comments:​

  • Single line comments:  

        It is represented by double forward slashes (//). It can be used before and after the statement.

      Ex.

           <script>

           // it is single line comments

           var a=5;

           document.write(a);

          </script>

  • Multiline comments      

       Multiline comments are written in:

       /*    code here             */

Powered  by Codersarts