freeCodeCamp/guide/english/javascript/tutorials/comment-your-javascript-code/index.md

21 lines
583 B
Markdown
Raw Normal View History

2018-10-12 19:37:13 +00:00
---
title: Comment Your JavaScript Code
---
Comments are a great way to leave notes to yourself and to other people who will later need to figure out what it does. Any code in it will be ignored.
Let's take a look at the two ways you can write comments in JavaScript.
* The double-slash comment will comment out the remainder of the text on the current line:
`// This is a single line comment.`
* The slash-star-star-slash comment will comment out everything between the `/*` and the `*/` characters:
```javascript
/*
This is
a multi-line comment
(comment block)
*/
```