Skip to content

Commit 021a741

Browse files
authored
Merge pull request #29 from lifeoflikhon/master
Functions
2 parents df98411 + 29c7606 commit 021a741

File tree

8 files changed

+157
-158
lines changed

8 files changed

+157
-158
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
No difference.
1+
পার্থক্য নেই.

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ 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) {
@@ -21,7 +21,7 @@ function checkAge(age) {
2121
}
2222
```
2323

24-
Will the function work differently if `else` is removed?
24+
`else` না থাকলে কি ফাংশন আগের মতো কাজ করবে?
2525

2626
```js
2727
function checkAge(age) {
@@ -35,4 +35,4 @@ function checkAge(age) {
3535
}
3636
```
3737

38-
Is there any difference in the behavior of these two variants?
38+
দুই ফাংশনের মধ্যে কোনো কাজের পার্থক্য আছে কি?
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
Using a question mark operator `'?'`:
1+
প্রশ্নবোধক চিহ্ন `'?'` ব্যবহার করেঃ
22

33
```js
44
function checkAge(age) {
55
return (age > 18) ? true : confirm('Did parents allow you?');
66
}
77
```
88

9-
Using OR `||` (the shortest variant):
9+
OR `||` ব্যবহার করে (সবচেয়ে ছোট):
1010

1111
```js
1212
function checkAge(age) {
1313
return (age > 18) || confirm('Did parents allow you?');
1414
}
1515
```
1616

17-
Note that the parentheses around `age > 18` are not required here. They exist for better readabilty.
17+
নোটঃ `age > 18` দুপাশে প্রথম ব্রাকেট প্রয়োজনীয় না। শুধুই বুঝার সুবিধার্থে দেওয়া।

Diff for: 1-js/02-first-steps/14-function-basics/2-rewrite-function-question-or/task.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ importance: 4
22

33
---
44

5-
# Rewrite the function using '?' or '||'
5+
# '?' অথবা '||' এর ব্যবহার
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) {
@@ -18,9 +18,9 @@ function checkAge(age) {
1818
}
1919
```
2020

21-
Rewrite it, to perform the same, but without `if`, in a single line.
21+
এটাকে পূনরায় লিখুন, যেন ফাংশন একই কাজ করে, কিন্তু সম্পুর্ণভাবে `if` ছাড়া।
2222

23-
Make two variants of `checkAge`:
23+
`checkAge` এর দুইটা ভিন্ন ফাংশন বানান, যা একই কাজ করবেঃ
2424

25-
1. Using a question mark operator `?`
26-
2. Using OR `||`
25+
1. প্রশ্নবোধক `?` চিহ্ন ব্যবহার করে
26+
2. OR `||` ব্যবহার করে

Diff for: 1-js/02-first-steps/14-function-basics/3-min/solution.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
A solution using `if`:
1+
`if` ব্যবহার করে সমাধানঃ
22

33
```js
44
function min(a, b) {
@@ -10,12 +10,12 @@ function min(a, b) {
1010
}
1111
```
1212

13-
A solution with a question mark operator `'?'`:
13+
`'?'` ব্যবহার করে সমাধানঃ
1414

1515
```js
1616
function min(a, b) {
1717
return a < b ? a : b;
1818
}
1919
```
2020

21-
P.S. In the case of an equality `a == b` it does not matter what to return.
21+
নোটঃ সমানের ক্ষেত্রে `a == b` কী রিটার্ন করা লাগবে সে বিষয়ে সমস্যাতে কিছু বলা হয়নি।

Diff for: 1-js/02-first-steps/14-function-basics/3-min/task.md

+6-7
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@ importance: 1
22

33
---
44

5-
# Function min(a, b)
5+
# min(a, b) ফাংশন
66

7-
Write a function `min(a,b)` which returns the least of two numbers `a` and `b`.
7+
একটা ফাংশন লিখুন `min(a,b)` যা সবচেয়ে ছোট ভ্যালু রিটার্ন করবে `a` `b` এর মধ্যে থেকে।
88

9-
For instance:
9+
উদাহরণস্বরূপঃ
1010

1111
```js
12-
min(2, 5) == 2
13-
min(3, -1) == -1
14-
min(1, 1) == 1
12+
min(2, 5) == 2;
13+
min(3, -1) == -1;
14+
min(1, 1) == 1;
1515
```
16-

Diff for: 1-js/02-first-steps/14-function-basics/4-pow/task.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ importance: 4
22

33
---
44

5-
# Function pow(x,n)
5+
# pow(x,n) ফাংশন
66

7-
Write a function `pow(x,n)` that returns `x` in power `n`. Or, in other words, multiplies `x` by itself `n` times and returns the result.
7+
একটা ফাংশন লিখুন `pow(x,n)` যা ভ্যালু রিটার্ন করে `x` এর পাওয়ার `n` ধরে। অন্যভাবে, `x` কে `n` বার গুণ করে ফলাফল রিটার্ন করে।
88

99
```js
1010
pow(3, 2) = 3 * 3 = 9
1111
pow(3, 3) = 3 * 3 * 3 = 27
1212
pow(1, 100) = 1 * 1 * ...* 1 = 1
1313
```
1414

15-
Create a web-page that prompts for `x` and `n`, and then shows the result of `pow(x,n)`.
15+
একটা ওয়েব পেইজ বানান যেখান থেকে ইউজারের কাছ থেকে `x` `n` নেওয়া যাবে, সেখান থেকে `pow(x,n)` এর ভ্যালু রিটার্ন করুন।
1616

1717
[demo]
1818

19-
P.S. In this task the function should support only natural values of `n`: integers up from `1`.
19+
নোটঃ এই ক্ষেত্রে `n` এর মান স্বাভাবিক হওয়া উচিৎ: ইন্টিজার `1` বা তার বেশি।

0 commit comments

Comments
 (0)