A comment is a comment that is added to a program file or code snippet during program writing. Annotating can improve code readability, allowing yourself or other developers to understand the program more quickly.
Single-line comment symbol is //, the symbol is the contents of the Notes until the end of the line. The following is an example of a comment:
// Here is a pop-up message box alert("I am prompted text");
Multi-line comments can be annotated with multiple lines of code at once, with multiple lines beginning with / * and ending with * /. Here's an example of a multi-line comment:
/* The following is a pop-up prompt message box in the line of code, without any variables or parameters */ alert("I was prompted text");
Note that the content is not only some explanatory text, it can be some unused code fragments, to prohibit the implementation of these codes.
Obviously, it is more convenient to use a double-slash single-line comment for a small number of comments that span one or several lines. It is easier to use multi-line comments for large amounts of comments, especially for large pieces of code that are not needed temporarily.