Using comments in code can be useful for a variety of reasons. Maybe you work in a team or you are creating a reusable script. Regardless of your development needs, comments are a great way to make your code maintainable.
// declare a variable for color var color = "red";
To comment multiple lines you begin the comment with “/*” and end with */. For example:
/* a multi line comment to say that my favorite color is not red it is blue */ var color = "blue";