Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JavaScriptQuestions How to comment javascript code?
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


samar
How to comment javascript code?
1 Answer(s)      4 years and a month ago
Posted in : JavaScript Questions


How to comment javascript code?


Advertisement
View Answers

November 10, 2010 at 11:43 AM


Comments can be added to explain the JavaScript, or to make the code more readable. With comments, you can add extra information pertaining to your code. Comments are ignored (i.e., are not processed as coding instructions) by the computer.

  1. Single-line comments- Single-line comments start anywhere in the line and continue to the end of the line. Single-line comments begin with a double forward slash (//),

For example-

// Description: This JavaScript code prints a simple message.
  1. Multiline comments- Multiline comments span multiple lines. Multiline comments start with slash-asterisk (/*) and end with asterisk-slash (*/) pair. For example,

    /* Author: Scripting Master Description: This JavaScript code prints a simple message.*/



Related Tutorials/Questions & Answers:
Advertisements
 

 

 

DMCA.com