Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changed rubles to yuans #739

Merged
merged 1 commit into from
May 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions modules/30-variables/15-variables-expressions/description.ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,25 @@ theory: |
Вернемся к нашей валютной программе. Запишем стоимость доллара в юанях как отдельную переменную. Вычислим цену 50 евро в долларах, умножив их на `1.25`. Допустим, что 1 доллар — 6.91 юаней:

```javascript
let rublesPerDollar = 6.91;
let yuansPerDollar = 6.91;
let dollarsCount = 50 * 1.25; // 62.5
let rublesCount = dollarsCount * rublesPerDollar; // 431.875
let yuansCount = dollarsCount * yuansPerDollar; // 431.875

console.log(rublesCount);
console.log(yuansCount);
```

А теперь давайте добавим к выводу текст с помощью конкатенации:

```javascript
let rublesPerDollar = 6.91;
let yuansPerDollar = 6.91;
let dollarsCount = 50 * 1.25; // 62.5
let rublesCount = dollarsCount * rublesPerDollar; // 431.875
let yuansCount = dollarsCount * yuansPerDollar; // 431.875

console.log('The price is ' + rublesCount + ' rubles');
console.log('The price is ' + yuansCount + ' yuans');
```

<pre class='hexlet-basics-output'>
The price is 431.875 rubles
The price is 431.875 yuans
</pre>

Любая переменная может быть частью любого выражения. В момент вычисления, вместо имени переменной подставляется её значение.
Expand Down