Skip to content

Commit 5f6887f

Browse files
committed
ru translate 50-54
1 parent 6118d05 commit 5f6887f

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

README_ru-RU.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,7 +1515,7 @@ const num = parseInt("7*6", 10);
15151515

15161516
---
15171517

1518-
###### 51. What's the output?
1518+
###### 51. Каким будет результат?
15191519

15201520
```javascript
15211521
function getInfo(member, year) {
@@ -1536,23 +1536,23 @@ console.log(person, birthYear);
15361536
- C: `{ name: "Lydia" }, "1998"`
15371537
- D: `{ name: "Sarah" }, "1997"`
15381538

1539-
<details><summary><b>Answer</b></summary>
1539+
<details><summary><b>Ответ</b></summary>
15401540
<p>
15411541

1542-
#### Answer: A
1542+
#### Ответ: A
15431543

1544-
Arguments are passed by _value_, unless their value is an object, then they're passed by _reference_. `birthYear` is passed by value, since it's a string, not an object. When we pass arguments by value, a _copy_ of that value is created (see question 46).
1544+
Аргументы передаются _значением_, если их значение не является объектом, то они передаются _ссылкой_. `birthYear` передается по значению, поскольку это строка, а не объект. Когда мы передаем аргументы по значению, создается _копия_ этого значения (см. вопрос 46).
15451545

1546-
The variable `birthYear` has a reference to the value `"1997"`. The argument `year` also has a reference to the value `"1997"`, but it's not the same value as `birthYear` has a reference to. When we update the value of `year` by setting `year` equal to `"1998"`, we are only updating the value of `year`. `birthYear` is still equal to `"1997"`.
1546+
Переменная `birthYear` имеет ссылку на значение `"1997"`. Аргумент `year` также имеет ссылку на значение` "1997" `, но это не то же самое значение, на которое имеется ссылка для `birthYear`. Когда мы обновляем значение `year`, устанавливая `year` равным `"1998"`, мы обновляем только значение `year`. `birthYear` по-прежнему равно `"1997"`.
15471547

1548-
The value of `person` is an object. The argument `member` has a (copied) reference to the _same_ object. When we modify a property of the object `member` has a reference to, the value of `person` will also be modified, since they both have a reference to the same object. `person`'s `name` property is now equal to the value `"Lydia"`
1548+
Значение `person` является объектом. Аргумент `member` имеет (скопированную) ссылку на _тот же_ объект. Когда мы изменяем свойство объекта, на который `member` ссылается, значение `person` также будет изменено, поскольку они оба имеют ссылку на один и тот же объект. Свойство `name` объекта `person` теперь равно значению `"Lydia"`.
15491549

15501550
</p>
15511551
</details>
15521552

15531553
---
15541554

1555-
###### 52. What's the output?
1555+
###### 52. Каким будет результат?
15561556

15571557
```javascript
15581558
function greeting() {
@@ -1576,21 +1576,21 @@ sayHi();
15761576
- C: `SyntaxError: can only throw Error objects`
15771577
- D: `"Oh no an error: Hello world!`
15781578

1579-
<details><summary><b>Answer</b></summary>
1579+
<details><summary><b>Ответ</b></summary>
15801580
<p>
15811581

1582-
#### Answer: D
1582+
#### Ответ: D
15831583

1584-
With the `throw` statement, we can create custom errors. With this statement, you can throw exceptions. An exception can be a <b>string</b>, a <b>number</b>, a <b>boolean</b> or an <b>object</b>. In this case, our exception is the string `'Hello world'`.
1584+
С помощью оператора `throw` мы можем создавать собственные ошибки. С этим оператором вы можете генерировать исключения. Исключением может быть <b>строка</b>, <b>число</b>, <b>логическое значение</b> или <b>объект</b>. В этом случае нашим исключением является строка `'Hello world'`.
15851585

1586-
With the `catch` statement, we can specify what to do if an exception is thrown in the `try` block. An exception is thrown: the string `'Hello world'`. `e` is now equal to that string, which we log. This results in `'Oh an error: Hello world'`.
1586+
С помощью оператора `catch` мы можем указать, что делать, если в блоке` try` выдается исключение. Исключение: строка `'Hello world'`. `e` теперь равно той строке, которую мы записываем. Это приводит к `'Oh error: Hello world'`.
15871587

15881588
</p>
15891589
</details>
15901590

15911591
---
15921592

1593-
###### 53. What's the output?
1593+
###### 53. Каким будет результат?
15941594

15951595
```javascript
15961596
function Car() {
@@ -1607,19 +1607,19 @@ console.log(myCar.make);
16071607
- C: `ReferenceError`
16081608
- D: `TypeError`
16091609

1610-
<details><summary><b>Answer</b></summary>
1610+
<details><summary><b>Ответ</b></summary>
16111611
<p>
16121612

1613-
#### Answer: B
1613+
#### Ответ: B
16141614

1615-
When you return a property, the value of the property is equal to the _returned_ value, not the value set in the constructor function. We return the string `"Maserati"`, so `myCar.make` is equal to `"Maserati"`.
1615+
Когда вы возвращаете свойство, значение свойства равно _возвращаемому_ значению, а не значению, установленному в функции конструктора. Мы возвращаем строку `"Maserati"`, поэтому `myCar.make` равно `"Maserati"`.
16161616

16171617
</p>
16181618
</details>
16191619

16201620
---
16211621

1622-
###### 54. What's the output?
1622+
###### 54. Каким будет результат?
16231623

16241624
```javascript
16251625
(() => {
@@ -1635,23 +1635,23 @@ console.log(typeof y);
16351635
- C: `"object", "number"`
16361636
- D: `"number", "undefined"`
16371637

1638-
<details><summary><b>Answer</b></summary>
1638+
<details><summary><b>Ответ</b></summary>
16391639
<p>
16401640

1641-
#### Answer: A
1641+
#### Ответ: A
16421642

1643-
`let x = y = 10;` is actually shorthand for:
1643+
`let x = y = 10;` на самом деле является сокращением для:
16441644

16451645
```javascript
16461646
y = 10;
16471647
let x = y;
16481648
```
16491649

1650-
When we set `y` equal to `10`, we actually add a property `y` to the global object (`window` in browser, `global` in Node). In a browser, `window.y` is now equal to `10`.
1650+
Когда мы устанавливаем `y` равным` 10`, мы фактически добавляем свойство `y` к глобальному объекту (`window` в браузере, `global` в Node). В браузере `window.y` теперь равен` 10`.
16511651

1652-
Then, we declare a variable `x` with the value of `y`, which is `10`. Variables declared with the `let` keyword are _block scoped_, they are only defined within the block they're declared in; the immediately-invoked function (IIFE) in this case. When we use the `typeof` operator, the operand `x` is not defined: we are trying to access `x` outside of the block it's declared in. This means that `x` is not defined. Values who haven't been assigned a value or declared are of type `"undefined"`. `console.log(typeof x)` returns `"undefined"`.
1652+
Затем мы объявляем переменную `x` со значением` y`, которое равно `10`. Переменные, объявленные с ключевым словом `let`, имею _блочную видимость_, они определены только в блоке, в котором они объявлены; немедленно вызванная функция (IIFE) в этом случае. Когда мы используем оператор `typeof`, операнд` x` не определен: мы пытаемся получить доступ к `x` вне блока, в котором он объявлен. Это означает, что` x` не определен. Значения, которым не присвоено или не объявлено значение, имеют тип `"undefined"`. `console.log(typeof x)` возвращает `"undefined"`.
16531653

1654-
However, we created a global variable `y` when setting `y` equal to `10`. This value is accessible anywhere in our code. `y` is defined, and holds a value of type `"number"`. `console.log(typeof y)` returns `"number"`.
1654+
Однако мы создали глобальную переменную `y`, установив `y` равным `10`. Это значение доступно в любом месте нашего кода. `y` определен и содержит значение типа `"number"`. `console.log(typeof y)` возвращает `"number"`.
16551655

16561656
</p>
16571657
</details>

0 commit comments

Comments
 (0)