Comments
Suppose you have done a lot of coding and some logical operations, and used a number of variables on JavaScript, and you want me to help you with the code if any errors occur. When you send me the code, I will not know what you have typed unless I have a clear knowledge of JavaScript or you have commented on the important lines.
A comment is basically a line of text or code that your browser ignores while running. You can compare comments to sticky notes or reminder.
Let's consider the following example:
Var name = "Sherlock Holmes"; // This is a string Var occupation = "Detective"; // This variable stores information Var age = 14; // This is an integer type of data.
How do you make multiline comments? You mention the comment in the following manner:
/* This is a multiline comment. The browser will ignore this. You can type any important information on your comment. */
Your multiline comment should be between /*
and */
, as shown in the following screenshot...