URL: http://github.com/javascript-tutorial/uk.javascript.info/pull/25.diff
lash characters `//`.** +**Однорядкові коментарі починаються з подвійної косої риски `//`.** -The rest of the line is a comment. It may occupy a full line of its own or follow a statement. +Частина рядка після `//` вважається коментарем. Такий коментар може займати весь рядок, або знаходитися після інструкції. -Like here: +Ось так: ```js run -// This comment occupies a line of its own -alert('Hello'); +// Цей коментар займає весь рядок +alert('Привіт'); -alert('World'); // This comment follows the statement +alert('Світ'); // Цей коментар знаходиться після інструкції ``` -**Multiline comments start with a forward slash and an asterisk/* and end with an asterisk and a forward slash */.**
+**Багаторядкові коментарі починаються з косої риски з зірочкою /* і закінчується зірочкою з косою рискою */.**
-Like this:
+Ось так:
```js run
-/* An example with two messages.
-This is a multiline comment.
+/* Приклад з двома повідомленнями.
+Це багаторядковий коментар.
*/
-alert('Hello');
-alert('World');
+alert('Привіт');
+alert('Світ');
```
-The content of comments is ignored, so if we put code inside /* ... */, it won't execute.
+Вміст коментаря ігнорується, тому, якщо ми напишемо всередині /* ... */ код, він не виконається.
-Sometimes it can be handy to temporarily disable a part of code:
+Деколи виникає необхідність тимчасово вимкнути частину коду:
```js run
-/* Commenting out the code
-alert('Hello');
+/* Закоментований код
+alert('Привіт');
*/
-alert('World');
+alert('Світ');
```
-```smart header="Use hotkeys!"
-In most editors, a line of code can be commented out by pressing the `key:Ctrl+/` hotkey for a single-line comment and something like `key:Ctrl+Shift+/` -- for multiline comments (select a piece of code and press the hotkey). For Mac, try `key:Cmd` instead of `key:Ctrl`.
+```smart header="Використовуйте комбінації клавіш!"
+В більшості редакторів, рядок коду можна закоментувати, натиснувши комбінацію клавіш `key:Ctrl+/`, а щоб закоментувати декілька рядків – виділіть потрібні рядки і натисніть комбінацію клавіш `key:Ctrl+Shift+/`. Для Mac, потрібно натискати клавішу `key:Cmd` замість `key:Ctrl`.
```
-````warn header="Nested comments are not supported!"
-There may not be `/*...*/` inside another `/*...*/`.
+````warn header="Вкладені коментарі не підтримуються!"
+Не може бути `/*...*/` всередині `/*...*/`.
-Such code will die with an error:
+Такий код "вмре" з помилкою:
```js run no-beautify
/*
- /* nested comment ?!? */
+ /* вкладений коментар ?!? */
*/
-alert( 'World' );
+alert( 'Світ' );
```
````
-Please, don't hesitate to comment your code.
+Будь ласка, не соромтеся коментувати ваш код.
-Comments increase the overall code footprint, but that's not a problem at all. There are many tools which minify code before publishing to a production server. They remove comments, so they don't appear in the working scripts. Therefore, comments do not have negative effects on production at all.
+Коментарі збільшують розмір коду, але це не проблема. Є багато інструментів, які мініфікують код перед публікацією на робочий сервер. Вони видалять коментарі, тому їх не буде в робочих скриптах. Таким чином, коментарі жодним чином не впливають на робочий код.
-Later in the tutorial there will be a chapter Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: