Skip to content

Commit 10910e1

Browse files
author
Md. Jamal Uddin
authored
Merge pull request #34 from sabbirshawon/master
logical operators
2 parents 876ba0c + 509eaa8 commit 10910e1

File tree

18 files changed

+122
-120
lines changed

18 files changed

+122
-120
lines changed

Diff for: 1-js/02-first-steps/11-logical-operators/1-alert-null-2-undefined/solution.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
The answer is `2`, that's the first truthy value.
1+
প্রথম সত্য মানের জন্য উত্তর ২ হবে।
22

33
```js run
44
alert( null || 2 || undefined );

Diff for: 1-js/02-first-steps/11-logical-operators/1-alert-null-2-undefined/task.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ importance: 5
22

33
---
44

5-
# What's the result of OR?
5+
# OR এর ফলাফল কি?
66

7-
What is the code below going to output?
7+
নিচের কোডটির আউটপুট কি হবে?
88

99
```js
1010
alert( null || 2 || undefined );
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
The answer: first `1`, then `2`.
1+
উত্তর প্রথমে ১ তারপর ২ ।
22

33
```js run
44
alert( alert(1) || 2 || alert(3) );
55
```
66

7-
The call to `alert` does not return a value. Or, in other words, it returns `undefined`.
7+
alert কল করলে কোন মান রিটার্ন করে না. অথবা, এক কথায় undefined দেখায়।
88

9-
1. The first OR `||` evaluates it's left operand `alert(1)`. That shows the first message with `1`.
10-
2. The `alert` returns `undefined`, so OR goes on to the second operand searching for a truthy value.
11-
3. The second operand `2` is truthy, so the execution is halted, `2` is returned and then shown by the outer alert.
9+
১। OR || অপারেশনে প্রথমে বাম দিক থেকে মূল্যায়ন করা হয়। সেজন্য এখানে প্রথম ফলাফল দেখায় 1।
10+
২। `alert` দেখায় `undefined`, অথবা সত্য মানটির সন্ধানে দ্বিতীয় প্রতীকে যায়।
11+
৩। দ্বিতীয় প্রতীক `2` সত্য হয়, সুতরাং এক্সিকিউশন স্থগিত, `2` ফিরে আসে এবং তারপরে বাইরের সতর্কতা দ্বারা দেখানো হয়।
1212

13-
There will be no `3`, because the evaluation does not reach `alert(3)`.
13+
কোনও `3` থাকবে না, কারণ মূল্যায়ন `alert(3)` তে পৌঁছায় না।

Diff for: 1-js/02-first-steps/11-logical-operators/2-alert-or/task.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ importance: 3
22

33
---
44

5-
# What's the result of OR'ed alerts?
5+
# OR এলার্ট এর ফলাফল কি?
66

7-
What will the code below output?
7+
নিচের কোডটির আউটপুট কি হবে?
88

99
```js
1010
alert( alert(1) || 2 || alert(3) );

Diff for: 1-js/02-first-steps/11-logical-operators/3-alert-1-null-2/solution.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
The answer: `null`, because it's the first falsy value from the list.
1+
উত্তর: `null`, কারণ এটি তালিকা থেকে প্রথম মিথ্যা মান
22

33
```js run
44
alert( 1 && null && 2 );

Diff for: 1-js/02-first-steps/11-logical-operators/3-alert-1-null-2/task.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ importance: 5
22

33
---
44

5-
# What is the result of AND?
5+
# AND এর ফলাফল কি?
66

7-
What is this code going to show?
7+
নিচের কোডটির আউটপুট কি হবে?
88

99
```js
1010
alert( 1 && null && 2 );
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
The answer: `1`, and then `undefined`.
1+
উত্তর: 1, এবং তারপর undefined
22

33
```js run
44
alert( alert(1) && alert(2) );
55
```
66

7-
The call to `alert` returns `undefined` (it just shows a message, so there's no meaningful return).
7+
`alert` কল `undefined` দেখায় (এটি কেবল একটি বার্তা দেখায়, যাতে কোনও অর্থবহ রিটার্ন নেই)।
8+
9+
কারণ, && অপারেশনেও সর্বদা বাম দিক থেকে মূল্যায়ন করা হয়। এজন্য (আউটপুট 1), এ সঙ্গে সঙ্গে থেমে যায়, কারণ undefined একটি মিথ্যা মান. এবং && অপারেশনে কোন একটি মান মিথ্যা হলে পুরো স্টেটমেন্টটি মিথ্যা হয়ে যায়।
10+
811

9-
Because of that, `&&` evaluates the left operand (outputs `1`), and immediately stops, because `undefined` is a falsy value. And `&&` looks for a falsy value and returns it, so it's done.
1012

Diff for: 1-js/02-first-steps/11-logical-operators/4-alert-and/task.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ importance: 3
22

33
---
44

5-
# What is the result of AND'ed alerts?
5+
# AND এলার্ট এর ফলাফল কি?
66

7-
What will this code show?
7+
নিচের কোডটির আউটপুট কি হবে?
88

99
```js
1010
alert( alert(1) && alert(2) );
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
The answer: `3`.
1+
উত্তর: 3 ।
22

33
```js run
44
alert( null || 2 && 3 || 4 );
55
```
66

7-
The precedence of AND `&&` is higher than `||`, so it executes first.
7+
এর প্রাধান্য AND `&&` এর চেয়ে বেশি `||`, সুতরাং এটি প্রথম চালায়।
88

9-
The result of `2 && 3 = 3`, so the expression becomes:
9+
`2 && 3 = 3` এর ফলাফল, তাই প্রকাশ হয়ে যায়:
1010

1111
```
1212
null || 3 || 4
1313
```
1414

15-
Now the result is the first truthy value: `3`.
15+
এখন, প্রথম সত্য মানের ফলাফল: `3`
1616

Diff for: 1-js/02-first-steps/11-logical-operators/5-alert-and-or/task.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ importance: 5
22

33
---
44

5-
# The result of OR AND OR
5+
# OR AND OR এর ফলাফল
66

7-
What will the result be?
7+
নিচের কোডটির আউটপুট কি হবে?
88

99
```js
1010
alert( null || 2 && 3 || 4 );

Diff for: 1-js/02-first-steps/11-logical-operators/6-check-if-in-range/task.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ importance: 3
22

33
---
44

5-
# Check the range between
5+
# নির্দিষ্ট পরিসীমার মধ্যে পরীক্ষা করুন
66

7-
Write an "if" condition to check that `age` is between `14` and `90` inclusively.
7+
একটি "if" কন্ডিশন লেখো যেখানে `age` `14` এবং `90` এর অন্তর্ভুক্ত কিনা।
88

9-
"Inclusively" means that `age` can reach the edges `14` or `90`.
9+
"Inclusively" এর অর্থ বুঝায় `age` `14` অথবা `90` প্রান্তে পৌঁছতে পারে।

Diff for: 1-js/02-first-steps/11-logical-operators/7-check-if-out-range/solution.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
The first variant:
1+
প্রথম রূপ:
22

33
```js
44
if (!(age >= 14 && age <= 90))
55
```
66

7-
The second variant:
7+
দ্বিতীয় রূপ:
88

99
```js
1010
if (age < 14 || age > 90)

Diff for: 1-js/02-first-steps/11-logical-operators/7-check-if-out-range/task.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ importance: 3
22

33
---
44

5-
# Check the range outside
5+
# নির্দিষ্ট পরিসীমার মধ্যে পরীক্ষা করুন
66

7-
Write an `if` condition to check that `age` is NOT between 14 and 90 inclusively.
7+
একটি "if" কন্ডিশন লেখো যেখানে `age` `14` এবং `90` এর অন্তর্ভুক্ত নয়।
88

