This commit is contained in:
Ilya Kantor 2015-11-18 16:15:29 +03:00
parent 4bca225593
commit 547854a151
1655 changed files with 847 additions and 89231 deletions

View file

@ -1 +1 @@
Оба варианта функции работают одинаково, отличий нет.
No difference.

View file

@ -1,9 +1,10 @@
# Обязателен ли "else"?
# Is "else" required?
[importance 4]
Следующая функция возвращает `true`, если параметр `age` больше `18`.
В ином случае она задаёт вопрос посредством вызова `confirm` и возвращает его результат.
The following function returns `true` if the parameter `age` is greater than `18`.
Otherwise it asks for a confirmation and returns its result:
```js
function checkAge(age) {
@ -12,13 +13,13 @@ function checkAge(age) {
*!*
} else {
// ...
return confirm('Родители разрешили?');
return confirm('Did parents allow you?');
}
*/!*
}
```
Будет ли эта функция работать как-то иначе, если убрать `else`?
Will the function work differently if `else` is removed?
```js
function checkAge(age) {
@ -27,9 +28,9 @@ function checkAge(age) {
}
*!*
// ...
return confirm('Родители разрешили?');
return confirm('Did parents allow you?');
*/!*
}
```
Есть ли хоть одно отличие в поведении этого варианта?
Is there any difference in the bahavior of these two variants?