File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
1-js/02-first-steps/14-function-basics/3-min Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 1
- A solution using ` if ` :
1
+ راه حل با کمک ` if ` :
2
2
3
3
``` js
4
4
function min (a , b ) {
@@ -10,12 +10,12 @@ function min(a, b) {
10
10
}
11
11
```
12
12
13
- A solution with a question mark operator ` '?' ` :
13
+ راه حل با علامت سوال ` '?' ` :
14
14
15
15
``` js
16
16
function min (a , b ) {
17
17
return a < b ? a : b;
18
18
}
19
19
```
20
20
21
- P.S. In the case of an equality ` a == b ` it does not matter what to return .
21
+ پینوشت: در حالت ` a == b ` ، مهم نیست که چه چیزی برگردانده شود .
Original file line number Diff line number Diff line change @@ -2,11 +2,12 @@ importance: 1
2
2
3
3
---
4
4
5
- # Function min(a, b)
5
+ # تابع min(a, b)
6
6
7
7
Write a function ` min(a,b) ` which returns the least of two numbers ` a ` and ` b ` .
8
+ تابع ` min(a,b) ` را بنویسید که کمترین را از دو عدد ` a ` و ` b ` خروجی میدهد.
8
9
9
- For instance :
10
+ برای نمونه :
10
11
11
12
``` js
12
13
min (2 , 5 ) == 2
You can’t perform that action at this time.
0 commit comments