HI WELCOME TO SIRIS

JavaScript Comment

Write JavaScript comment to make the code more readable and easy understandable. JavaScript mixed with JavaScript Comment follow the good coding style. Also every script writer must have this skill to follow good coding standard.
You can write JavaScript comment,
  1. Single-line Comment
  2. Multiline comment
  3. ScriptDoc Style Comment

JavaScript Single-line Comment

A single-line JavaScript comment beginning with double forward slash (//). Following is an example of Single line comment.
Syntax
<script type="text/javascript">
      // JavaScript single line comment write on here....
</script>
Example
// Write on browser
document.write("Hello World!");
        
// Write text an <h2> Heading
document.write("<h2> Hello World! </h2>");

document.write("Hello World!");  // Write Comments at end of a Line

// Execute JS Code that are write in comment line
//document.write("<h2>This text is h2 Heading</h2>");

JavaScript Multi-line comment

A multi-line JavaScript comment beginning with forward slash and asterisk (/*), and end with the reverse asterisk and forward slash (*/).
Syntax
<script type="text/javascript">
  /* 
    Multiline comment write on here....
    ...
  */
</script>
Example
/* 
    JS to write on body section
    1st: Simple write
    2nd: write text an <h2> Heading
*/
document.write("Hello World!");
document.write("<h2> Hello World! </h2>");

JavaScript Documentation Comment (ScriptDoc Style Comment)

A documentation style JavaScript comment you can write following way. It's good habit to write remarks, arguments, notes etc on JavaScript.
Syntax
<script type="text/javascript">
  /** 
    * ScriptDoc technique to write comment
    * @TagName Description
    * ….
  **/
</script>
ScriptDoc is JavaScript documentation technique. ScriptDoc provides the list of tags. Following are few tags,
TagDescription
@author Author-name [ email ]Author of JavaScript file, functions, class.
@classDescription DescriptionBrief description of the Class.
@constructorSpecifies this function is a constructor.
@deprecatedSpecifies this function is deprecated, no longer use.
@example Example-codeDescribe a real example for how to use this function.
@exception { Exception }Specifies exception type that throw this function.
@id identifierNameSpecifies ID for unique identification.
@inherits inherit_classSpecifies inherited class.
@memberOf Classfunction, Property is member of specified class.
@methodSpecifies the method name in class.
@namespace namespaceNameSpecifies the external library file.
@param { Type } ParameterName Parameter-DescriptionSpecifies parameter of this function.
@privateIndicate that a class or function is private.
@projectDescription DescriptionSpecifies on top of the page that describe the description of this file.
@property {Type}Indicate that specified property are instance of the class.
@return {Type} Returns-DescriptionSpecifies the return values of a function.
@type {Type}Specify the data type of this property.
@version Version-NumberSpecify the version number of file.
Example
/** 
  * Addition of two numbers 
  * @param {Number} a 
  * @param {Number} b 
  * @return {String} Sum 
**/ 
function addition(a, b) { 
  sum = a + b;
  return "Result is " + sum.toString(); 
}

result = addition(5, 10);
document.write(result);