-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/TeaByte/NakhlahJS
- Loading branch information
Showing
29 changed files
with
164 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
courses/if-statements/comparison-with-strict-equality-operator.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
courses/if-statements/introducing-else-and-else-if-statements.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: التعريف بي ( else و else if ) | ||
snippet: لا يوجد | ||
snippet: وماذا عندما يكون هذا الشرط خطأ | ||
order: 6 | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"label": "الحلقات", | ||
"lableSlug": "loops", | ||
"order": 14 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
title: العد التنازلي باستخدام حلقة ( for ) | ||
snippet: يمكن أيضًا للحلقة أن تعد بشكل عكسي، طالما أننا نستطيع تحديد الشروط الصحيحة | ||
order: 3 | ||
--- | ||
|
||
يمكن أيضًا للحلقة أن تعد بشكل عكسي، طالما أننا نستطيع تحديد الشروط الصحيحة. | ||
|
||
من أجل إنقاص كل تكرار بمقدار اثنين، سنحتاج إلى تغيير التهيئة والحالة والتعبير | ||
النهائي. | ||
|
||
سنبدأ عند `i = 10` ونكرر الحلقة بينما `i > 0`. سننقص `i` بمقدار `2` في كل حلقة | ||
مع `i -= 2`. | ||
|
||
```js | ||
const ourArray = []; | ||
|
||
for (let i = 10; i > 0; i -= 2) { | ||
ourArray.push(i); | ||
} | ||
|
||
console.log(ourArray); | ||
``` | ||
|
||
سيحتوي `ourArray` الآن على [10، 8، 6، 4، 2]. | ||
|
||
<div class="quiz"> | ||
نعتذر عن عدم وجود اختبار لهذا الدرس حالياً. نحن نعمل بجد لإعداد اختبارات لجميع الدروس وسنقوم بتوفيرها في أقرب وقت ممكن. | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
title: التكرار باستخدام حلقات ( for ) | ||
snippet: يُطلق على النوع الأكثر شيوعًا من الحلقات اسم حلقة for | ||
order: 2 | ||
--- | ||
|
||
يمكنك تشغيل نفس الكود عدة مرات باستخدام حلقة. | ||
|
||
يُطلق على النوع الأكثر شيوعًا من الحلقات اسم حلقة `for` لأنها تعمل لعدد محدد من | ||
المرات. | ||
|
||
يتم الإعلان عن حلقات `for` بثلاثة تعبيرات اختيارية مفصولة بفواصل منقوطة (`;`). | ||
|
||
`for (a; b; c)`، حيث `a` هو بيان التهيئة، و `b` هو بيان الشرط، و `c` هو التعبير | ||
النهائي. | ||
|
||
يتم تنفيذ عبارة التهيئة مرة واحدة فقط قبل بدء الحلقة. يتم استخدامه عادةً لتحديد | ||
وإعداد متغير الحلقة الخاص بك. | ||
|
||
يتم تقييم بيان الشرط في بداية كل تكرار للحلقة وسيستمر طالما تم تقييمه على أنه | ||
صحيح. عندما يكون الشرط خاطئًا في بداية التكرار، ستتوقف الحلقة عن التنفيذ. هذا | ||
يعني أنه إذا بدأ الشرط كخطأ، فلن يتم تنفيذ حلقتك أبدًا. | ||
|
||
يتم تنفيذ التعبير النهائي في نهاية كل تكرار للحلقة، قبل التحقق من الشرط ويستخدم | ||
عادةً لزيادة أو تقليل عداد الحلقة. | ||
|
||
في المثال التالي، قمنا بالتهيئة بـ `i = 0` ثم قمنا بالتكرار بينما يكون الشرط | ||
`i < 5` صحيحًا. سنقوم بزيادة `i` بمقدار `1` في كل تكرار للحلقة باستخدام `i++` | ||
كتعبير نهائي. | ||
|
||
```js | ||
const ourArray = []; | ||
|
||
for (let i = 0; i < 5; i++) { | ||
ourArray.push(i); | ||
} | ||
|
||
console.log(ourArray); | ||
``` | ||
|
||
سيكون لـ `ourArray` الآن القيمة [0, 1, 2, 3, 4]. | ||
|
||
## تكرار الأرقام الزوجية باستخدام حلقة ( for ) | ||
|
||
ليس من الضروري تكرار الحلقات واحدة تلو الأخرى. ومن خلال تغيير التعبير النهائي، | ||
يمكننا العد بالأرقام الزوجية. | ||
|
||
سنبدأ عند `i = 0` ونكرر الحلقة بينما `i < 10`. سنزيد `i` بمقدار `2` في كل حلقة | ||
باستخدام `i += 2`. | ||
|
||
```js | ||
const ourArray = []; | ||
|
||
for (let i = 0; i < 10; i += 2) { | ||
ourArray.push(i); | ||
} | ||
|
||
console.log(ourArray); | ||
``` | ||
|
||
سيحتوي `ourArray` الآن على [0، 2، 4، 6، 8]. | ||
|
||
<!-- الكويز يكون عمل مصمفوفه ارقام فرديه --> | ||
<div class="quiz"> | ||
نعتذر عن عدم وجود اختبار لهذا الدرس حالياً. نحن نعمل بجد لإعداد اختبارات لجميع الدروس وسنقوم بتوفيرها في أقرب وقت ممكن. | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
title: التكرار باستخدام حلقات ( while ) | ||
snippet: يمكنك تشغيل نفس الكود عدة مرات باستخدام حلقة | ||
order: 1 | ||
--- | ||
|
||
يمكنك تشغيل نفس الكود عدة مرات باستخدام حلقة. | ||
|
||
النوع الأول من الحلقات التي سنتعلمها يسمى حلقة `while` تعمل عندما يكون الشرط | ||
المحدد صحيحًا ويتوقف عندما يصبح الشرط غير صحيح. | ||
|
||
```js | ||
const ourArray = []; | ||
let i = 0; | ||
|
||
while (i < 5) { | ||
ourArray.push(i); | ||
i++; | ||
} | ||
|
||
console.log(ourArray); | ||
``` | ||
|
||
في مثال السابق سيتم تنفيذ حلقة `while` 5 مرات وإلحاق الأرقام من 0 إلى 4 إلى | ||
`ourArray`. | ||
|
||
<div class="quiz"> | ||
نعتذر عن عدم وجود اختبار لهذا الدرس حالياً. نحن نعمل بجد لإعداد اختبارات لجميع الدروس وسنقوم بتوفيرها في أقرب وقت ممكن. | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters