How to comments code in JavaScript ?

In this article i will explain how to make comments code in JavaScript.
JavaScript supports both C and C++ style comment.

we can comment code with two syntax as below:

like // and /* …*/

single line comments //
multi line comments¬† /* ……… */

// this is comments code 1
// this is comments code 2

/*
this is comments code 1
this is comments code 2
*/

both type comments are valid and supports in JavaScript language.

Example of comments code in JavaScript:

<script language=”javascript” type=”text/javascript”>

// this is comments code

/*
this is comments code
*/

</script>

Leave a Reply

Your email address will not be published. Required fields are marked *

2 + 2 =


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">