Skip to content

Commit 730b2f6

Browse files
authored
Merge pull request #18 from Salah856/master
translate operators into arabic
2 parents 363b06f + c82a342 commit 730b2f6

File tree

9 files changed

+175
-168
lines changed

9 files changed

+175
-168
lines changed

1-js/02-first-steps/08-operators/1-increment-order/solution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
The answer is:
2+
الإجابة هي:
33

44
- `a = 2`
55
- `b = 2`

1-js/02-first-steps/08-operators/1-increment-order/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-
# The postfix and prefix forms
5+
# نماذج postfix والبادئة
66

7-
What are the final values of all variables `a`, `b`, `c` and `d` after the code below?
7+
ما هي القيم النهائية لجميع المتغيرات `a` و` b` و` c` و` d` بعد الكود أدناه؟
88

99
```js
1010
let a = 1, b = 1;

1-js/02-first-steps/08-operators/2-assignment-result/solution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
The answer is:
1+
الإجابة هي:
22

33
- `a = 4` (multiplied by 2)
44
- `x = 5` (calculated as 1 + 4)

1-js/02-first-steps/08-operators/2-assignment-result/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-
# Assignment result
5+
# نتيجة التعيين
66

7-
What are the values of `a` and `x` after the code below?
7+
ما هي قيم `a` و` x` بعد الكود أدناه؟
88

99
```js
1010
let a = 2;

1-js/02-first-steps/08-operators/3-primitive-conversions-questions/solution.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ undefined + 1 = NaN // (6)
1717
" \t \n" - 2 = -2 // (7)
1818
```
1919

20-
1. The addition with a string `"" + 1` converts `1` to a string: `"" + 1 = "1"`, and then we have `"1" + 0`, the same rule is applied.
21-
2. The subtraction `-` (like most math operations) only works with numbers, it converts an empty string `""` to `0`.
22-
3. The addition with a string appends the number `5` to the string.
23-
4. The subtraction always converts to numbers, so it makes `" -9 "` a number `-9` (ignoring spaces around it).
24-
5. `null` becomes `0` after the numeric conversion.
25-
6. `undefined` becomes `NaN` after the numeric conversion.
26-
7. Space characters, are trimmed off string start and end when a string is converted to a number. Here the whole string consists of space characters, such as `\t`, `\n` and a "regular" space between them. So, similarly to an empty string, it becomes `0`.
20+
1. الإضافة بسلسلة "" + 1` تحول `1` إلى سلسلة:` "" + 1 = "1" `، وبعد ذلك لدينا" 1 "+ 0` ، يتم تطبيق نفس القاعدة.
21+
2. يعمل الطرح `-` (مثل معظم عمليات الرياضيات) مع الأرقام فقط ، فهو يحول سلسلة فارغة" "" إلى "0".
22+
3. الإضافة بسلسلة تلحق الرقم `5` بالسلسلة.
23+
4. يتحول الطرح دائمًا إلى أرقام ، لذلك يجعل "-9" `رقمًا -9` (تجاهل المسافات حوله).
24+
5. يصبح "null" "0" بعد التحويل الرقمي.
25+
6. يصبح "غير معرّف" "NaN" بعد التحويل الرقمي.
26+
7. يتم قطع أحرف المسافة من بداية السلسلة ونهايتها عند تحويل سلسلة إلى رقم. تتكون السلسلة بأكملها هنا من أحرف مسافة ، مثل `\ t` و` \ n` ومسافة "عادية" بينهما. لذا ، على غرار السلسلة الفارغة ، تصبح `0`.

1-js/02-first-steps/08-operators/3-primitive-conversions-questions/task.md

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

33
---
44

5-
# Type conversions
5+
# اكتب التحويلات
66

7-
What are results of these expressions?
7+
ما هي نتائج هذه التعبيرات؟
88

99
```js no-beautify
1010
"" + 1 + 0
@@ -24,4 +24,4 @@ undefined + 1
2424
" \t \n" - 2
2525
```
2626

27-
Think well, write down and then compare with the answer.
27+
فكر جيدًا ، واكتب ثم قارن مع الإجابة.
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
The reason is that prompt returns user input as a string.
2-
3-
So variables have values `"1"` and `"2"` respectively.
1+
السبب هو أن موجه إرجاع إدخال المستخدم كسلسلة.
42

3+
حتى المتغيرات لها قيم "1" و "2" على التوالي.
54
```js run
65
let a = "1"; // prompt("First number?", 1);
76
let b = "2"; // prompt("Second number?", 2);
87

98
alert(a + b); // 12
109
```
1110

12-
What we should to is to convert strings to numbers before `+`. For example, using `Number()` or prepending them with `+`.
11+
ما يجب علينا فعله هو تحويل السلاسل إلى أرقام قبل `+`. على سبيل المثال ، استخدام `Number ()` أو إلحاقها بـ `+`.
1312

14-
For example, right before `prompt`:
13+
على سبيل المثال ، قبل "prompt" مباشرةً:
1514

1615
```js run
1716
let a = +prompt("First number?", 1);
@@ -20,7 +19,7 @@ let b = +prompt("Second number?", 2);
2019
alert(a + b); // 3
2120
```
2221

23-
Or in the `alert`:
22+
أو في `alert`:
2423

2524
```js run
2625
let a = prompt("First number?", 1);
@@ -29,4 +28,4 @@ let b = prompt("Second number?", 2);
2928
alert(+a + +b); // 3
3029
```
3130

32-
Using both unary and binary `+` in the latest code. Looks funny, doesn't it?
31+
استخدام كل من `+` أحادي وثنائي `في آخر كود. يبدو مضحك ، أليس كذلك؟

1-js/02-first-steps/08-operators/4-fix-prompt/task.md

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

33
---
44

5-
# Fix the addition
5+
# إصلاح الإضافة
66

7-
Here's a code that asks the user for two numbers and shows their sum.
7+
إليك رمز يطلب من المستخدم رقمين ويظهر مجموعهم.
88

9-
It works incorrectly. The output in the example below is `12` (for default prompt values).
9+
يعمل بشكل غير صحيح. الإخراج في المثال أدناه هو `12` (لقيم المطالبة الافتراضية).
1010

11-
Why? Fix it. The result should be `3`.
11+
لماذا ا؟ اصلحه. يجب أن تكون النتيجة `3`.
1212

1313
```js run
1414
let a = prompt("First number?", 1);

0 commit comments

Comments
 (0)