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

22 lines
933 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
title: Comment Your JavaScript Code
localeTitle: Комментарий
---
Комментарии - отличный способ оставить заметки для себя и для других людей, которым позже нужно будет выяснить, что он делает. Любой код в нем будет проигнорирован.
Давайте рассмотрим два способа написания комментариев в JavaScript.
* Комментарий с двойной косой чертой прокомментирует оставшуюся часть текста в текущей строке:
`// This is a single line comment.`
* Комментарий slash-star-star-slash будет комментировать все между символами `/*` и `*/` :
```javascript
/*
This is
a multi-line comment
(comment block)
*/
```