JavaScript Comment


 

JavaScript Comment

JavaScript Comment:Comment is a important feature in any programming language, JavaScript supports two types of comments single line, and double line. In this tutorial you will come to know about this in detail. Examples will help you to understand.

JavaScript Comment:Comment is a important feature in any programming language, JavaScript supports two types of comments single line, and double line. In this tutorial you will come to know about this in detail. Examples will help you to understand.

JavaScript Comment:

Comments are placed within the programming language coding to hide all those statements, which are not supposed to run. Comment make the code more readable for the programmers.

Sometimes we need to hide some text in a program, at that situation we should put all those codes within comments. Line of Comments generally use for putting important information of variables, functions and other. This is useful when you are working in a group, and other team member may need to use your coding, it is also useful if you are working alone, comments keep you remembering about each details of the program.

Example 1:

<html>
<head>
<title>My Firt JavaScript File </title>
<script type="text/javascript" >
//This is single line comment
document.write("It is not comment");
/*
This
is 
multi 
line
comment
*/
</script>
</head>
<body>
</body>
</html>

 

Output:

It is not comment

Ads