How to do comment in JavaScript

 How to do comment in JavaScript


In this article we are goanna to see about how to do comment in JavaScript which is most important when you are going to start your career in JavaScript. Please read and enjoy this article if you want to give any feedback about your experience, we welcome.




It's divided into 2 parts:

Single line Comment

Multi line Comment

Let us know something both of them with example.

Single Line Comments:

Single line comments start with //

Text between //and the end of the line will be ignored by JavaScript.



Example:

// used to comment any notes, variable, function, objects etc.
var raj = 10; 

var raj = 10;   // Raj variable created

Multi Line Comments:

Multi line comments start with /* and end with */

Any text between /* and */  will be ignored by JavaScript.

It is mostly used to comment to any function and class.

Example:

/* In this code we passed argument,
     function, class, object of people and
     it will be call to another school */


Share:

0 comments

Please leave your comments...... Thanks