Skip to content

Commit c7875f9

Browse files
committed
translated task & solution 1
1 parent 454fbd4 commit c7875f9

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
No difference.
1+
فرقی ندارد.

1-js/02-first-steps/14-function-basics/1-if-else-required/task.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,37 @@ importance: 4
22

33
---
44

5-
# Is "else" required?
5+
# آیا "else" لازم است؟
66

7-
The following function returns `true` if the parameter `age` is greater than `18`.
7+
تابع زیر `true` را برمیگرداند اگر پارامتر `age` از `18` بزرگتر باشد.
88

9-
Otherwise it asks for a confirmation and returns its result:
9+
در غیر اینصورت برای تأیید سوال می‌پرسد و سپس جواب را بر‌میگرداند:
1010

1111
```js
1212
function checkAge(age) {
13-
if (age > 18) {
14-
return true;
13+
if (age > 18) {
14+
return true;
1515
*!*
16-
} else {
17-
// ...
18-
return confirm('Did parents allow you?');
19-
}
16+
} else {
17+
// ...
18+
return confirm('Did parents allow you?');
19+
}
2020
*/!*
2121
}
2222
```
2323

24-
Will the function work differently if `else` is removed?
24+
آیا اگر `else` را حذف کنیم تابع جور دیگری کار می‌کند؟
2525

2626
```js
2727
function checkAge(age) {
28-
if (age > 18) {
29-
return true;
30-
}
28+
if (age > 18) {
29+
return true;
30+
}
3131
*!*
32-
// ...
33-
return confirm('Did parents allow you?');
32+
// ...
33+
return confirm('Did parents allow you?');
3434
*/!*
3535
}
3636
```
3737

38-
Is there any difference in the behavior of these two variants?
38+
آیا هیچ تفاوتی در رفتار این دو حالت وجود دارد؟

0 commit comments

Comments
 (0)