9-
Create two variants: the first one using NOT `!`, the second one -- without it.
9+
দুটি রূপ তৈরি করুন: প্রথমটি NOT! `ব্যবহার করে, দ্বিতীয়টি -- এটি ছাড়াই।

Diff for: 1-js/02-first-steps/11-logical-operators/8-if-question/solution.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
The answer: the first and the third will execute.
1+
উত্তর: প্রথম এবং তৃতীয়টি কার্যকর করা হবে।
22

3-
Details:
3+
বিস্তারিত:
44

55
```js run
66
// Runs.

Diff for: 1-js/02-first-steps/11-logical-operators/8-if-question/task.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ importance: 5
22

33
---
44

5-
# A question about "if"
5+
# if সম্পর্কে একটি প্রশ্ন
66

7-
Which of these `alert`s are going to execute?
7+
এই alert এর মধ্যে কোনটি কার্যকর করতে চলেছে?
88

9-
What will the results of the expressions be inside `if(...)`?
9+
এক্সপ্রেশনগুলির ফলাফল কী হবে `if(...)` এর ভিতরে ?
1010

1111
```js
1212
if (-1 || 0) alert( 'first' );

Diff for: 1-js/02-first-steps/11-logical-operators/9-check-login/solution.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ if (userName == 'Admin') {
2222
}
2323
```
2424

25-
Note the vertical indents inside the `if` blocks. They are technically not required, but make the code more readable.
25+
If ব্লকের ভিতরে উল্লম্ব ইনডেন্টগুলি নোট করুন। এগুলি প্রযুক্তিগতভাবে প্রয়োজন হয় না, তবে কোডটি আরও পাঠযোগ্য হয়।

Diff for: 1-js/02-first-steps/11-logical-operators/9-check-login/task.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@ importance: 3
22

33
---
44

5-
# Check the login
5+
# লগইন চেক করুন
66

7-
Write the code which asks for a login with `prompt`.
7+
কোডটি লিখুন যা prompt দিয়ে লগিনের জন্য জিজ্ঞাসা করে।
88

9-
If the visitor enters `"Admin"`, then `prompt` for a password, if the input is an empty line or `key:Esc` -- show "Canceled", if it's another string -- then show "I don't know you".
9+
যদি ভিজিটর Admin প্রবেশ করে, তবে একটি পাসওয়ার্ডের জন্য prompt করুন, যদি ইনপুটটি খালি লাইন হয় বা key:Esc - যদি এটি অন্য স্ট্রিং থাকে - তবে I don't know you দেখাবে।
1010

11-
The password is checked as follows:
11+
পাসওয়ার্ডটি নিম্নলিখিত হিসাবে পরীক্ষা করা হয়েছে:
1212

13-
- If it equals "TheMaster", then show "Welcome!",
14-
- Another string -- show "Wrong password",
15-
- For an empty string or cancelled input, show "Canceled"
13+
- যদি এটি "TheMaster" এর সমান হয়, তবে "Welcome!" দেখাবে,
14+
- অন্য স্ট্রিং"Wrong password" দেখাবে,
15+
- খালি স্ট্রিং বা বাতিল ইনপুটটির জন্য, "Cancelled" দেখাবে
1616

17-
The schema:
17+
উদাহরণ:
1818

19-
![](ifelse_task.svg)
19+
![](ifelse_task.png)
2020

21-
Please use nested `if` blocks. Mind the overall readability of the code.
21+
নেস্টেড if ব্লক ব্যবহার করুন। কোড সামগ্রিক পঠনযোগ্যতা হবে।
2222

23-
Hint: passing an empty input to a prompt returns an empty string `''`. Pressing `key:ESC` during a prompt returns `null`.
23+
ইঙ্গিত: প্রম্পটে একটি খালি ইনপুট পাস করা একটি খালি স্ট্রিং দেয় ''। null প্রম্পট রিটার্ণ এর সময় key:ESC প্রেস করুন।
2424

25-
[demo]
25+
[demo]

0 commit comments

Comments
 (0)