Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions modules/10-basics/10-hello-world/en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,17 @@ console.log("Hexlet - programming school");

The command stays the same, only the contents of the parentheses change. So that the program understands that this is exactly text, it is enclosed in quotes. You can use single `'...'` or double `"..."` quotes, but the opening and closing quotes must match.

```javascript
console.log("Hexlet - programming school");
<!-- lint-code-blocks: skip — две формы записи кавычек это предмет урока, форматтер свёл бы их к одной -->

```text
console.log('Hexlet - programming school');
```

According to the style accepted in the JavaScript community, single quotes are recommended for strings. If there is an apostrophe inside the string, single quotes will break the syntax, so in such cases double quotes are used.
In this course we use double quotes: that is the style of the formatter that checks the code in the exercises. Single quotes are used when the string contains double quotes: a quote that matches the outer one ends the string too early.

```javascript
console.log("it's JavaScript"); // apostrophe inside, so double quotes
console.log("it's JavaScript"); // an apostrophe inside double quotes is an ordinary character
console.log('He said "No"'); // double quotes inside, so single quotes outside
```

## The meaning of symbols
Expand Down
11 changes: 7 additions & 4 deletions modules/10-basics/10-hello-world/es/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@ console.log("Hexlet - escuela de programación");

El comando sigue siendo el mismo, solo cambia el contenido entre paréntesis. Para que el programa entienda que se trata precisamente de texto, este se encierra entre comillas. Puedes usar comillas simples `'...'` o dobles `"..."`, pero las comillas de apertura y de cierre deben coincidir.

```javascript
console.log("Hexlet - escuela de programación");
<!-- lint-code-blocks: skip — две формы записи кавычек это предмет урока, форматтер свёл бы их к одной -->

```text
console.log('Hexlet - escuela de programación');
```

Según el estilo aceptado en la comunidad de JavaScript, se recomienda usar comillas simples para las cadenas. Si dentro de la cadena hay un apóstrofo, las comillas simples romperán la sintaxis, por lo que en esos casos se usan comillas dobles.
En este curso usamos comillas dobles: ese es el estilo del formateador con el que se revisa el código de los ejercicios. Las simples las usamos cuando dentro de la cadena hay comillas dobles: una comilla igual a la exterior termina la cadena antes de tiempo.

```javascript
console.log("it's JavaScript"); // apóstrofo dentro, por eso comillas dobles
console.log("it's JavaScript"); // un apóstrofo dentro de comillas dobles es un carácter normal
console.log('Él dijo "No"'); // comillas dobles dentro, por eso las exteriores son simples
```

## El significado de los símbolos
Expand Down
11 changes: 7 additions & 4 deletions modules/10-basics/10-hello-world/ru/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@

Команда остается той же, меняется только содержимое скобок. Чтобы программа понимала, что это именно текст, он заключается в кавычки. Можно использовать одинарные `'...'` или двойные `"..."`, но открывающая и закрывающая кавычки должны совпадать.

```javascript
console.log("Хекслет - школа программирования");
<!-- lint-code-blocks: skip — две формы записи кавычек это предмет урока, форматтер свёл бы их к одной -->

```text
console.log('Хекслет - школа программирования');
```

По принятому в JavaScript-сообществе стилю для строк рекомендуется использовать одинарные кавычки. Если внутри строки есть апостроф, одинарные кавычки сломают синтаксис, поэтому в таких случаях используют двойные.
В этом курсе мы используем двойные кавычки — этого же стиля придерживается форматтер, которым проверяется код в практиках. Одинарные берём тогда, когда внутри строки есть двойные: кавычка, совпадающая с внешней, оборвёт строку раньше времени.

Check notice on line 29 in modules/10-basics/10-hello-world/ru/README.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] modules/10-basics/10-hello-world/ru/README.md#L29

Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES) URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US Category: PUNCTUATION
Raw output
modules/10-basics/10-hello-world/ru/README.md:29:175: Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES)
 URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses 
 Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
 Category: PUNCTUATION

Check notice on line 29 in modules/10-basics/10-hello-world/ru/README.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] modules/10-basics/10-hello-world/ru/README.md#L29

Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES) URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US Category: PUNCTUATION
Raw output
modules/10-basics/10-hello-world/ru/README.md:29:222: Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
 URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses 
 Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
 Category: PUNCTUATION

Check notice on line 29 in modules/10-basics/10-hello-world/ru/README.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] modules/10-basics/10-hello-world/ru/README.md#L29

Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES) URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US Category: PUNCTUATION
Raw output
modules/10-basics/10-hello-world/ru/README.md:29:238: Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES)
 URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses 
 Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
 Category: PUNCTUATION

```javascript
console.log("it's JavaScript"); // апостроф внутри, поэтому двойные кавычки
console.log("it's JavaScript"); // апостроф внутри двойных кавычек это обычный символ
console.log('Он сказал "Нет"'); // двойные кавычки внутри, поэтому снаружи одинарные
```

## Значение символов
Expand Down
14 changes: 9 additions & 5 deletions modules/25-strings/10-quotes/en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@

In JavaScript, strings can be written in both single and double quotes.

```javascript
console.log("Hello");
<!-- lint-code-blocks: skip — две формы записи кавычек это предмет урока, форматтер свёл бы их к одной -->

```text
console.log('Hello');
console.log("Hello");
```

