/*
and end with an asterisk and a forward slash */
.**
+**Komentarze w kilku liniach zaczynamy od ukośnika i gwiazdki /\*
, a kończymy gwiazdką i ukośnikiem \*/
.**
-Like this:
+Tak jak tutaj:
```js run
-/* An example with two messages.
-This is a multiline comment.
+/* To jest przykładowy komentarz.
+Komentarz zajmuje kilka linii.
*/
-alert('Hello');
-alert('World');
+alert("Witaj");
+alert("świecie");
```
-The content of comments is ignored, so if we put code inside /* ... */
, it won't execute.
+Treść komentarza jest ignorowana, więc możemy w nim umieścić kod /\* ... \*/
, który się nie wykona.
-Sometimes it can be handy to temporarily disable a part of code:
+Czasami przydaje się to, gdy chcemy tymczasowo wyłączyć pewną część kodu:
```js run
-/* Commenting out the code
-alert('Hello');
+/* Zakomentowana część kodu
+alert('Witaj');
*/
-alert('World');
+alert("świecie");
```
-```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="Używaj skrótów klawiaturowych!"
+W większości edytorów można zamienić jedną linię w komentarz za pomocą klawiszy `key:Ctrl+/` lub kilka linii za pomocą `key:Ctrl+Shift+/` (zaznacz fragment kodu i po prostu wciśnij te klawisze). Jeśli korzystasz z Maca, zamiast `key:Ctrl` użyj `key:Cmd`.
```
-````warn header="Nested comments are not supported!"
-There may not be `/*...*/` inside another `/*...*/`.
+````warn header="Nie można zagnieżdżać komentarzy!"
+Nie można umieszczać jednego komentarza blokowego `/*...*/` wewnątrz innego `/*...*/`.
-Such code will die with an error:
+Taki kod rzuci błędem:
```js run no-beautify
/*
- /* nested comment ?!? */
+ /* zagnieżdżony komentarz ?!? */
*/
-alert( 'World' );
+alert( 'świecie' );
```
````
-Please, don't hesitate to comment your code.
+Nie bój się komentować swojego kodu.
-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.
+Komentarze może i zwiększają objętość kodu, ale tym się nie martw. Istnieje wiele narzędzi, które minifikują kod przed opublikowaniem go w środowisku produkcyjnym poprzez m.in. usunięcie komentarzy. Korzystanie z takich narzędzi nie ma żadnego negatywnego wpływu na działanie skryptów w środowisku produkcyjnym.
-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: