Skip to content

Commit 75a33e3

Browse files
committed
Merge branch 'master' of github.com:javascript-tutorial/ar.javascript.info
2 parents 945781d + 363b06f commit 75a33e3

40 files changed

Lines changed: 683 additions & 682 deletions

File tree

1-js/02-first-steps/09-comparison/1-comparison-questions/solution.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ null == "\n0\n" → false
1010
null === +"\n0\n"false
1111
```
1212

13-
Some of the reasons:
13+
بعض الأسباب:
1414

15-
1. Obviously, true.
16-
2. Dictionary comparison, hence false. `"a"` is smaller than `"p"`.
17-
3. Again, dictionary comparison, first char of `"2"` is greater than the first char of `"1"`.
18-
4. Values `null` and `undefined` equal each other only.
19-
5. Strict equality is strict. Different types from both sides lead to false.
20-
6. Similar to `(4)`, `null` only equals `undefined`.
21-
7. Strict equality of different types.
15+
1. من الواضح ، صحيح.
16+
2. مقارنة القاموس ، وبالتالي خطأ. "" a "أصغر من" "p" ".
17+
3. مرة أخرى ، مقارنة القاموس ، الحرف الأول من "2" أكبر من الحرف الأول من "1".
18+
4. القيم "فارغة" و "غير محددة" تساوي بعضها البعض فقط.
19+
5. المساواة الصارمة صارمة. أنواع مختلفة من كلا الجانبين تؤدي إلى خطأ.
20+
6- على غرار "(4)` ، "فارغ" يساوي فقط "غير محدد".
21+
7. المساواة الصارمة بمختلف أنواعها.

1-js/02-first-steps/09-comparison/1-comparison-questions/task.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
importance: 5
1+
درحة الأهمية: 5
22

33
---
44

5-
# Comparisons
5+
# المقارنات
66

7-
What will be the result for these expressions?
7+
ماذ ستكون نتيجة هذه التعبيرات؟
88

99
```js no-beautify
1010
5 > 4

1-js/02-first-steps/09-comparison/article.md

Lines changed: 87 additions & 86 deletions
Large diffs are not rendered by default.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
The answer is `2`, that's the first truthy value.
1+
الإجابة هي `2` لأنها أول قيمة truthy.
22

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

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
importance: 5
1+
الأهمية: 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 );
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
The answer: first `1`, then `2`.
1+
الإجابة: أولًا `1` ثم `2`.
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 its 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+
1. أول OR `||` تنفذ العملية على يسارها `alert(1)`. وهذا يعرض أول رسالة `1`.
10+
2. إن `alert` ترجع `undefined` لذلك تنتقل OR للعملية الثانية بحثًا عن قيمة truthy.
11+
3. القيمة الثانية `2` هي truthy لذلك يتوقف التنفيذ وترجع `2` ويتم عرضها.
1212

13-
There will be no `3`, because the evaluation does not reach `alert(3)`.
13+
لن يتم عرض `3` لأن التنفيذ لم يصل إلى `alert(3)`.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
importance: 3
1+
الأهمية: 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) );

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

Lines changed: 1 addition & 1 deletion
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` لأنها أول قيمة falsy في القائمة.
22

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

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
importance: 5
1+
الأهمية: 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 );
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
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` (إنها تعرض رسالة لذلك لا يوجد معنى لإرجاع قيمة).
88

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.
9+
وبسبب هذا تقوم `&&` بتنفيذ العملية على اليسار (تعرض `1`) وتتوقف لأن `undefined` تعتبر قيمة falsy. And `&&` تبحث عن قيمة falsy وترجعها.
1010

0 commit comments

Comments
 (0)