Step 3: Comments
Sometimes you might want to make a note for yourself in your code. Comments can be helpful for remembering logic and terminology, and make your code easier to understand for other people.
Try it out
To create a single line comment in JavaScript, you place two slashes //
in front of the code or text. When you place these two slashes, all text to the right of them will be ignored, until the next line.
For example, here's a comment on the line above some code:
You can even put comments on the same line as actual code:
Last updated