JavaScript Comment

Comments can be used to explain JavaScript code. It is used to add information about the code, warnings or suggestions so that end user can easily interpret the code.The JavaScript comment is ignored by the JavaScript engine .

Types of Comments :

  1.    Single Line comments
  2.   Multiline comments

Single Line comment
<script type="text/javascript">
// This is a single line JavaScript comment
</script>


Multiline comment
<script type="text/javascript">

/*document.write("hi!");
document.write("hi!");
document.write("hi!");
document.write("hi!");
document.write("hi!");
document.write("hi ");
*/
</script>