Skip to content

Commit b59a482

Browse files
authored
Merge pull request #9 from AhmedIbrahimGalal/variables
tasks in variables section
2 parents 1bf6480 + 1558297 commit b59a482

7 files changed

Lines changed: 30 additions & 30 deletions

File tree

1-js/02-first-steps/04-variables/1-hello-variables/solution.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
In the code below, each line corresponds to the item in the task list.
1+
في الكود أدناه ، يتوافق كل سطر مع العنصر في قائمة المهام.
22

33
```js run
4-
let admin, name; // can declare two variables at once
4+
let admin, name; // نستطيع تعريف متغيريين في خطوة واحده
55

66
name = "John";
77

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
importance: 2
1+
مهم: 2
22

33
---
44

5-
# Working with variables
5+
# العمل مع المتغيرات
66

7-
1. Declare two variables: `admin` and `name`.
8-
2. Assign the value `"John"` to `name`.
9-
3. Copy the value from `name` to `admin`.
10-
4. Show the value of `admin` using `alert` (must output "John").
7+
1. قم بتعريف متغيريين: `admin` و `name`.
8+
2. ضع القيمة `"John"` الى `name`.
9+
3. أنسخ القيمة من `name` الي `admin`.
10+
4. أعرض قيمة `admin` بأستخدام `alert` (يجب أن تكون "John").
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
## The variable for our planet
1+
## المتغير لكوكبنا
22

3-
That's simple:
3+
ذلك بسيط:
44

55
```js
66
let ourPlanetName = "Earth";
77
```
88

9-
Note, we could use a shorter name `planet`, but it might be not obvious what planet it refers to. It's nice to be more verbose. At least until the variable isNotTooLong.
9+
ملاحظة, نحن نستطيع كتابة أسم قصير مثل `planet`, ولكن قد لا يكون واضحًا ما يشير إليه الكوكب. من الجيد أن تكون أكثر تطولًا. علي الاقل يكون اسم المتغير ليس طويل للغاية.
1010

11-
## The name of the current visitor
11+
## أسم الزائر الحالي
1212

1313
```js
1414
let currentUserName = "John";
1515
```
1616

17-
Again, we could shorten that to `userName` if we know for sure that the user is current.
17+
للمرة الثانية, نحن نستطيع كتابة `userName` أذا كنا نعلم من يكون المستخدم الحالي.
1818

19-
Modern editors and autocomplete make long variable names easy to write. Don't save on them. A name with 3 words in it is fine.
19+
المحررات الحديثة والاكمال الذاتي تنشئ اسماء متغيرات طويلة وسهلة للكتابة. لا تحفظها. الاسم الذي يتكون من ثلاث كلمات يكون جيد.
2020

21-
And if your editor does not have proper autocompletion, get [a new one](/code-editors).
21+
وأذا كان المحرر الخاص بك لا يحتوي علي خاصية الاكمال الذاتي, يمكنك الحصول عليه [واحدة جديده](/code-editors).
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
importance: 3
1+
مهم: 3
22

33
---
44

5-
# Giving the right name
5+
# كتابة الأسم بشكل صحيح
66

7-
1. Create a variable with the name of our planet. How would you name such a variable?
8-
2. Create a variable to store the name of a current visitor to a website. How would you name that variable?
7+
1. إنشاء متغير باسم كوكبنا. كيف تسمي مثل هذا المتغير؟
8+
2. أنشئ متغيرًا لتخزين اسم الزائر الحالي لموقع الويب. كيف يمكنك تسمية هذا المتغير؟
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
We generally use upper case for constants that are "hard-coded". Or, in other words, when the value is known prior to execution and directly written into the code.
1+
نستخدم بشكل عام الأحرف الكبيرة للثوابت "ذات الترميز الصلب". أو بمعنى آخر ، عندما تكون القيمة معروفة قبل التنفيذ ومكتوبة مباشرة في الشفرة.
22

3-
In this code, `birthday` is exactly like that. So we could use the upper case for it.
3+
في هذا الكود, `birthday` هو بالضبط مثل ذلك. حتى نتمكن من استخدام الحروف الكبيرة لذلك.
44

5-
In contrast, `age` is evaluated in run-time. Today we have one age, a year after we'll have another one. It is constant in a sense that it does not change through the code execution. But it is a bit "less of a constant" than `birthday`: it is calculated, so we should keep the lower case for it.
5+
في المقابل, `age` يتم حسابة في وقت التشغيل. اليوم نحن نمتلك عمر, بعد عام من حصولنا على واحدة أخرى. إنه ثابت بمعنى أنه لا يتغير من خلال تنفيذ التعليمات البرمجية. لكنها أقل قليلا من الثابت `birthday`: انه محسوب, لذلك يجب علينا العمل بالحروف الصغيرة.
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
importance: 4
1+
مهم: 4
22

33
---
44

5-
# Uppercase const?
5+
# الثابت ذات الحرف الكبيره؟
66

7-
Examine the following code:
7+
أفحص الكود التالي:
88

99
```js
1010
const birthday = '18.04.1982';
1111

1212
const age = someCode(birthday);
1313
```
1414

15-
Here we have a constant `birthday` date and the `age` is calculated from `birthday` with the help of some code (it is not provided for shortness, and because details don't matter here).
15+
هنا نحن نمتلك ثابت يحزن قيمة التاريخ `birthday` و ثابت أخر يسمي `age` يحسب قيمة العمر من الثابت `birthday` مع مساعدة الداله بعض الكود (لم يتم توفيرها لتصغيرها ، ولأن التفاصيل لا تهم هنا)
1616

17-
Would it be right to use upper case for `birthday`? For `age`? Or even for both?
17+
هل من الصحيح أستخدام الحروف الكبيره للثابت `birthday` ؟ او للثابت `age`؟ او حتي لكليهما؟
1818

1919
```js
20-
const BIRTHDAY = '18.04.1982'; // make uppercase?
20+
const BIRTHDAY = '18.04.1982'; // هل نجعل الاسم ذات حروف كبيره؟
2121

22-
const AGE = someCode(BIRTHDAY); // make uppercase?
22+
const AGE = someCode(BIRTHDAY); // هل نجعل الاسم ذات حروف كبيره؟
2323
```
2424

1-js/02-first-steps/04-variables/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ const pageLoadTime = /* الوقت اللازم لتحضير صفحة الويب
287287
288288
بمعنى آخر ، تُستخدم الثوابت التي تحمل أسماء كبيرة فقط كأسماء مستعارة لقيم "الثابت الترميز".
289289
290-
## تسمية الاشياء صح
290+
## تسمية الاشياء بشكل صحيح
291291
292292
الحديث حول المتغيرات, هناك شئ أخر مهم للغاية.
293293

0 commit comments

Comments
 (0)