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 *