Javascript Comments

comments are added to make source code easier for humans to understand.Comments will explain what is going on.It is used to add information about the code, Compiler and interpreter don’t test the comment line.
Types of JavaScript Comments,

JavaScript have two types of comments.

  • Single-line Comment
  • Multi-line Comment

Single line comment :-

// it is used for single line comment


//document.write(“single line comment”);


Browser, will not print any thing ,Because line is commented.

Multi-line Comment :-

it is start with /* and end with */.

the text between /* and */ will be avoid by JavaScript Enabled browser.



document.write(“JavaScript is very Easy Language”); alert(“Hello hi how you”);



Follow Us

Contact Us

Back to Top