By default, it is customary to use single quotes `'` if double quotes are not required inside the string. This style is followed by the popular code style standard from [AirBnb](https://github.com/airbnb/javascript).
There is no single rule in the JavaScript community: some guides pick single quotes and others pick double ones. What matters is sticking to one style. In this course we use double quotes, and single ones when the string contains double quotes: that is the style of the formatter that checks the code in the exercises.

## The problem with quotes inside a string

Expand Down Expand Up @@ -87,8 +89,10 @@

In this case, to keep JavaScript from confusing the quotes inside the string with the outer ones, an escape character is used — the backslash `\`. It tells the interpreter that the character following it is part of the string, not a control character.

```javascript
console.log('Dragon\'s mother said "No"');
<!-- lint-code-blocks: skip — экранирование двойной кавычки это предмет урока, форматтер переписал бы его в экранирование апострофа -->

Check notice on line 92 in modules/25-strings/10-quotes/en/README.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] modules/25-strings/10-quotes/en/README.md#L92

Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES) URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US Category: PUNCTUATION
Raw output
modules/25-strings/10-quotes/en/README.md:92:94: Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES)
 URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses 
 Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
 Category: PUNCTUATION

Check notice on line 92 in modules/25-strings/10-quotes/en/README.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] modules/25-strings/10-quotes/en/README.md#L92

Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES) URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US Category: PUNCTUATION
Raw output
modules/25-strings/10-quotes/en/README.md:92:117: Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES)
 URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses 
 Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
 Category: PUNCTUATION

```text
console.log("Dragon's mother said \"No\"");
// => Dragon's mother said "No"
```

Expand Down
14 changes: 9 additions & 5 deletions modules/25-strings/10-quotes/es/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@

En JavaScript, las cadenas de texto se pueden escribir tanto entre comillas simples como entre comillas dobles.

```javascript
console.log("Hello");
<!-- lint-code-blocks: skip — две формы записи кавычек это предмет урока, форматтер свёл бы их к одной -->

```text
console.log('Hello');
console.log("Hello");
```

Por defecto, se acostumbra usar comillas simples `'` si no se requieren comillas dobles dentro de la cadena. Este estilo lo sigue el popular estándar de formato de código de [AirBnb](https://github.com/airbnb/javascript).
No hay una regla única en la comunidad de JavaScript: unas guías eligen las comillas simples y otras las dobles. Lo importante es mantener un solo estilo. En este curso usamos las dobles, y las simples cuando dentro de la cadena hay comillas dobles: ese es el estilo del formateador con el que se revisa el código de los ejercicios.

## El problema con las comillas dentro de una cadena

Expand Down Expand Up @@ -87,8 +89,10 @@

En este caso, para que JavaScript no confunda las comillas dentro de la cadena con las exteriores, se utiliza el carácter de escape: la barra invertida `\`. Le indica al intérprete que el carácter que la sigue es parte de la cadena y no un carácter de control.

```javascript
console.log('Dragon\'s mother said "No"');
<!-- lint-code-blocks: skip — экранирование двойной кавычки это предмет урока, форматтер переписал бы его в экранирование апострофа -->

Check notice on line 92 in modules/25-strings/10-quotes/es/README.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] modules/25-strings/10-quotes/es/README.md#L92

Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES) URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US Category: PUNCTUATION
Raw output
modules/25-strings/10-quotes/es/README.md:92:46: Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES)
 URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses 
 Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
 Category: PUNCTUATION

Check notice on line 92 in modules/25-strings/10-quotes/es/README.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] modules/25-strings/10-quotes/es/README.md#L92

Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES) URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US Category: PUNCTUATION
Raw output
modules/25-strings/10-quotes/es/README.md:92:69: Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES)
 URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses 
 Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
 Category: PUNCTUATION

```text
console.log("Dragon's mother said \"No\"");
// => Dragon's mother said "No"
```

Expand Down
14 changes: 9 additions & 5 deletions modules/25-strings/10-quotes/ru/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@

В JavaScript строки можно записывать как в одинарных, так и в двойных кавычках.

```javascript
console.log("Hello");
<!-- lint-code-blocks: skip — две формы записи кавычек это предмет урока, форматтер свёл бы их к одной -->

```text
console.log('Hello');
console.log("Hello");
```

По умолчанию принято использовать одинарные кавычки `'`, если внутри строки не требуется двойных. Этого стиля придерживается популярный стандарт оформления кода от [AirBnb](https://github.com/airbnb/javascript).
Единого правила в JavaScript-сообществе нет: одни руководства выбирают одинарные кавычки, другие двойные. Важно держаться одного стиля. В этом курсе мы используем двойные, а одинарные берём тогда, когда внутри строки есть двойные — этого же стиля придерживается форматтер, которым проверяется код в практиках.

Check notice on line 61 in modules/25-strings/10-quotes/ru/README.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] modules/25-strings/10-quotes/ru/README.md#L61

Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES) URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US Category: PUNCTUATION
Raw output
modules/25-strings/10-quotes/ru/README.md:61:228: Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES)
 URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses 
 Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
 Category: PUNCTUATION

Check notice on line 61 in modules/25-strings/10-quotes/ru/README.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] modules/25-strings/10-quotes/ru/README.md#L61

Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES) URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US Category: PUNCTUATION
Raw output
modules/25-strings/10-quotes/ru/README.md:61:251: Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES)
 URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses 
 Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
 Category: PUNCTUATION

## Проблема с кавычками внутри строки

Expand Down Expand Up @@ -89,8 +91,10 @@

В этом случае, чтобы JavaScript не спутал кавычки внутри строки с внешними, используют символ экранирования — обратный слэш `\`. Он говорит интерпретатору, что следующий за ним символ является частью строки, а не управляющим символом.

```javascript
console.log('Dragon\'s mother said "No"');
<!-- lint-code-blocks: skip — экранирование двойной кавычки это предмет урока, форматтер переписал бы его в экранирование апострофа -->

```text
console.log("Dragon's mother said \"No\"");
// => Dragon's mother said "No"
```

Expand Down
Loading