diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/add-a-text-alternative-to-images-for-visually-impaired-accessibility.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/add-a-text-alternative-to-images-for-visually-impaired-accessibility.arabic.md new file mode 100644 index 0000000000..0ece012a98 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/add-a-text-alternative-to-images-for-visually-impaired-accessibility.arabic.md @@ -0,0 +1,50 @@ +--- +id: 587d774c367417b2b2512a9c +title: Add a Text Alternative to Images for Visually Impaired Accessibility +challengeType: 0 +videoUrl: '' +guideUrl: 'https://arabic.freecodecamp.org/guide/certificates/add-alt-text-to-an-image-for-accessibility' +localeTitle: إضافة بديل نص إلى الصور لإعاقة الوصول بصريًا +--- + +## Description +
من المحتمل أنك رأيت سمة alt على علامة img في تحديات أخرى. يصف النص Alt محتوى الصورة ويوفر بديلًا نصيًا. يساعد ذلك في حالة فشل تحميل أو عدم تمكن المستخدم من رؤية الصورة. ويستخدم أيضًا من قِبل محركات البحث لفهم ما تحتويه الصورة لتضمينها في نتائج البحث. في ما يلي مثال: <img src="importantLogo.jpeg" alt="Company logo"> يعتمد الأشخاص الذين يعانون من إعاقات بصرية على قارئي الشاشة لتحويل محتوى الويب إلى واجهة صوتية. لن يحصلوا على المعلومات إذا تم تقديمها فقط بصريًا. بالنسبة للصور ، يمكن لقارئي الشاشة الوصول إلى سمة alt وقراءة محتوياتها لتقديم المعلومات الأساسية. النص alt الجيد قصير ولكن وصفي ، ويقصد به أن ينقل بإيجاز معنى الصورة. يجب عليك دائمًا تضمين سمة alt على صورتك. وفقًا لمواصفات HTML5 ، يعتبر هذا الآن إلزاميًا.
+ +## Instructions +
كامبر كات هو عبارة عن نينجا مشفر ونينجا فعليين ، ويقوم ببناء موقع ويب لتبادل معرفته. تظهر صورة الملف الشخصي التي يريد استخدامها مهاراته ، ويجب أن تحظى بتقدير جميع زائري الموقع. إضافة سمة alt في علامة img ، التي تشرح كامبر كات تقوم بالكاراتيه. (لا ترتبط الصورة src بملف فعلي ، لذلك يجب أن ترى النص alt في الشاشة.)
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تحتوي علامة img سمة alt ، ويجب ألا تكون فارغة. + testString: 'assert($("img").attr("alt"), "Your img tag should have an alt attribute, and it should not be empty.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/add-an-accessible-date-picker.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/add-an-accessible-date-picker.arabic.md new file mode 100644 index 0000000000..6f2ec516f9 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/add-an-accessible-date-picker.arabic.md @@ -0,0 +1,77 @@ +--- +id: 587d778b367417b2b2512aa8 +title: Add an Accessible Date Picker +challengeType: 0 +videoUrl: '' +localeTitle: إضافة منتقي تاريخ يسهل الوصول إليه +--- + +## Description +
غالبًا ما تتضمن النماذج حقل input ، والذي يمكن استخدامه لإنشاء عدة عناصر تحكم مختلفة في النموذج. تشير السمة type على هذا العنصر إلى نوع الإدخال الذي سيتم إنشاؤه. كنت قد لاحظت في text و submit أنواع المدخلات في التحديات السابقة، وعرض HTML5 خيار لتحديد date المجال. اعتمادًا على دعم المتصفح ، يظهر منتقي التاريخ في حقل input عندما يكون في التركيز ، مما يجعل ملء النموذج أكثر سهولة لجميع المستخدمين. بالنسبة إلى المتصفحات الأقدم ، سيكون text افتراضيًا text ، لذلك يساعد على إظهار تنسيق التاريخ المتوقع للمستخدمين في التصنيف أو كنص موضع مؤقت في حالة الأحرف فقط. إليك مثال على ذلك:
<label for = "input1"> أدخل تاريخًا: </ label>
<input type = "date" id = "input1" name = "input1">
+ +## Instructions +
يقوم كامبر كات بإعداد بطولة مورتال كومبات ويريد أن يطلب من منافسيه معرفة التاريخ الأفضل. إضافة علامة input تحتوي على سمة type من "date" ، وسمة id من "pickdate" ، وسمة name من "date".
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تضيف الكود الخاص بك علامة input واحدة لحقل محدد التاريخ. + testString: 'assert($("input").length == 2, "Your code should add one input tag for the date selector field.");' + - text: يجب أن تحتوي علامة input سمة type بقيمة تاريخ. + testString: 'assert($("input").attr("type") == "date", "Your input tag should have a type attribute with a value of date.");' + - text: يجب أن تحتوي علامة input الخاصة بك على سمة id بقيمة اختيار. + testString: 'assert($("input").attr("id") == "pickdate", "Your input tag should have an id attribute with a value of pickdate.");' + - text: يجب أن تحتوي علامة input سمة name لها قيمة التاريخ. + testString: 'assert($("input").attr("name") == "date", "Your input tag should have a name attribute with a value of date.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+

Tournaments

+
+
+
+

Mortal Kombat Tournament Survey

+
+

Tell us the best date for the competition

+ + + + + + + + + +
+
+
+ + + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/avoid-colorblindness-issues-by-carefully-choosing-colors-that-convey-information.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/avoid-colorblindness-issues-by-carefully-choosing-colors-that-convey-information.arabic.md new file mode 100644 index 0000000000..eba762f004 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/avoid-colorblindness-issues-by-carefully-choosing-colors-that-convey-information.arabic.md @@ -0,0 +1,64 @@ +--- +id: 587d778f367417b2b2512aad +title: Avoid Colorblindness Issues by Carefully Choosing Colors that Convey Information +challengeType: 0 +videoUrl: '' +localeTitle: تجنب مشاكل Colorblindness عن طريق اختيار الألوان التي نقل المعلومات بعناية +--- + +## Description +
هناك أشكال مختلفة من عمى الألوان. يمكن أن تتراوح هذه من حساسية منخفضة إلى طول موجة معين من الضوء إلى عدم القدرة على رؤية اللون على الإطلاق. الشكل الأكثر شيوعًا هو الحساسية المنخفضة للكشف عن الخضر. على سبيل المثال ، إذا كان لونان أخضران مشابهان هما لون المقدمة والخلفية للمحتوى الخاص بك ، فقد لا يتمكن مستخدم colorblind من تمييزها. يمكن اعتبار الألوان القريبة كجيران على عجلة الألوان ، ويجب تجنب هذه المجموعات عند نقل معلومات مهمة. ملحوظة
تشتمل بعض أدوات اختيار الألوان عبر الإنترنت على محاكاة بصرية لكيفية ظهور الألوان لأنواع مختلفة من عمى الألوان. هذه موارد رائعة بالإضافة إلى الآلات الحاسبة لفحص التباين عبر الإنترنت.
+ +## Instructions +
العربة القط هو اختبار الأساليب المختلفة لزر مهم، ولكن الأصفر ( #FFFF33 ) background-color والأخضر ( #33FF33 ) النص color والأشكال على عجلة الألوان ويمكن تمييزها تقريبا لبعض المستخدمين colorblind المجاورة. (الخفوت مماثلة أيضا فشل في فحص نسبة التباين). غيّر color النص إلى اللون الأزرق الداكن ( #003366 ) لحل كلا المشكلتين.
+ +## Tests +
+ +```yml +tests: + - text: يجب تغيير التعليمات البرمجية الخاصة بك color النص button إلى الأزرق الداكن. + testString: 'assert($("button").css("color") == "rgb(0, 51, 102)", "Your code should change the text color for the button to the dark blue.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + + + +
+

Danger!

+
+ + + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/avoid-colorblindness-issues-by-using-sufficient-contrast.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/avoid-colorblindness-issues-by-using-sufficient-contrast.arabic.md new file mode 100644 index 0000000000..74bd6defc0 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/avoid-colorblindness-issues-by-using-sufficient-contrast.arabic.md @@ -0,0 +1,68 @@ +--- +id: 587d778f367417b2b2512aac +title: Avoid Colorblindness Issues by Using Sufficient Contrast +challengeType: 0 +videoUrl: '' +localeTitle: تجنب مشكلات Colorblindness عن طريق استخدام التباين الكافي +--- + +## Description +
يمثل اللون جزءًا كبيرًا من التصميم المرئي ، ولكن استخدامه يقدم مشكلتي إمكانية الوصول. أولاً ، لا ينبغي استخدام اللون وحده باعتباره الطريقة الوحيدة لنقل المعلومات المهمة لأن مستخدمي قارئ الشاشة لن ​​يراها. ثانيًا ، تحتاج ألوان المقدمة والخلفية إلى تباين كافٍ بحيث يمكن لمستخدمي colorblind التمييز بينها. غطت التحديات السابقة وجود بدائل نصية لمعالجة القضية الأولى. أظهر التحدي الأخير أدوات فحص التباين للمساعدة في الثانية. تنطبق نسبة التباين الموصى بها لـ WCAG والتي تبلغ 4.5: 1 على استخدام الألوان بالإضافة إلى مجموعات المقاييس الرمادية. يواجه مستخدمو Colorblind صعوبة في تمييز بعض الألوان عن الآخرين - عادةً ما تكون في اللون ، ولكن في بعض الأحيان خفيفة. يمكنك تذكر أن نسبة التباين يتم حسابها باستخدام قيم النصوع النسبي (أو الإضاءة) لألوان المقدمة والخلفية. من الناحية العملية ، يمكن الوصول إلى نسبة 4.5: 1 عن طريق جعل اللون الداكن أكثر قتامة وإضاءة اللون الأخف بمساعدة أداة فحص الألوان. تعتبر الألوان الداكنة على عجلة الألوان من الألوان الزرقاء والبنفسجية والمغناطيسية والأحمر ، في حين أن الألوان الفاتحة هي البرتقال والأصفر والأخضر والأزرق.
+ +## Instructions +
يجرّب Camper Cat استخدام اللون لنص المدونة وخلفيته ، لكن مجموعته الحالية من background-color الأخضر مع color النص الماروني له نسبة تباين تبلغ 2.5: 1. يمكنك بسهولة ضبط خفة الألوان منذ أن أعلنها باستخدام خاصية CSS hsl() (والتي تعني التوهج والتشبع والخفة) عن طريق تغيير الوسيطة الثالثة. قم بزيادة قيمة خفة background-color في background-color من 35٪ إلى 55٪ ، وخفض قيمة خفة color من 20٪ إلى 15٪. هذا يحسن التباين إلى 5.9: 1.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تقوم التعليمات البرمجية بتغيير قيمة الإضاءة فقط لخاصية color النص إلى قيمة 15٪. + testString: 'assert(code.match(/color:\s*?hsl\(0,\s*?55%,\s*?15%\)/gi), "Your code should only change the lightness value for the text color property to a value of 15%.");' + - text: يجب أن تقوم التعليمات البرمجية بتغيير قيمة الإضاءة فقط لخاصية background-color إلى قيمة 55٪. + testString: 'assert(code.match(/background-color:\s*?hsl\(120,\s*?25%,\s*?55%\)/gi), "Your code should only change the lightness value for the background-color property to a value of 55%.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + + + +
+

Deep Thoughts with Master Camper Cat

+
+
+

A Word on the Recent Catnip Doping Scandal

+

The influence that catnip has on feline behavior is well-documented, and its use as an herbal supplement in competitive ninja circles remains controversial. Once again, the debate to ban the substance is brought to the public's attention after the high-profile win of Kittytron, a long-time proponent and user of the green stuff, at the Claw of Fury tournament.

+

As I've stated in the past, I firmly believe a true ninja's skills must come from within, with no external influences. My own catnip use shall continue as purely recreational.

+
+ + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/give-links-meaning-by-using-descriptive-link-text.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/give-links-meaning-by-using-descriptive-link-text.arabic.md new file mode 100644 index 0000000000..3073852c16 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/give-links-meaning-by-using-descriptive-link-text.arabic.md @@ -0,0 +1,59 @@ +--- +id: 587d778f367417b2b2512aae +title: Give Links Meaning by Using Descriptive Link Text +challengeType: 0 +videoUrl: '' +localeTitle: إعطاء الارتباطات المعنوية باستخدام نص الوصلة الوصفية +--- + +## Description +
يتوفر لدى مستخدمي قارئ الشاشة خيارات مختلفة لنوع المحتوى الذي يقرأه جهازهم. ويشمل ذلك تخطي (أو) عناصر المعالم ، أو القفز إلى المحتوى الرئيسي ، أو الحصول على ملخص للصفحة من العناوين. خيار آخر هو فقط سماع الروابط المتاحة على الصفحة. تقوم قارئات الشاشة بذلك عن طريق قراءة نص الرابط ، أو ما بين علامات الربط ( a ). إن وجود قائمة من الروابط "انقر هنا" أو "اقرأ المزيد" ليس مفيدًا. بدلا من ذلك، يجب عليك استخدام النص وجيزة ولكن وصفي داخل a العلامات إلى توفير المزيد من معنى لهؤلاء المستخدمين.
+ +## Instructions +
نص الارتباط الذي يستخدمه Camper Cat ليس وصفيًا للغاية بدون السياق المحيط. قم بتحريك علامة الربط ( a ) بحيث يتم التفاف حول النص "معلومات حول البطاريات" بدلاً من "انقر هنا".
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تتحرك الشفرة مرساة a العلامات من حول عبارة "اضغط هنا" للالتفاف حول عبارة "معلومات حول بطاريات". + testString: 'assert($("a").text().match(/^(information about batteries)$/g), "Your code should move the anchor a tags from around the words "Click here" to wrap around the words "information about batteries".");' + - text: تأكد من a عنصر يحتوي على علامة إغلاق. + testString: 'assert(code.match(/<\/a>/g) && code.match(/<\/a>/g).length === code.match(//g).length, "Make sure your a element has a closing tag.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+

Deep Thoughts with Master Camper Cat

+
+
+ + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/improve-accessibility-of-audio-content-with-the-audio-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/improve-accessibility-of-audio-content-with-the-audio-element.arabic.md new file mode 100644 index 0000000000..5cd7acb93f --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/improve-accessibility-of-audio-content-with-the-audio-element.arabic.md @@ -0,0 +1,71 @@ +--- +id: 587d7789367417b2b2512aa4 +title: Improve Accessibility of Audio Content with the audio Element +challengeType: 0 +videoUrl: '' +localeTitle: تحسين إمكانية الوصول إلى المحتوى الصوتي باستخدام عنصر الصوت +--- + +## Description +
يمنح عنصر HTML5 audio معنىً دلاليًا عندما يلف محتوى دفق الصوت أو الصوت في الترميز. يحتاج المحتوى الصوتي أيضًا إلى بديل نصي ليكون متاحًا للأشخاص الصم أو ضعاف السمع. يمكن إجراء ذلك باستخدام نص مجاور على الصفحة أو رابط إلى نص. تدعم علامة audio سمة controls . يعرض هذا التشغيل الافتراضي للمتصفح والإيقاف المؤقت وعناصر التحكم الأخرى ، ويدعم وظيفة لوحة المفاتيح. هذه سمة منطقية ، بمعنى أنها لا تحتاج إلى قيمة ، حيث يؤدي وجودها على العلامة إلى تشغيل الإعداد. إليك مثال على ذلك:
<audio id = "meowClip" controls>
<source src = "audio / meow.mp3" type = "audio / mpeg" />
<source src = "audio / meow.ogg" type = "audio / ogg" />
</ الصوت>
ملحوظة
عادةً ما يحتوي محتوى الوسائط المتعددة على مكونات مرئية وسمعية. يحتاج إلى تسميات توضيحية متزامنة وملف نصي حتى يتمكن المستخدمون الذين يعانون من إعاقات بصرية و / أو سمعية من الوصول إليه. بشكل عام ، لا يتحمل مطور الويب مسؤولية إنشاء التسميات التوضيحية أو النص ، ولكن يجب أن يعرف كيفية تضمينها.
+ +## Instructions +
حان الوقت للاستراحة من Camper Cat ومقابلة زميل Zperiax (zersiax) ، وهو بطل إمكانية الوصول ومستخدم قارئ الشاشة. للاستماع إلى مقطع قارئ الشاشة الخاص به أثناء العمل ، أضف عنصرًا audio بعد p . قم بتضمين سمة controls . ثم ضع علامة source داخل علامات audio مع تعيين سمة src إلى "https://s3.amazonaws.com/freecodecamp/screen-reader.mp3" type تعيين السمة على "audio / mpeg". ملحوظة
قد يبدو المقطع الصوتي سريعًا ويصعب فهمه ، ولكن هذه سرعة عادية لمستخدمي قارئ الشاشة.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تحتوي شفرتك على علامة audio واحدة. + testString: 'assert($("audio").length === 1, "Your code should have one audio tag.");' + - text: تأكد من أن عنصر audio الخاص بك يحتوي على علامة إغلاق. + testString: 'assert(code.match(/<\/audio>/g).length === 1 && code.match(/[\s\S]*<\/audio>/g), "Make sure your audio element has a closing tag.");' + - text: يجب أن تحتوي علامة audio سمة controls . + testString: 'assert($("audio").attr("controls"), "The audio tag should have the controls attribute.");' + - text: يجب أن تحتوي الشفرة على علامة source واحدة. + testString: 'assert($("source").length === 1, "Your code should have one source tag.");' + - text: يجب أن تكون علامة source الخاصة بك داخل علامات audio . + testString: 'assert($("audio").children("source").length === 1, "Your source tag should be inside the audio tags.");' + - text: يجب أن تتطابق قيمة السمة src على العلامة source مع الارتباط الموجود في الإرشادات بالضبط. + testString: 'assert($("source").attr("src") === "https://s3.amazonaws.com/freecodecamp/screen-reader.mp3", "The value for the src attribute on the source tag should match the link in the instructions exactly.");' + - text: يجب أن تحتوي شفرتك على سمة type على العلامة source بقيمة صوت / mpeg. + testString: 'assert($("source").attr("type") === "audio/mpeg", "Your code should include a type attribute on the source tag with a value of audio/mpeg.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+

Real Coding Ninjas

+
+
+

A sound clip of Zersiax's screen reader in action.

+ + + +
+ + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/improve-chart-accessibility-with-the-figure-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/improve-chart-accessibility-with-the-figure-element.arabic.md new file mode 100644 index 0000000000..1636e38f0c --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/improve-chart-accessibility-with-the-figure-element.arabic.md @@ -0,0 +1,99 @@ +--- +id: 587d778a367417b2b2512aa5 +title: Improve Chart Accessibility with the figure Element +challengeType: 0 +videoUrl: '' +localeTitle: تحسين إمكانية الوصول المخطط مع عنصر الشكل +--- + +## Description +
قدم HTML5 عنصر figure ، جنبا إلى جنب مع figcaption ذات الصلة. تستخدم هذه العناصر معًا لتمثيل عرض مرئي (مثل صورة أو مخطط أو مخطط) مع التسمية التوضيحية. ويعطي هذا دفعة من إمكانية الوصول ذات شقين عن طريق كل من المحتوى ذي الصلة من حيث تجميع المحتوى ، وتقديم بديل نصي يشرح figure . بالنسبة إلى عمليات التمثيل البصري للبيانات مثل المخططات ، يمكن استخدام التسمية التوضيحية للإحاطة علما بالاتجاهات أو الاستنتاجات للمستخدمين الذين يعانون من إعاقات بصرية. ويغطي تحد آخر كيفية نقل إصدار جدول من البيانات خارج الشاشة (باستخدام CSS) لمستخدمي قارئ الشاشة. في ما يلي مثال - لاحظ أن figcaption داخل علامات figure ويمكن دمجه مع عناصر أخرى:
<الرقم>
<img src = "roundhouseDestruction.jpeg" alt = "Photo of Camper Cat executing a roundhouse kick">
<BR>
<figcaption>
يوضح سيد كامبر القط شكل مناسب للركلة المستديرة.
</ figcaption>
</ الرقم>
+ +## Instructions +
تعمل لعبة Camper Cat بجد لإنشاء مخطط شريطي مكدّس يعرض مقدار الوقت في الأسبوع لإنفاق التدريب على التسلل والمكافحة والأسلحة. ساعده في تنظيم صفحته بشكل أفضل عن طريق تغيير علامة div التي استخدمها في علامة figure ، والعلامة p التي تحيط figcaption التوضيحية إلى علامة figcaption .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يحتوي figure علامة figure واحدة. + testString: 'assert($("figure").length == 1, "Your code should have one figure tag.");' + - text: يجب أن تحتوي figcaption علامة figcaption واحدة. + testString: 'assert($("figcaption").length == 1, "Your code should have one figcaption tag.");' + - text: يجب ألا تحتوي شفرتك على أي علامات div . + testString: 'assert($("div").length == 0, "Your code should not have any div tags.");' + - text: يجب ألا تحتوي شفرتك على أي علامات p . + testString: 'assert($("p").length == 0, "Your code should not have any p tags.");' + - text: يجب أن يكون figcaption طفل علامة figure . + testString: 'assert($("figure").children("figcaption").length == 1, "The figcaption should be a child of the figure tag.");' + - text: تأكد من أن عنصر figure الخاص بك به علامة إغلاق. + testString: 'assert(code.match(/<\/figure>/g) && code.match(/<\/figure>/g).length === code.match(/
/g).length, "Make sure your figure element has a closing tag.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+

Training

+ +
+
+
+ + +
+ +
+

Breakdown per week of time to spend training in stealth, combat, and weapons.

+
+ + +
+
+

Stealth & Agility Training

+

Climb foliage quickly using a minimum spanning tree approach

+

No training is NP-complete without parkour

+
+
+

Combat Training

+

Dispatch multiple enemies with multithreaded tactics

+

Goodbye world: 5 proven ways to knock out an opponent

+
+
+

Weapons Training

+

Swords: the best tool to literally divide and conquer

+

Breadth-first or depth-first in multi-weapon training?

+
+
+ + + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/improve-form-field-accessibility-with-the-label-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/improve-form-field-accessibility-with-the-label-element.arabic.md new file mode 100644 index 0000000000..d678dda271 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/improve-form-field-accessibility-with-the-label-element.arabic.md @@ -0,0 +1,82 @@ +--- +id: 587d778a367417b2b2512aa6 +title: Improve Form Field Accessibility with the label Element +challengeType: 0 +videoUrl: '' +localeTitle: تحسين إمكانية الوصول إلى حقل النموذج باستخدام عنصر التسمية +--- + +## Description +
ينطبق تحسين إمكانية الوصول باستخدام ترميز HTML الدلالية على استخدام كلٍّ من أسماء العلامات المناسبة وكذلك السمات. تغطي التحديات العديدة التالية بعض السيناريوهات المهمة التي تستخدم سمات في النماذج. تقوم علامة label بلف النص لعنصر تحكم محدد في النموذج ، وعادة ما يكون الاسم أو الملصق الخاص باختيار ما. هذا يربط معنى لهذا البند ويجعل الشكل أكثر قابلية للقراءة. و for السمة على label العلامة الزميلة صراحة على أن label مع عنصر تحكم النموذج ويستخدم من قبل قارئات الشاشة. لقد تعلمت عن أزرار الاختيار وتصنيفاتها في درس في قسم HTML الأساسي. في هذا الدرس ، قمنا بلف عنصر إدخال زر الراديو داخل عنصر label إلى جانب نص التسمية لجعل النص قابلاً للنقر. وهناك طريقة أخرى لتحقيق ذلك هي عن طريق استخدام for السمة كما هو موضح في هذا الدرس. يجب أن تكون قيمة السمة هي نفس قيمة السمة id for تحكم النموذج. إليك مثال على ذلك:
<form>
<label for = "name"> الاسم: </ label>
<input type = "text" id = "name" name = "name">
</ form>
+ +## Instructions +
يتوقع كامبر كات اهتمامًا كبيرًا بمشاركاته المدروسة ، ويريد تضمين نموذج اشتراك بالبريد الإلكتروني. إضافة for السمة على البريد الإلكتروني label يطابق id عن دورتها input المجال.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون التعليمات البرمجية ل for السمة على label العلامة التي ليس فارغا. + testString: 'assert($("label").attr("for"), "Your code should have a for attribute on the label tag that is not empty.");' + - text: يجب أن تتوافق قيمة السمة for بك for قيمة id في input البريد الإلكتروني. + testString: 'assert($("label").attr("for") == "email", "Your for attribute value should match the id value on the email input.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+

Deep Thoughts with Master Camper Cat

+
+
+
+

Sign up to receive Camper Cat's blog posts by email here!

+ + + + + + + +
+
+
+

The Garfield Files: Lasagna as Training Fuel?

+

The internet is littered with varying opinions on nutritional paradigms, from catnip paleo to hairball cleanses. But let's turn our attention to an often overlooked fitness fuel, and examine the protein-carb-NOM trifecta that is lasagna...

+
+ +
+

Defeating your Foe: the Red Dot is Ours!

+

Felines the world over have been waging war on the most persistent of foes. This red nemesis combines both cunning stealth and lightening speed. But chin up, fellow fighters, our time for victory may soon be near...

+
+ +
+

Is Chuck Norris a Cat Person?

+

Chuck Norris is widely regarded as the premier martial artist on the planet, and it's a complete coincidence anyone who disagrees with this fact mysteriously disappears soon after. But the real question is, is he a cat person?...

+
+ + + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/improve-readability-with-high-contrast-text.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/improve-readability-with-high-contrast-text.arabic.md new file mode 100644 index 0000000000..0ae360d466 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/improve-readability-with-high-contrast-text.arabic.md @@ -0,0 +1,68 @@ +--- +id: 587d778e367417b2b2512aab +title: Improve Readability with High Contrast Text +challengeType: 0 +videoUrl: '' +localeTitle: تحسين إمكانية القراءة مع نص عالي التباين +--- + +## Description +
قد يؤدي التباين المنخفض بين ألوان المقدمة والخلفية إلى صعوبة قراءة النص. يحسن التباين الكافي من سهولة قراءة المحتوى الخاص بك ، ولكن ماذا يعني "كاف" بالضبط؟ توصي إرشادات الوصول إلى محتوى الويب (WCAG) بنسبة تباين تبلغ 4.5 إلى 1 على الأقل للنص العادي. يتم حساب النسبة بمقارنة قيم النصوع النسبي للونين. يتراوح هذا من 1: 1 لنفس اللون ، أو بدون تباين ، إلى 21: 1 للون الأبيض في مقابل أسود ، وهو أقوى تباين. هناك العديد من أدوات التحقق من التباين المتاحة عبر الإنترنت والتي تحسب هذه النسبة لك.
+ +## Instructions +
يتميز اختيار Camper Cat للنص باللون الرمادي الفاتح على خلفية بيضاء لمشاركته الأخيرة في المدونة بنسبة تباين تبلغ 1.5: 1 ، مما يجعل من الصعب قراءتها. قم بتغيير color النص من الرمادي الحالي ( #D3D3D3 ) إلى اللون الرمادي الداكن ( #636363 ) لتحسين نسبة التباين إلى 6: 1.
+ +## Tests +
+ +```yml +tests: + - text: يجب تغيير التعليمات البرمجية الخاصة بك color النص الخاص body إلى الرمادي الداكن. + testString: 'assert($("body").css("color") == "rgb(99, 99, 99)", "Your code should change the text color for the body to the darker gray.");' + - text: التعليمات البرمجية لا ينبغي تغيير background-color لل body . + testString: 'assert($("body").css("background-color") == "rgb(255, 255, 255)", "Your code should not change the background-color for the body.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + + + +
+

Deep Thoughts with Master Camper Cat

+
+
+

A Word on the Recent Catnip Doping Scandal

+

The influence that catnip has on feline behavior is well-documented, and its use as an herbal supplement in competitive ninja circles remains controversial. Once again, the debate to ban the substance is brought to the public's attention after the high-profile win of Kittytron, a long-time proponent and user of the green stuff, at the Claw of Fury tournament.

+

As I've stated in the past, I firmly believe a true ninja's skills must come from within, with no external influences. My own catnip use shall continue as purely recreational.

+
+ + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/jump-straight-to-the-content-using-the-main-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/jump-straight-to-the-content-using-the-main-element.arabic.md new file mode 100644 index 0000000000..873aa4fd5d --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/jump-straight-to-the-content-using-the-main-element.arabic.md @@ -0,0 +1,57 @@ +--- +id: 587d774e367417b2b2512a9f +title: Jump Straight to the Content Using the main Element +challengeType: 0 +videoUrl: '' +localeTitle: الانتقال مباشرةً إلى المحتوى باستخدام العنصر الرئيسي +--- + +## Description +
قدم HTML5 عددًا من العناصر الجديدة التي توفر للمطورين مزيدًا من الخيارات مع تضمين ميزات إمكانية الوصول أيضًا. تتضمن هذه العلامات main ، header footer ، footer ، nav ، article ، section ، وغيرها. بشكل افتراضي ، يعرض المتصفح هذه العناصر بشكل مشابه div المتواضع. ومع ذلك ، فإن استخدامها عند الاقتضاء يعطي معنًى إضافيًا في ترميزك. يمكن أن يشير اسم العلامة وحده إلى نوع المعلومات التي يحتوي عليها ، مما يضيف معنىً دلاليًا إلى ذلك المحتوى. يمكن للتكنولوجيات المساعدة الوصول إلى هذه المعلومات لتوفير ملخص صفحة أفضل أو خيارات التنقل لمستخدميها. يتم استخدام العنصر main لتغليف المحتوى (الأساسي) ، ويجب أن يكون هناك واحد فقط لكل صفحة. من المفترض أن تحيط المعلومات المتعلقة بالموضوع المركزي لصفحتك. لا يُقصد به تضمين عناصر تكرر عبر الصفحات ، مثل روابط التنقل أو إعلانات البانر. تحتوي العلامة main أيضًا على ميزة main مضمّنة يمكن للتكنولوجيا المساعدة استخدامها للانتقال سريعًا إلى المحتوى الرئيسي. إذا رأيت في أي وقت مضى رابط "الانتقال إلى المحتوى الرئيسي" في أعلى الصفحة ، فإن استخدام علامة رئيسية تلقائيًا يعطي الأجهزة المساعدة تلك الوظائف.
+ +## Instructions +
كامبر كات لديه بعض الأفكار الكبيرة لصفحة أسلحة النينجا. ساعده في إعداد ترميزه عن طريق إضافة علامات فتح وإغلاق main بين header footer (مغطاة في تحديات أخرى). احتفظ بالعلامات main فارغة في الوقت الحالي.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون main علامة main واحدة. + testString: 'assert($("main").length == 1, "Your code should have one main tag.");' + - text: و main يجب أن تكون العلامات بين إغلاق header العلامة وافتتاح footer العلامة. + testString: 'assert(code.match(/<\/header>\s*?
\s*?<\/main>/gi), "The main tags should be between the closing header tag and the opening footer tag.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html +
+

Weapons of the Ninja

+
+ + + + + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/know-when-alt-text-should-be-left-blank.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/know-when-alt-text-should-be-left-blank.arabic.md new file mode 100644 index 0000000000..ccba52f9db --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/know-when-alt-text-should-be-left-blank.arabic.md @@ -0,0 +1,62 @@ +--- +id: 587d774c367417b2b2512a9d +title: Know When Alt Text Should be Left Blank +challengeType: 0 +videoUrl: '' +localeTitle: معرفة متى يجب ترك النص البديل فارغًا +--- + +## Description +
في آخر تحد ، علمت أن تضمين سمة alt على علامات img إلزامي. ومع ذلك ، في بعض الأحيان يتم تجميع الصور مع تسمية توضيحية تشرحها بالفعل ، أو يتم استخدامها للزينة فقط. في هذه الحالات قد يبدو النص alt زائدا أو غير ضروري. في الحالات التي تكون فيها الصورة مفسّرة بالفعل بمحتوى نصي ، أو لا تضيف معنى إلى صفحة ما ، فإن img لا تزال بحاجة إلى سمة alt ، ولكن يمكن ضبطها على سلسلة فارغة. إليك مثال على ذلك: <img src="visualDecoration.jpeg" alt=""> عادةً ما تقع صور الخلفية تحت التصنيف "الزخرفي" أيضًا. ومع ذلك ، يتم تطبيقها عادةً مع قواعد CSS ، وبالتالي فهي ليست جزءًا من عملية قراءة برامج الترميز. ملحوظة
بالنسبة للصور التي تحتوي على تسمية توضيحية ، قد تحتاج إلى تضمين نص alt ، لأنه يساعد محركات البحث على فهرسة محتوى الصورة.
+ +## Instructions +
قام الكاراف كات بترميز صفحة الهيكل العظمي لجزء المدونة الخاص بموقعه على الويب. انه يخطط لإضافة استراحة بصرية بين مادتيه مع صورة زخرفية لسيف الساموراي. أضف سمة alt لعلامة img واضبطها على سلسلة فارغة. (لاحظ أن الصورة src لا ترتبط بملف فعلي - لا تقلق أنه لا توجد سيوف تظهر في الشاشة.)
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تحتوي علامة img سمة alt . + testString: 'assert(!($("img").attr("alt") == undefined), "Your img tag should have an alt attribute.");' + - text: يجب تعيين سمة alt لسلسلة فارغة. + testString: 'assert($("img").attr("alt") == "", "The alt attribute should be set to an empty string.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html +

Deep Thoughts with Master Camper Cat

+
+

Defeating your Foe: the Red Dot is Ours!

+

To Come...

+
+ + + +
+

Is Chuck Norris a Cat Person?

+

To Come...

+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/make-elements-only-visible-to-a-screen-reader-by-using-custom-css.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/make-elements-only-visible-to-a-screen-reader-by-using-custom-css.arabic.md new file mode 100644 index 0000000000..727efdb078 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/make-elements-only-visible-to-a-screen-reader-by-using-custom-css.arabic.md @@ -0,0 +1,138 @@ +--- +id: 587d778d367417b2b2512aaa +title: Make Elements Only Visible to a Screen Reader by Using Custom CSS +challengeType: 0 +videoUrl: '' +localeTitle: جعل العناصر مرئية فقط إلى قارئ الشاشة عن طريق استخدام CSS مخصص +--- + +## Description +
هل لاحظت أن جميع تحديات إمكانية الوصول المطبقة حتى الآن لم تستخدم أي CSS؟ هذا هو إظهار أهمية مخطط المستند المنطقي ، واستخدام علامات ذات معنى دلالي حول المحتوى الخاص بك قبل إدخال جانب التصميم المرئي. ومع ذلك ، يمكن لسحر CSS أيضًا تحسين إمكانية الوصول على صفحتك عندما تريد إخفاء المحتوى المقصود فقط لقارئي الشاشة. يحدث هذا عندما تكون المعلومات في تنسيق مرئي (مثل التخطيط) ، ولكن يحتاج مستخدمو قارئ الشاشة إلى عرض تقديمي بديل (مثل جدول) للوصول إلى البيانات. يتم استخدام CSS لوضع عناصر قارئ الشاشة فقط خارج المنطقة المرئية من نافذة المتصفح. في ما يلي مثال لقواعد CSS التي تحقق ذلك:
.sr-only {
الموقع: مطلقة
left: -10000px؛
العرض: 1 بكسل ؛
الارتفاع: 1 بكسل ؛
top: auto؛
إخفاء الفائض؛
}
ملحوظة
أساليب CSS التالية لن تفعل نفس الشيء:
+ +## Instructions +
أنشأ كامبر كات مخططًا شريطيًا رائعًا جدًا لصفحته التدريبية ، ووضع البيانات في جدول لمستخدمي المعاقين بصريا. يحتوي الجدول بالفعل على فئة sr-only ، ولكن لا يتم ملء قواعد CSS حتى الآن. امنح position قيمة مطلقة ، والقيمة left من -10000px ، width height لكل من قيم 1px.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تقوم التعليمات البرمجية الخاصة بك بتعيين خاصية position للفئة sr-only إلى قيمة مطلقة. + testString: 'assert($(".sr-only").css("position") == "absolute", "Your code should set the position property of the sr-only class to a value of absolute.");' + - text: يجب أن تقوم كودك بتعيين الخاصية left للفئة sr-only إلى قيمة -10000px. + testString: 'assert($(".sr-only").css("left") == "-10000px", "Your code should set the left property of the sr-only class to a value of -10000px.");' + - text: يجب أن يقوم width بتعيين خاصية width للفئة sr-only إلى قيمة 1 بكسل. + testString: 'assert(code.match(/width:\s*?1px/gi), "Your code should set the width property of the sr-only class to a value of 1 pixel.");' + - text: يجب أن تقوم التعليمات البرمجية الخاصة بك بتعيين خاصية height للفئة sr-only إلى قيمة 1 بكسل. + testString: 'assert(code.match(/height:\s*?1px/gi), "Your code should set the height property of the sr-only class to a value of 1 pixel.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + + + +
+

Training

+ +
+
+

Master Camper Cat's Beginner Three Week Training Program

+
+ +

[Stacked bar chart]

+
+
Breakdown per week of time to spend training in stealth, combat, and weapons.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Hours of Weekly Training in Stealth, Combat, and Weapons
Stealth & AgilityCombatWeaponsTotal
Week One35210
Week Two45312
Week Three46313
+
+
+

Stealth & Agility Training

+

Climb foliage quickly using a minimum spanning tree approach

+

No training is NP-complete without parkour

+
+
+

Combat Training

+

Dispatch multiple enemies with multithreaded tactics

+

Goodbye, world: 5 proven ways to knock out an opponent

+
+
+

Weapons Training

+

Swords: the best tool to literally divide and conquer

+

Breadth-first or depth-first in multi-weapon training?

+
+ + + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/make-links-navigatable-with-html-access-keys.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/make-links-navigatable-with-html-access-keys.arabic.md new file mode 100644 index 0000000000..cbdf3c55e0 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/make-links-navigatable-with-html-access-keys.arabic.md @@ -0,0 +1,76 @@ +--- +id: 587d7790367417b2b2512aaf +title: Make Links Navigatable with HTML Access Keys +challengeType: 0 +videoUrl: '' +localeTitle: جعل الروابط نافيجيتابل مع مفاتيح الوصول إلى HTML +--- + +## Description +
تقدم HTML و accesskey السمة لتحديد مفتاح الاختصار لتنشيط أو إحضار التركيز إلى عنصر. هذا يمكن أن يجعل التنقل أكثر كفاءة لمستخدمي لوحة المفاتيح فقط. تسمح HTML5 باستخدام هذه السمة على أي عنصر ، ولكنها مفيدة بشكل خاص عند استخدامها مع تلك التفاعلية. ويشمل ذلك الروابط والأزرار وعناصر التحكم في النموذج. إليك مثالاً: <button accesskey="b">Important Button</button>
+ +## Instructions +
يريد Camper Cat أن تحتوي الروابط الموجودة حول عنوان مقالتي المدونة على اختصارات لوحة المفاتيح حتى يتمكن مستخدمو موقعه من الانتقال سريعًا إلى القصة الكاملة. إضافة سمة accesskey إلى كلا الارتباطين وتعيين أول واحد إلى "g" (لـ Garfield) والثاني إلى "c" (لـ Chuck Norris).
+ +## Tests +
+ +```yml +tests: + - text: التعليمات البرمجية يجب إضافة و accesskey السمة إلى a العلامة مع id من "لأول مرة". + testString: 'assert($("#first").attr("accesskey"), "Your code should add an accesskey attribute to the a tag with the id of "first".");' + - text: التعليمات البرمجية يجب إضافة و accesskey السمة إلى a العلامة مع id من "الثاني". + testString: 'assert($("#second").attr("accesskey"), "Your code should add an accesskey attribute to the a tag with the id of "second".");' + - text: التعليمات البرمجية يجب تعيين accesskey السمة على a العلامة مع id من "الأولى" إلى "ز". لاحظ أن القضية مهمة. + testString: 'assert($("#first").attr("accesskey") == "g", "Your code should set the accesskey attribute on the a tag with the id of "first" to "g". Note that case matters.");' + - text: التعليمات البرمجية يجب تعيين accesskey السمة على a العلامة مع id من ل"ج" "ثانية". لاحظ أن القضية مهمة. + testString: 'assert($("#second").attr("accesskey") == "c", "Your code should set the accesskey attribute on the a tag with the id of "second" to "c". Note that case matters.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+

Deep Thoughts with Master Camper Cat

+
+
+ + +

The Garfield Files: Lasagna as Training Fuel?

+ + +

The internet is littered with varying opinions on nutritional paradigms, from catnip paleo to hairball cleanses. But let's turn our attention to an often overlooked fitness fuel, and examine the protein-carb-NOM trifecta that is lasagna...

+
+
+ + +

Is Chuck Norris a Cat Person?

+ + +

Chuck Norris is widely regarded as the premier martial artist on the planet, and it's a complete coincidence anyone who disagrees with this fact mysteriously disappears soon after. But the real question is, is he a cat person?...

+
+ + + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/make-screen-reader-navigation-easier-with-the-footer-landmark.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/make-screen-reader-navigation-easier-with-the-footer-landmark.arabic.md new file mode 100644 index 0000000000..cda7baf1e2 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/make-screen-reader-navigation-easier-with-the-footer-landmark.arabic.md @@ -0,0 +1,86 @@ +--- +id: 587d7788367417b2b2512aa3 +title: Make Screen Reader Navigation Easier with the footer Landmark +challengeType: 0 +videoUrl: '' +localeTitle: جعل قارئ شاشة الملاحة أسهل مع تذييل لاندمارك +--- + +## Description +
يشبه عنصر footer المشابه header nav ميزة المعالم المضمنة التي تسمح للأجهزة المساعدة بالانتقال إليها بسرعة. يتم استخدامه بشكل أساسي لاحتواء معلومات حقوق الطبع والنشر أو الروابط إلى المستندات ذات الصلة التي عادة ما تكون في أسفل الصفحة.
+ +## Instructions +
تحقق صفحة تدريب Camper Cat تقدمًا جيدًا. غيّر div الذي استخدمه في التفاف معلومات حقوق النشر الخاصة به في أسفل الصفحة إلى عنصر footer .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون footer علامة footer واحد. + testString: 'assert($("footer").length == 1, "Your code should have one footer tag.");' + - text: يجب ألا تحتوي شفرتك على أي علامات div . + testString: 'assert($("div").length == 0, "Your code should not have any div tags.");' + - text: يجب أن تحتوي الشفرة على علامة footer للفتح footer . + testString: 'assert(code.match(/
+ +## Challenge Seed +
+ +
+ +```html + +
+

Training

+ +
+
+
+

Stealth & Agility Training

+

Climb foliage quickly using a minimum spanning tree approach

+

No training is NP-complete without parkour

+
+
+

Combat Training

+

Dispatch multiple enemies with multithreaded tactics

+

Goodbye world: 5 proven ways to knock out an opponent

+
+
+

Weapons Training

+

Swords: the best tool to literally divide and conquer

+

Breadth-first or depth-first in multi-weapon training?

+
+
+ + +
© 2018 Camper Cat
+ + + + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/make-screen-reader-navigation-easier-with-the-header-landmark.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/make-screen-reader-navigation-easier-with-the-header-landmark.arabic.md new file mode 100644 index 0000000000..d50f32be54 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/make-screen-reader-navigation-easier-with-the-header-landmark.arabic.md @@ -0,0 +1,79 @@ +--- +id: 587d7787367417b2b2512aa1 +title: Make Screen Reader Navigation Easier with the header Landmark +challengeType: 0 +videoUrl: '' +localeTitle: جعل قارئ شاشة الملاحة أسهل مع رأس معلم +--- + +## Description +
عنصر HTML5 التالي الذي يضيف المعنى الدلالي ويحسّن إمكانية الوصول هو علامة header . يتم استخدامه لالتفاف المعلومات التمهيدية أو ارتباطات التنقل لعلامته الرئيسية ، ويعمل بشكل جيد حول المحتوى الذي يتكرر في الأعلى على صفحات متعددة. يشترك header في ميزة المعالم البارزة التي شاهدتها بشكل main ، مما يسمح باستخدام التقنيات المساعدة للتنقل بسرعة إلى هذا المحتوى. ملحوظة
header المقصود للاستخدام في body بطاقة من وثيقة HTML الخاص بك. هذا يختلف عن عنصر head ، والذي يحتوي على عنوان الصفحة ، معلومات التعريف ، إلخ.
+ +## Instructions +
كامبر كات يكتب بعض المقالات الرائعة حول تدريب النينجا ، ويريد إضافة صفحة لهم إلى موقعه. غيّر div الأعلى الذي يحتوي حاليًا على h1 إلى علامة header بدلاً من ذلك.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تحتوي الشفرة على علامة header واحدة. + testString: 'assert($("header").length == 1, "Your code should have one header tag.");' + - text: يجب أن تلتف علامات header حول h1 . + testString: 'assert($("header").children("h1").length == 1, "Your header tags should wrap around the h1.");' + - text: يجب ألا تحتوي شفرتك على أي علامات div . + testString: 'assert($("div").length == 0, "Your code should not have any div tags.");' + - text: تأكد من أن عنصر header الخاص بك يحتوي على علامة إغلاق. + testString: 'assert(code.match(/<\/header>/g) && code.match(/<\/header>/g).length === code.match(/
/g).length, "Make sure your header element has a closing tag.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+

Training with Camper Cat

+
+ + +
+
+

Stealth & Agility Training

+

Climb foliage quickly using a minimum spanning tree approach

+

No training is NP-complete without parkour

+
+
+

Combat Training

+

Dispatch multiple enemies with multithreaded tactics

+

Goodbye world: 5 proven ways to knock out an opponent

+
+
+

Weapons Training

+

Swords: the best tool to literally divide and conquer

+

Breadth-first or depth-first in multi-weapon training?

+
+
+ + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/make-screen-reader-navigation-easier-with-the-nav-landmark.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/make-screen-reader-navigation-easier-with-the-nav-landmark.arabic.md new file mode 100644 index 0000000000..0e9cfba69b --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/make-screen-reader-navigation-easier-with-the-nav-landmark.arabic.md @@ -0,0 +1,85 @@ +--- +id: 587d7788367417b2b2512aa2 +title: Make Screen Reader Navigation Easier with the nav Landmark +challengeType: 0 +videoUrl: '' +localeTitle: جعل قارئ شاشة الملاحة أسهل مع الملاحة +--- + +## Description +
عنصر nav هو عنصر HTML5 آخر مع ميزة المعالم المضمنة لسهولة التنقل في قارئ الشاشة. تهدف هذه العلامة إلى الالتفاف حول روابط التنقل الرئيسية في صفحتك. إذا كانت هناك روابط موقع متكررة في أسفل الصفحة ، فليس من الضروري ترميز تلك التي تحتوي على علامة nav أيضًا. يكفي استخدام footer (المغطى في التحدي التالي).
+ +## Instructions +
أدرج Camper Cat ارتباطات التنقل في الجزء العلوي من صفحة التدريب الخاصة به ، ولكن ملفوفة في div . غيّر div إلى علامة nav لتحسين إمكانية الوصول على صفحته.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يحتوي nav علامة nav واحدة. + testString: 'assert($("nav").length == 1, "Your code should have one nav tag.");' + - text: يجب أن تقوم علامات nav الخاصة بك بالالتفاف حول ul وعناصر القائمة الخاصة بها. + testString: 'assert($("nav").children("ul").length == 1, "Your nav tags should wrap around the ul and its list items.");' + - text: يجب ألا تحتوي شفرتك على أي علامات div . + testString: 'assert($("div").length == 0, "Your code should not have any div tags.");' + - text: تأكد من أن عنصر nav يحتوي على علامة إغلاق. + testString: 'assert(code.match(/<\/nav>/g) && code.match(/<\/nav>/g).length === code.match(/
+ +## Challenge Seed +
+ +
+ +```html + +
+

Training with Camper Cat

+ +
+ +
+ +
+
+
+

Stealth & Agility Training

+

Climb foliage quickly using a minimum spanning tree approach

+

No training is NP-complete without parkour

+
+
+

Combat Training

+

Dispatch multiple enemies with multithreaded tactics

+

Goodbye world: 5 proven ways to knock out an opponent

+
+
+

Weapons Training

+

Swords: the best tool to literally divide and conquer

+

Breadth-first or depth-first in multi-weapon training?

+
+
+ + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/standardize-times-with-the-html5-datetime-attribute.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/standardize-times-with-the-html5-datetime-attribute.arabic.md new file mode 100644 index 0000000000..e645bbf2f1 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/standardize-times-with-the-html5-datetime-attribute.arabic.md @@ -0,0 +1,85 @@ +--- +id: 587d778c367417b2b2512aa9 +title: Standardize Times with the HTML5 datetime Attribute +challengeType: 0 +videoUrl: '' +localeTitle: توحيد الأوقات باستخدام سمة datetime HTML5 +--- + +## Description +
استمرارًا بموضوع التاريخ ، قدم HTML5 أيضًا عنصر time مع سمة datetime لتوحيد الأوقات. هذا عنصر مضمّن يمكن أن يلف تاريخًا أو وقتًا على الصفحة. يتم الاحتفاظ بتنسيق صالح لذلك التاريخ بواسطة السمة datetime . هذه هي القيمة التي يتم الوصول إليها بواسطة الأجهزة المساعدة. يساعد على تجنب الارتباك عن طريق ذكر نسخة موحدة من الوقت ، حتى لو كان مكتوبا بطريقة غير رسمية أو عامية في النص. في ما يلي مثال على ذلك: <p>Master Camper Cat officiated the cage match between Goro and Scorpion <time datetime="2013-02-13">last Wednesday</time>, which ended in a draw.</p>
+ +## Instructions +
نتائج الاستطلاع "مورتال كومبات" كامبر كات في! لف علامة time حول النص "الخميس 15 سبتمبر <sup> th </ sup>" وأضف سمة datetime لتعيينها على "2016-09-15".
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تلتف علامات time حول النص "الخميس 15 سبتمبر <sup> th </ sup>". + testString: 'assert($("time").text().match(/Thursday, September 15th/g), "Your time tags should wrap around the text "Thursday, September 15<sup>th</sup>".");' + - text: يجب أن تحتوي علامة time الخاصة بك على سمة datetime غير فارغة. + testString: 'assert($("time").attr("datetime"), "Your time tag should have a datetime attribute that is not empty.");' + - text: يجب تعيين السمة datetime الخاصة بك إلى قيمة 2016-09-15. + testString: 'assert($("time").attr("datetime") === "2016-09-15", "Your datetime attribute should be set to a value of 2016-09-15.");' + - text: تأكد من أن عنصر time يحتوي على علامة إغلاق. + testString: 'assert(code.match(/<\/time>/g) && code.match(/<\/time>/g).length === 4, "Make sure your time element has a closing tag.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+

Tournaments

+
+
+

Mortal Kombat Tournament Survey Results

+ + + +

Thank you to everyone for responding to Master Camper Cat's survey. The best day to host the vaunted Mortal Kombat tournament is Thursday, September 15th. May the best ninja win!

+ + + +
+

Comments:

+
+

Posted by: Sub-Zero on

+

Johnny Cage better be there, I'll finish him!

+
+
+

Posted by: Doge on

+

Wow, much combat, so mortal.

+
+
+

Posted by: The Grim Reaper on

+

Looks like I'll be busy that day.

+
+
+
+ + + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/use-headings-to-show-hierarchical-relationships-of-content.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/use-headings-to-show-hierarchical-relationships-of-content.arabic.md new file mode 100644 index 0000000000..3b3e4c269f --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/use-headings-to-show-hierarchical-relationships-of-content.arabic.md @@ -0,0 +1,64 @@ +--- +id: 587d774d367417b2b2512a9e +title: Use Headings to Show Hierarchical Relationships of Content +challengeType: 0 +videoUrl: '' +localeTitle: استخدم العناوين لإظهار العلاقات الهرمية للمحتوى +--- + +## Description +
تعد العناوين (عناصر h1 حتى h6 ) علامات عامل تساعد في توفير البنية ووضع العلامات على المحتوى الخاص بك. يمكن تعيين قارئات الشاشة لقراءة العناوين فقط في الصفحة بحيث يحصل المستخدم على ملخص. هذا يعني أنه من المهم بالنسبة لعلامات العنوان في الترميز أن يكون لها معنى دلالي وتتصل ببعضها البعض ، ولا يتم انتقاؤها فقط لقيم حجمها. يعني المعنى الدلالي أن العلامة التي تستخدمها حول المحتوى تشير إلى نوع المعلومات التي تحتوي عليها. إذا كنت تكتب ورقة تحتوي على مقدمة وجسم وخاتمة ، فلن يكون من المنطقي وضع الخاتمة كقسم فرعي للجسم في مخططك. يجب أن يكون القسم الخاص بها. وبالمثل ، يجب أن تدخل علامات العنوان في صفحة ويب وترمز إلى العلاقات الهرمية للمحتوى الخاص بك. تبدأ العناوين ذات الترتيب المتساوي (أو الأعلى) بأقسام جديدة ضمنية ، مع عناوين فرعية منخفضة بداية من المرحلة السابقة. وكمثال على ذلك ، فإن الصفحة التي تحتوي على عنصر h2 متبوعًا بالعديد من الأقسام الفرعية المصنفة h4 قد تؤدي إلى إرباك مستخدم قارئ الشاشة. من خلال ستة اختيارات ، من المغري استخدام علامة لأنها تبدو أفضل في المتصفح ، ولكن يمكنك استخدام CSS لتحرير الحجم النسبي. نقطة واحدة أخيرة ، يجب أن تحتوي كل صفحة دائمًا على عنصر h1 (واحد فقط) ، وهو الموضوع الرئيسي للمحتوى الخاص بك. يتم استخدام هذا والعناوين الأخرى جزئيًا بواسطة محركات البحث لفهم موضوع الصفحة.
+ +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: يجب أن تحتوي شفرتك على ست علامات h3 . + testString: 'assert($("h3").length === 6, "Your code should have six h3 tags.");' + - text: يجب ألا تحتوي شفرتك على أي علامات h5 . + testString: 'assert($("h5").length === 0, "Your code should not have any h5 tags.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html +

How to Become a Ninja

+
+

Learn the Art of Moving Stealthily

+
How to Hide in Plain Sight
+
How to Climb a Wall
+ +

Learn the Art of Battle

+
How to Strengthen your Body
+
How to Fight like a Ninja
+ +

Learn the Art of Living with Honor

+
How to Breathe Properly
+
How to Simplify your Life
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/use-tabindex-to-add-keyboard-focus-to-an-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/use-tabindex-to-add-keyboard-focus-to-an-element.arabic.md new file mode 100644 index 0000000000..367ac644f3 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/use-tabindex-to-add-keyboard-focus-to-an-element.arabic.md @@ -0,0 +1,97 @@ +--- +id: 587d7790367417b2b2512ab0 +title: Use tabindex to Add Keyboard Focus to an Element +challengeType: 0 +videoUrl: '' +localeTitle: استخدم tabindex إلى إضافة Keyboard Keyboard إلى عنصر +--- + +## Description +
tabindex سمة tabindex HTML على ثلاث وظائف مميزة تتعلق بتركيز لوحة المفاتيح للعنصر. عندما يكون على علامة ، فإنه يشير إلى أنه يمكن التركيز على العنصر. تحدد القيمة (عدد صحيح موجب أو سلبي أو صفر) السلوك. تتلقى عناصر معينة ، مثل الروابط وعناصر التحكم في النموذج ، تركيز لوحة المفاتيح تلقائيًا عند قيام المستخدم بالتبويب من خلال صفحة. إنه بنفس ترتيب العناصر الموجودة في ترميز مصدر HTML. يمكن إعطاء هذه الوظيفة نفسها لعناصر أخرى ، مثل div و span و p ، بوضع سمة tabindex="0" عليها. إليك مثال: <div tabindex="0">I need keyboard focus!</div> ملاحظة
tabindex قيمة tabindex سالبة (عادة -1) إلى أن العنصر قابل للتركيز ، ولكن لا يمكن الوصول إليه عن طريق لوحة المفاتيح. يتم استخدام هذه الطريقة بشكل عام للتركيز على المحتوى برمجيًا (مثلما يحدث عندما يتم تنشيط div المستخدم في نافذة منبثقة) ، وهو خارج نطاق هذه التحديات.
+ +## Instructions +
أنشأ Camper Cat استبيانًا جديدًا لجمع معلومات حول مستخدميه. وهو يعلم أن حقول الإدخال تحصل تلقائيًا على تركيز لوحة المفاتيح ، ولكنه يريد التأكد من أن مستخدمي لوحة المفاتيح يتوقفون مؤقتًا عند استخدام الإرشادات أثناء الجدولة خلال العناصر. إضافة سمة tabindex إلى علامة p وتعيين قيمتها إلى "0". المكافأة - باستخدام tabindex تمكّن أيضًا tabindex CSS الزائفة :focus على العمل على علامة p .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تضيف التعليمات البرمجية الخاصة بك سمة tabindex إلى علامة p التي تحتوي على إرشادات النموذج. + testString: 'assert($("p").attr("tabindex"), "Your code should add a tabindex attribute to the p tag that holds the form instructions.");' + - text: يجب أن تقوم التعليمات البرمجية بتعيين السمة tabindex على علامة p إلى قيمة 0. + testString: 'assert($("p").attr("tabindex") == "0", "Your code should set the tabindex attribute on the p tag to a value of 0.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + + + +
+

Ninja Survey

+
+
+
+ + +

Instructions: Fill in ALL your information then click Submit

+ + + +
+
+ What level ninja are you? + +
+ +
+ + +
+
+
+ Select your favorite weapons: + +
+ +
+ +
+ + +
+
+ +

+
+ + + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/use-tabindex-to-specify-the-order-of-keyboard-focus-for-several-elements.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/use-tabindex-to-specify-the-order-of-keyboard-focus-for-several-elements.arabic.md new file mode 100644 index 0000000000..eb15c831cb --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/use-tabindex-to-specify-the-order-of-keyboard-focus-for-several-elements.arabic.md @@ -0,0 +1,85 @@ +--- +id: 587d7790367417b2b2512ab1 +title: Use tabindex to Specify the Order of Keyboard Focus for Several Elements +challengeType: 0 +videoUrl: '' +localeTitle: استخدم tabindex لتحديد ترتيب التركيز على لوحة المفاتيح للعديد من العناصر +--- + +## Description +
tabindex السمة tabindex أيضًا ترتيب علامات التبويب الدقيق للعناصر. يتحقق ذلك عندما يتم تعيين قيمة السمة إلى عدد موجب من 1 أو أعلى. سيؤدي تعيين tabindex = "1" إلى تركيز لوحة المفاتيح على هذا العنصر أولاً. ثم يمر عبر تسلسل قيم tabindex المحددة (2 ، 3 ، وما إلى ذلك) ، قبل الانتقال إلى tabindex="0" الافتراضية و tabindex="0" . من المهم ملاحظة أنه عند تعيين ترتيب علامة التبويب بهذه الطريقة ، فإنه يتجاوز الترتيب الافتراضي (الذي يستخدم مصدر HTML). قد يؤدي ذلك إلى إرباك المستخدمين الذين يتوقعون بدء التنقل من أعلى الصفحة. قد تكون هذه التقنية ضرورية في بعض الظروف ، ولكن فيما يتعلق بإمكانية الوصول ، يجب توخي الحذر قبل تطبيقها. إليك مثال على ذلك: <div tabindex="1">I get keyboard focus, and I get it first!</div> <div tabindex="2">I get keyboard focus, and I get it second!</div>
+ +## Instructions +
يحتوي "كامبر كات" على حقل بحث في صفحة "اقتباسات ملهمة" التي ينوي وضعها في الزاوية اليمنى العليا باستخدام CSS. يريد input البحث وإرسال عناصر تحكم نموذج input ليكون أول عنصرين في ترتيب الجدولة. إضافة سمة tabindex مضبوطة على "1" إلى input البحث ، tabindex مضبوطة على "2" إلى input .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تضيف الكود الخاص بك سمة tabindex إلى علامة input البحث. + testString: 'assert($("#search").attr("tabindex"), "Your code should add a tabindex attribute to the search input tag.");' + - text: يجب أن تضيف الكود الخاص بك سمة tabindex إلى علامة input tabindex . + testString: 'assert($("#submit").attr("tabindex"), "Your code should add a tabindex attribute to the submit input tag.");' + - text: يجب أن تحدد tabindex سمة tabindex في علامة input البحث إلى قيمة 1. + testString: 'assert($("#search").attr("tabindex") == "1", "Your code should set the tabindex attribute on the search input tag to a value of 1.");' + - text: يجب أن تحدد tabindex سمة tabindex على علامة input tabindex إلى قيمة 2. + testString: 'assert($("#submit").attr("tabindex") == "2", "Your code should set the tabindex attribute on the submit input tag to a value of 2.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+

Even Deeper Thoughts with Master Camper Cat

+ +
+
+ + + + + + + +
+

Inspirational Quotes

+
+

“There's no Theory of Evolution, just a list of creatures I've allowed to live.”
+ - Chuck Norris

+
+
+

“Wise men say forgiveness is divine, but never pay full price for late pizza.”
+ - TMNT

+
+ + + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/wrap-content-in-the-article-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/wrap-content-in-the-article-element.arabic.md new file mode 100644 index 0000000000..5ef2b804fb --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/wrap-content-in-the-article-element.arabic.md @@ -0,0 +1,71 @@ +--- +id: 587d774e367417b2b2512aa0 +title: Wrap Content in the article Element +challengeType: 0 +videoUrl: '' +localeTitle: التفاف المحتوى في المادة عنصر +--- + +## Description +
article عبارة عن عنصر آخر من عناصر HTML5 الجديدة التي تضيف المعنى الدلالي لترميزك. Article هي عنصر تقسيمي ، وتُستخدم لفك محتوى مستقل ومكتوب ذاتيًا. تعمل العلامة جيدًا مع إدخالات المدونات أو مشاركات المنتدى أو المقالات الإخبارية. عادةً ما يكون تحديد ما إذا كان المحتوى قائمًا بذاته أم لا ، ولكن هناك بعض الاختبارات البسيطة التي يمكنك استخدامها. اسأل نفسك ما إذا كنت قد أزلت كل السياق المحيط ، فهل سيظل هذا المحتوى منطقيًا؟ وبالمثل بالنسبة للنص ، هل سيتم تعليق المحتوى إذا كان في خلاصة RSS؟ تذكر أن الأشخاص الذين يستخدمون تقنيات مساعدة يعتمدون على ترميز منظم ، ذي معنى لغوي لفهم عملك بشكل أفضل. ملاحظة حول section div
عنصر section جديد أيضًا مع HTML5 ، وله معنى دلالي مختلف قليلاً عن article . article للمحتوى المستقل ، section لتجميع المحتوى ذي الصلة الموضوعية. يمكن استخدامها داخل بعضها البعض ، حسب الحاجة. على سبيل المثال ، إذا كان الكتاب هو article ، فكل فصل هو section . عند عدم وجود علاقة بين مجموعات المحتوى ، استخدم div .
<div> - محتوى المجموعات
<section> - مجموعات ذات صلة بالمحتوى
<article> - مجموعات محتوى مستقل بذاته
+ +## Instructions +
استخدم Camper Cat علامات article لتغليف المشاركات في صفحة مدونته ، ولكنه نسي استخدامها في الجزء العلوي منها. غيّر علامة div لاستخدام علامة article بدلاً من ذلك.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تحتوي شفرتك على ثلاث علامات article . + testString: 'assert($("article").length == 3, "Your code should have three article tags.");' + - text: يجب ألا تحتوي شفرتك على أي علامات div . + testString: 'assert($("div").length == 0, "Your code should not have any div tags.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html +

Deep Thoughts with Master Camper Cat

+
+
+

The Garfield Files: Lasagna as Training Fuel?

+

The internet is littered with varying opinions on nutritional paradigms, from catnip paleo to hairball cleanses. But let's turn our attention to an often overlooked fitness fuel, and examine the protein-carb-NOM trifecta that is lasagna...

+
+ + + +
+

Defeating your Foe: the Red Dot is Ours!

+

Felines the world over have been waging war on the most persistent of foes. This red nemesis combines both cunning stealth and lightening speed. But chin up, fellow fighters, our time for victory may soon be near...

+
+ + + +
+

Is Chuck Norris a Cat Person?

+

Chuck Norris is widely regarded as the premier martial artist on the planet, and it's a complete coincidence anyone who disagrees with this fact mysteriously disappears soon after. But the real question is, is he a cat person?...

+
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/wrap-radio-buttons-in-a-fieldset-element-for-better-accessibility.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/wrap-radio-buttons-in-a-fieldset-element-for-better-accessibility.arabic.md new file mode 100644 index 0000000000..198281e771 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-accessibility/wrap-radio-buttons-in-a-fieldset-element-for-better-accessibility.arabic.md @@ -0,0 +1,99 @@ +--- +id: 587d778b367417b2b2512aa7 +title: Wrap Radio Buttons in a fieldset Element for Better Accessibility +challengeType: 0 +videoUrl: '' +localeTitle: التفاف أزرار الراديو في fieldset عنصر من أجل سهولة الوصول +--- + +## Description +
يغطي موضوع النموذج التالي إمكانية الوصول إلى أزرار الاختيار. يتم منح كل خيار على label مع for سمة ربط إلى id من البند المقابل كما غطت في التحدي الماضي. نظرًا لأن الأزرار اللاسلكية غالبًا ما تأتي في مجموعة حيث يجب على المستخدم اختيار واحد ، فهناك طريقة لعرض الخيارات بشكل دلالي وهي جزء من مجموعة. و fieldset العلامة يحيط تجمع بأكمله من أزرار لتحقيق ذلك. وغالبا ما يستخدم legend كلمة دلالية لتقديم وصف للتجمع، وهو يقرأ من قبل القراء الشاشة لكل خيار في fieldset العنصر. لا تعتبر fieldset وعلامة وسيلة legend ضرورية عندما تكون الاختيارات لا تحتاج إلى شرح ، مثل اختيار النوع. باستخدام label مع for سمة لكل زر الراديو غير كافية. إليك مثال على ذلك:
<form>
<مجموعة حقول>
<legend> اختر أحد العناصر الثلاثة التالية: </ legend>
<input id = "one" type = "radio" name = "items" value = "one">
<label for = "one"> الاختيار الأول </ label> <br>
<input id = "two" type = "radio" name = "items" value = "two">
<label for = "two"> الاختيار الثاني </ label> <br>
<input id = "three" type = "radio" name = "items" value = "three">
<label for = "three"> الاختيار الثالث </ label>
</ مجموعة حقول>
</ form>
+ +## Instructions +
يريد Camper Cat معلومات حول مستوى النينجا من مستخدميه عند الاشتراك في قائمة البريد الإلكتروني الخاصة به. وأضاف انه مجموعة من أزرار الراديو، وتعلمت من الدرس الأخير جهدنا لاستخدام علامات التسمية مع for سمات كل خيار. الذهاب القطة قطة! ومع ذلك ، لا يزال رمزه بحاجة إلى بعض المساعدة. قم بتغيير علامة div المحيطة بأزرار fieldset علامة نطاق المجال ، وقم بتغيير علامة p بداخله إلى وسيلة legend .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تحتوي شفرتك على علامة نطاق fieldset حول مجموعة أزرار التحديد. + testString: 'assert($("fieldset").length == 1, "Your code should have a fieldset tag around the radio button set.");' + - text: تأكد لديك fieldset عنصر له علامة إغلاق. + testString: 'assert(code.match(/<\/fieldset>/g) && code.match(/<\/fieldset>/g).length === code.match(/
/g).length, "Make sure your fieldset element has a closing tag.");' + - text: يجب أن تحتوي الشفرة على علامة legend حول النص تسأل عن مستوى النينجا المستخدم. + testString: 'assert($("legend").length == 1, "Your code should have a legend tag around the text asking what level ninja a user is.");' + - text: يجب ألا تحتوي شفرتك على أي علامات div . + testString: 'assert($("div").length == 0, "Your code should not have any div tags.");' + - text: يجب ألا تحتوي شفرتك على علامة p حول النص تسأل عن مستوى النينجا المستخدم. + testString: 'assert($("p").length == 4, "Your code should no longer have a p tag around the text asking what level ninja a user is.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+

Deep Thoughts with Master Camper Cat

+
+
+
+

Sign up to receive Camper Cat's blog posts by email here!

+ + + + + +
+

What level ninja are you?

+ +
+ +
+ + +
+ + + + +
+
+
+

The Garfield Files: Lasagna as Training Fuel?

+

The internet is littered with varying opinions on nutritional paradigms, from catnip paleo to hairball cleanses. But let's turn our attention to an often overlooked fitness fuel, and examine the protein-carb-NOM trifecta that is lasagna...

+
+ +
+

Defeating your Foe: the Red Dot is Ours!

+

Felines the world over have been waging war on the most persistent of foes. This red nemesis combines both cunning stealth and lightening speed. But chin up, fellow fighters, our time for victory may soon be near...

+
+ +
+

Is Chuck Norris a Cat Person?

+

Chuck Norris is widely regarded as the premier martial artist on the planet, and it's a complete coincidence anyone who disagrees with this fact mysteriously disappears soon after. But the real question is, is he a cat person?...

+
+ + + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/add-a-box-shadow-to-a-card-like-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/add-a-box-shadow-to-a-card-like-element.arabic.md new file mode 100644 index 0000000000..5ea10273fd --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/add-a-box-shadow-to-a-card-like-element.arabic.md @@ -0,0 +1,94 @@ +--- +id: 587d781b367417b2b2512abe +title: Add a box-shadow to a Card-like Element +challengeType: 0 +videoUrl: '' +localeTitle: أضف box box إلى عنصر يشبه Card +--- + +## Description +
تطبق خاصية box-shadow أو أكثر على عنصر. تأخذ الخاصية box-shadow قيمًا offset-x (كم تبعد مسافة دفع الظل أفقيًا عن العنصر) ، offset-y (أي بعد الآن تضغط الظل بشكل عمودي من العنصر) ، blur-radius spread-radius ولون القيمة ، بهذا الترتيب. تعد قيم spread-radius blur-radius و blur-radius spread-radius اختيارية. في ما يلي مثال على CSS لإنشاء ظلال متعددة مع بعض الضبابية ، باللون الأسود الغامق في الغالب:
box-shadow: 0 10px 20px rgba (0،0،0،0.19)، 0 6px 6px rgba (0،0،0،0.23)؛
+ +## Instructions +
يحتوي العنصر الآن على معرف thumbnail . باستخدام هذا المحدد ، استخدم القيم CSS الموجودة أعلاه لوضع box-shadow على البطاقة.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تضيف الشفرة خاصية box-shadow لمعرف thumbnail . + testString: 'assert(code.match(/#thumbnail\s*?{\s*?box-shadow/g), "Your code should add a box-shadow property for the thumbnail id.");' + - text: يجب عليك استخدام CSS المعطى لقيمة box-shadow . + testString: 'assert(code.match(/box-shadow:\s*?0\s+?10px\s+?20px\s+?rgba\(\s*?0\s*?,\s*?0\s*?,\s*?0\s*?,\s*?0?\.19\),\s*?0\s+?6px\s+?6px\s+?rgba\(\s*?0\s*?,\s*?0\s*?,\s*?0\s*?,\s*?0?\.23\)/gi), "You should use the given CSS for the box-shadow value.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+
+
+

Alphabet

+
+

Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.

+
+ +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/adjust-the-background-color-property-of-text.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/adjust-the-background-color-property-of-text.arabic.md new file mode 100644 index 0000000000..2b7bfc620c --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/adjust-the-background-color-property-of-text.arabic.md @@ -0,0 +1,93 @@ +--- +id: 587d781b367417b2b2512abc +title: Adjust the background-color Property of Text +challengeType: 0 +videoUrl: '' +localeTitle: ضبط لون الخلفية خاصية النص +--- + +## Description +
بدلاً من ضبط الخلفية العامة أو لون النص لجعل المقدمة قابلة للقراءة بسهولة ، يمكنك إضافة background-color لعنصر يحمل النص الذي تريد التأكيد عليه. يستخدم هذا التحدي rgba() بدلاً من رموز hex أو rgb() العادي rgb() .
rgba لتقف على:
ص = أحمر
g = أخضر
ب = أزرق
a = alpha / level of opacity
يمكن أن تتراوح قيم RGB من 0 إلى 255. يمكن أن تتراوح قيمة alpha من 1 ، وهو معتم تمامًا أو بلون خالص ، إلى 0 ، وهو شفاف تمامًا أو واضح. rgba() رائع لاستخدامه في هذه الحالة ، لأنه يسمح لك بضبط العتامة. هذا يعني أنك لست مضطرًا لحجب الخلفية تمامًا. ستستخدم background-color: rgba(45, 45, 45, 0.1) لهذا التحدي. ينتج لون رمادي غامق يكاد يكون شفافًا نظرًا لقيمة عتامة منخفضة تبلغ 0.1.
+ +## Instructions +
لجعل النص أكثر وضوحًا ، قم بضبط background-color لعنصر h4 إلى قيمة rgba() . بالنسبة إلى h4 أيضًا ، أزل خاصية height وأضف padding قدرها 10 بكسل.
+ +## Tests +
+ +```yml +tests: + - text: 'يجب أن تضيف التعليمات البرمجية الخاصة بك خاصية background-color إلى عنصر h4 لتعيين rgba(45, 45, 45, 0.1) .' + testString: 'assert(code.match(/background-color:\s*?rgba\(\s*?45\s*?,\s*?45\s*?,\s*?45\s*?,\s*?0?\.1\s*?\)/gi), "Your code should add a background-color property to the h4 element set to rgba(45, 45, 45, 0.1).");' + - text: يجب أن تضيف التعليمات البرمجية الخاصة بك خاصية padding إلى عنصر h4 وتعيينها إلى 10 بكسل. + testString: 'assert($("h4").css("padding-top") == "10px" && $("h4").css("padding-right") == "10px" && $("h4").css("padding-bottom") == "10px" && $("h4").css("padding-left") == "10px", "Your code should add a padding property to the h4 element and set it to 10 pixels.");' + - text: يجب إزالة خاصية height على عنصر h4 . + testString: 'assert(!($("h4").css("height") == "25px"), "The height property on the h4 element should be removed.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+
+
+

Alphabet

+
+

Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.

+
+ +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/adjust-the-color-of-various-elements-to-complementary-colors.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/adjust-the-color-of-various-elements-to-complementary-colors.arabic.md new file mode 100644 index 0000000000..79bd42c5a4 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/adjust-the-color-of-various-elements-to-complementary-colors.arabic.md @@ -0,0 +1,92 @@ +--- +id: 587d78a4367417b2b2512ad3 +title: Adjust the Color of Various Elements to Complementary Colors +challengeType: 0 +videoUrl: '' +localeTitle: اضبط لون العناصر المختلفة على الألوان التكميلية +--- + +## Description +
أظهر اختبار الألوان التكميلية أن الألوان المعاكسة على عجلة الألوان يمكن أن تجعل بعضها تبدو أكثر حيوية عندما توضع جنباً إلى جنب. ومع ذلك ، فإن التناقض البصري القوي يمكن أن يكون مزعجًا إذا تم استخدامه بشكل مفرط على موقع ويب ، ويمكن أن يجعل النص أصعب في بعض الأحيان للقراءة إذا وضع على خلفية ملونة مكملة. من الناحية العملية ، عادةً ما يكون أحد الألوان هو المسيطر ويتم استخدام المكمل لإضفاء الاهتمام البصري على محتوى معين على الصفحة.
+ +## Instructions +
ستستخدم هذه الصفحة ظلًا من اللون #09A7A1 ( #09A7A1 ) #09A7A1 المهيمن ، ويكمل اللون البرتقالي ( #FF790E ) لتسليط الضوء على أزرار التسجيل. تغيير background-color كل من header footer من الأسود إلى لون مخضر. ثم قم بتغيير color نص h2 إلى البط البري كذلك. أخيرا ، قم بتغيير background-color button إلى اللون البرتقالي.
+ +## Tests +
+ +```yml +tests: + - text: 'يجب أن يكون لعنصر header background-color # 09A7A1.' + testString: 'assert($("header").css("background-color") == "rgb(9, 167, 161)", "The header element should have a background-color of #09A7A1.");' + - text: 'يجب أن يكون لعنصر footer background-color # 09A7A1.' + testString: 'assert($("footer").css("background-color") == "rgb(9, 167, 161)", "The footer element should have a background-color of #09A7A1.");' + - text: 'يجب أن يكون لعنصر h2 color # 09A7A1.' + testString: 'assert($("h2").css("color") == "rgb(9, 167, 161)", "The h2 element should have a color of #09A7A1.");' + - text: 'يجب أن يكون عنصر button background-color # FF790E.' + testString: 'assert($("button").css("background-color") == "rgb(255, 121, 14)", "The button element should have a background-color of #FF790E.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+

Cooking with FCC!

+
+
+
+

Machine Learning in the Kitchen

+

Join this two day workshop that walks through how to implement cutting-edge snack-getting algorithms with a command line interface. Coding usually involves writing exact instructions, but sometimes you need your computer to execute flexible commands, like fetch Pringles.

+ +
+
+

Bisection Vegetable Chopping

+

This week-long retreat will level-up your coding ninja skills to actual ninja skills. No longer is the humble bisection search limited to sorted arrays or coding interview questions, applying its concepts in the kitchen will have you chopping carrots in O(log n) time before you know it.

+ +
+
+
+ + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/adjust-the-height-of-an-element-using-the-height-property.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/adjust-the-height-of-an-element-using-the-height-property.arabic.md new file mode 100644 index 0000000000..7a6330c4f5 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/adjust-the-height-of-an-element-using-the-height-property.arabic.md @@ -0,0 +1,83 @@ +--- +id: 587d7791367417b2b2512ab5 +title: Adjust the Height of an Element Using the height Property +challengeType: 0 +videoUrl: '' +localeTitle: ضبط ارتفاع عنصر باستخدام خاصية الارتفاع +--- + +## Description +
يمكنك تحديد ارتفاع عنصر باستخدام خاصية height في CSS ، على غرار خاصية width . في ما يلي مثال يغير ارتفاع الصورة إلى 20 بكسل:
img {
الارتفاع: 20 بكسل ؛
}
+ +## Instructions +
إضافة خاصية height إلى علامة h4 وتعيينها إلى 25 بكسل.
+ +## Tests +
+ +```yml +tests: + - text: يجب تغيير التعليمات البرمجية الخاصة بك الخاصية height h4 إلى قيمة 25 بكسل. + testString: 'assert($("h4").css("height") == "25px", "Your code should change the h4 height property to a value of 25 pixels.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+
+
+

Google

+

Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.

+
+ +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/adjust-the-hover-state-of-an-anchor-tag.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/adjust-the-hover-state-of-an-anchor-tag.arabic.md new file mode 100644 index 0000000000..b2e86f20e5 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/adjust-the-hover-state-of-an-anchor-tag.arabic.md @@ -0,0 +1,59 @@ +--- +id: 587d781d367417b2b2512ac8 +title: Adjust the Hover State of an Anchor Tag +challengeType: 0 +videoUrl: '' +localeTitle: ضبط حالة التحويم لعلامة الارتساء +--- + +## Description +
سوف يلمس هذا التحدي على استخدام الطبقات الزائفة. الفئة الزائفة هي كلمة رئيسية يمكن إضافتها إلى المحددات ، من أجل تحديد حالة معينة للعنصر. على سبيل المثال، تحت غطاء من علامة مرساة يمكن تغيير لدولة تحوم لها باستخدام :hover فئة مزيفة محدد. إليك CSS لتغيير color علامة الربط إلى اللون الأحمر أثناء حالة التمرير الخاصة بها:
a: hover {
لون احمر؛
}
+ +## Instructions +
محرر التعليمات البرمجية لديها قاعدة CSS أسلوب كل a علامات سوداء. إضافة قاعدة بحيث عند مرور المستخدم على a العلامة، و color الأزرق.
+ +## Tests +
+ +```yml +tests: + - text: 'يجب أن يظل color علامة الربط أسودًا ، مع إضافة قواعد CSS فقط لحالة :hover .' + testString: 'assert($("a").css("color") == "rgb(0, 0, 0)", "The anchor tag color should remain black, only add CSS rules for the :hover state.");' + - text: يجب أن يكون لعلامة الارتساء color أزرق عند التمرير. + testString: 'assert(code.match(/a:hover\s*?{\s*?color:\s*?blue;\s*?}/gi), "The anchor tag should have a color of blue on hover.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +CatPhotoApp + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/adjust-the-hue-of-a-color.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/adjust-the-hue-of-a-color.arabic.md new file mode 100644 index 0000000000..f2da96a2f7 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/adjust-the-hue-of-a-color.arabic.md @@ -0,0 +1,85 @@ +--- +id: 587d78a4367417b2b2512ad4 +title: Adjust the Hue of a Color +challengeType: 0 +videoUrl: '' +localeTitle: اضبط هوى اللون +--- + +## Description +
تتميز الألوان بالعديد من الخصائص بما في ذلك الصبغة والتشبع والخفة. قدم CSS3 الخاصية hsl() كطريقة بديلة لاختيار لون عن طريق تحديد هذه الخصائص بشكل مباشر. هوى هو ما يعتقده الناس بشكل عام بـ "اللون". إذا قمت بتصوير مجموعة متنوعة من الألوان تبدأ باللون الأحمر على اليسار ، تتحرك من خلال اللون الأخضر في الوسط ، والأزرق على اليمين ، حيث أن اللون يتناسب مع لون هذا الخط. في hsl() ، يستخدم hue مفهوم عجلة الألوان بدلاً من الطيف ، حيث يتم إعطاء زاوية اللون على الدائرة كقيمة بين 0 و 360. التشبع هو مقدار اللون الرمادي في اللون. لا يوجد لون رمادي كامل في أي لون مشبع ، ويكون اللون المشبع إلى حد ما رماديًا تقريبًا. يتم إعطاؤه كنسبة مئوية مع 100 ٪ مشبعة بالكامل. الخفة هي كمية اللون الأبيض أو الأسود في اللون. يتم إعطاء نسبة تتراوح من 0٪ (أسود) إلى 100٪ (أبيض) ، حيث 50٪ هو اللون الطبيعي. في ما يلي بعض الأمثلة على استخدام hsl() مع ألوان إضاءة مشبعة تمامًا ومشبعة تمامًا:
اللون HSL
أحمر hsl (0 ، 100٪ ، 50٪)
الأصفر hsl (60 ، 100٪ ، 50٪)
أخضر hsl (120 ، 100٪ ، 50٪)
ازرق سماوي hsl (180 ، 100٪ ، 50٪)
أزرق hsl (240 ، 100٪ ، 50٪)
أرجواني hsl (300 ، 100٪ ، 50٪)
+ +## Instructions +
قم بتغيير background-color كل عنصر div استنادًا إلى أسماء cyan ( green أو cyan أو blue ) باستخدام hsl() . كل ثلاثة يجب أن يكون التشبع الكامل والخفة العادية.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تستخدم التعليمات البرمجية الخاصة بك الخاصية hsl() اللون الأخضر. + testString: 'assert(code.match(/\.green\s*?{\s*?background-color:\s*?hsl/gi), "Your code should use the hsl() property to declare the color green.");' + - text: يجب أن تستخدم التعليمات البرمجية الخاصة بك الخاصية hsl() لون السماوي. + testString: 'assert(code.match(/\.cyan\s*?{\s*?background-color:\s*?hsl/gi), "Your code should use the hsl() property to declare the color cyan.");' + - text: يجب أن تستخدم التعليمات البرمجية الخاصة بك الخاصية hsl() اللون الأزرق. + testString: 'assert(code.match(/\.blue\s*?{\s*?background-color:\s*?hsl/gi), "Your code should use the hsl() property to declare the color blue.");' + - text: يجب أن يكون عنصر div green background-color خضراء. + testString: 'assert($(".green").css("background-color") == "rgb(0, 255, 0)", "The div element with class green should have a background-color of green.");' + - text: و div عنصر مع الطبقة cyan ينبغي أن يكون background-color من السماوي. + testString: 'assert($(".cyan").css("background-color") == "rgb(0, 255, 255)", "The div element with class cyan should have a background-color of cyan.");' + - text: و div عنصر مع الطبقة blue يجب أن يكون background-color من اللون الأزرق. + testString: 'assert($(".blue").css("background-color") == "rgb(0, 0, 255)", "The div element with class blue should have a background-color of blue.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/adjust-the-size-of-a-header-versus-a-paragraph-tag.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/adjust-the-size-of-a-header-versus-a-paragraph-tag.arabic.md new file mode 100644 index 0000000000..3f04ba5f84 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/adjust-the-size-of-a-header-versus-a-paragraph-tag.arabic.md @@ -0,0 +1,89 @@ +--- +id: 587d781b367417b2b2512abd +title: Adjust the Size of a Header Versus a Paragraph Tag +challengeType: 0 +videoUrl: '' +localeTitle: ضبط حجم رأس مقابل علامة فقرة +--- + +## Description +
يجب أن يكون حجم خط علامات الرأس ( h1 إلى h6 ) أكبر من حجم خط علامات الفقرة. هذا يسهل على المستخدم فهم التصميم والشكل أهمية كل شيء على الصفحة. يمكنك استخدام خاصية font-size لضبط حجم النص في عنصر.
+ +## Instructions +
لجعل العنوان أكبر بشكل ملحوظ من الفقرة ، قم بتغيير font-size علامة h4 إلى 27 بكسل.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تضيف التعليمات البرمجية الخاصة بك خاصية font-size إلى عنصر h4 لتعيين 27 بكسل. + testString: 'assert($("h4").css("font-size") == "27px", "Your code should add a font-size property to the h4 element set to 27 pixels.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+
+
+

Alphabet

+
+

Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.

+
+ +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/adjust-the-tone-of-a-color.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/adjust-the-tone-of-a-color.arabic.md new file mode 100644 index 0000000000..a1b0d532da --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/adjust-the-tone-of-a-color.arabic.md @@ -0,0 +1,89 @@ +--- +id: 587d78a4367417b2b2512ad5 +title: Adjust the Tone of a Color +challengeType: 0 +videoUrl: '' +localeTitle: اضبط نغمة اللون +--- + +## Description +
يجعل خيار hsl() في CSS أيضًا من السهل ضبط نغمة اللون. خلط الأبيض مع لون نقي يخلق صبغة من هذا اللون ، وإضافة الأسود سيجعل الظل. بدلا من ذلك ، يتم إنتاج نغمة عن طريق إضافة اللون الرمادي أو كل من التلوين والتظليل. أذكر أن 's' و 'l' من hsl() تقف للتشبع والخفة ، على التوالي. يتغير النسبة المئوية للتشبع من مقدار الرمادية ، وتحدد نسبة الإضاءة مقدار اللون الأبيض أو الأسود في اللون. يكون ذلك مفيدًا عندما يكون لديك لون أساسي يعجبك ، ولكن تحتاج إلى أشكال مختلفة منه.
+ +## Instructions +
يقوم حاليًا شريط التنقل الموجود على هذا الموقع برث background-color الخاص به من عنصر header . بدءًا من هذا اللون كقاعدة ، أضف background-color لعنصر nav بحيث يستخدم نفس اللون السماوي ، ولكنه يحتوي على 80٪ من قيم التشبع و 25٪ من الخفة لتغيير النغمة والظل.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يحتوي عنصر nav على background-color لهجة السماوي المعدلة باستخدام الخاصية hsl() . + testString: 'assert(code.match(/nav\s*?{\s*?background-color:\s*?hsl\(180,\s*?80%,\s*?25%\)/gi), "The nav element should have a background-color of the adjusted cyan tone using the hsl() property.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+

Cooking with FCC!

+ +
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/adjust-the-width-of-an-element-using-the-width-property.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/adjust-the-width-of-an-element-using-the-width-property.arabic.md new file mode 100644 index 0000000000..2ffdec8225 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/adjust-the-width-of-an-element-using-the-width-property.arabic.md @@ -0,0 +1,82 @@ +--- +id: 587d7791367417b2b2512ab4 +title: Adjust the Width of an Element Using the width Property +challengeType: 0 +videoUrl: '' +localeTitle: ضبط عرض عنصر باستخدام خاصية العرض +--- + +## Description +
يمكنك تحديد عرض عنصر باستخدام خاصية width في CSS. يمكن إعطاء القيم في وحدات الطول النسبي (مثل em) ، أو وحدات الطول المطلقة (مثل px) ، أو كنسبة مئوية من عنصر الأصل الذي يحتوي عليه. في ما يلي مثال يغير عرض الصورة إلى 220 بكسل:
img {
العرض: 220 بكسل ؛
}
+ +## Instructions +
إضافة خاصية width للبطاقة بأكملها وتعيينها إلى قيمة مطلقة تبلغ 245 بكسل. استخدم فئة fullCard لتحديد العنصر.
+ +## Tests +
+ +```yml +tests: + - text: يجب تغيير التعليمات البرمجية الخاصة بك الخاصية width للبطاقة إلى 245 بكسل باستخدام محدد فئة fullCard . + testString: 'assert(code.match(/.fullCard\s*{[\s\S][^}]*\n*^\s*width\s*:\s*245px\s*;/gm), "Your code should change the width property of the card to 245 pixels by using the fullCard class selector.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+
+
+

Google

+

Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.

+
+ +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/animate-elements-at-variable-rates.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/animate-elements-at-variable-rates.arabic.md new file mode 100644 index 0000000000..02369ea209 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/animate-elements-at-variable-rates.arabic.md @@ -0,0 +1,100 @@ +--- +id: 587d78a8367417b2b2512ae5 +title: Animate Elements at Variable Rates +challengeType: 0 +videoUrl: '' +localeTitle: عناصر متحركة بمعدلات متغيرة +--- + +## Description +
هناك مجموعة متنوعة من الطرق لتغيير معدلات الرسوم المتحركة لعناصر متحركة مشابهة. حتى الآن ، تم تحقيق ذلك من خلال تطبيق خاصية animation-iteration-count @keyframes ووضع قواعد @keyframes . ولتوضيح ذلك ، يتكون الرسم المتحرك على اليمين من "نجمين" يتناقص كل منهما في الحجم والتعتيم عند علامة 20٪ في قاعدة @keyframes ، مما يؤدي إلى إنشاء رسوم متحركة وميض. يمكنك تغيير القاعدة @keyframes لأحد العناصر بحيث @keyframes النجوم بمعدلات مختلفة.
+ +## Instructions +
عدّل معدل الرسوم المتحركة للعنصر الذي يحمل اسم فئة star-1 عن طريق تغيير القاعدة @keyframes إلى 50٪.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن @keyframes قاعدة @keyframes star-1 50٪. + testString: 'assert(code.match(/twinkle-1\s*?{\s*?50%/g), "The @keyframes rule for the star-1 class should be 50%.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/animate-elements-continually-using-an-infinite-animation-count.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/animate-elements-continually-using-an-infinite-animation-count.arabic.md new file mode 100644 index 0000000000..2f362f558b --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/animate-elements-continually-using-an-infinite-animation-count.arabic.md @@ -0,0 +1,81 @@ +--- +id: 587d78a8367417b2b2512ae3 +title: Animate Elements Continually Using an Infinite Animation Count +challengeType: 0 +videoUrl: '' +localeTitle: تنشيط عناصر باستمرار باستخدام عدد الرسوم المتحركة اللانهائي +--- + +## Description +
تغطي التحديات السابقة كيفية استخدام بعض خصائص الحركة وقاعدة @keyframes . خاصية الرسوم المتحركة الأخرى هي animation-iteration-count ، والذي يسمح لك بالتحكم في عدد المرات التي ترغب في تكرارها من خلال الرسوم المتحركة. في ما يلي مثال على ذلك: عدد مرات animation-iteration-count: 3; في هذه الحالة ، ستتوقف الرسوم المتحركة بعد تشغيلها 3 مرات ، ولكن من الممكن جعل الرسم المتحرك يعمل بشكل مستمر عن طريق تعيين هذه القيمة إلى غير محدود.
+ +## Instructions +
للحفاظ على الكرة ترتد على اليمين في حلقة مستمرة ، قم بتغيير خاصية animation-iteration-count إلى بلا حدود.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون لخاصية animation-iteration-count قيمة لانهائية. + testString: 'assert($("#ball").css("animation-iteration-count") == "infinite", "The animation-iteration-count property should have a value of infinite.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/animate-multiple-elements-at-variable-rates.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/animate-multiple-elements-at-variable-rates.arabic.md new file mode 100644 index 0000000000..88aa3ce05b --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/animate-multiple-elements-at-variable-rates.arabic.md @@ -0,0 +1,105 @@ +--- +id: 587d78a8367417b2b2512ae6 +title: Animate Multiple Elements at Variable Rates +challengeType: 0 +videoUrl: '' +localeTitle: تحريك عناصر متعددة بأسعار متغيرة +--- + +## Description +
في التحدي السابق ، قمت بتغيير معدلات الرسوم المتحركة @keyframes عن طريق تغيير قواعد @keyframes الخاصة بهم. يمكنك تحقيق الهدف نفسه عن طريق معالجة animation-duration لعناصر متعددة. في الرسم المتحرك الذي يتم تشغيله في محرر الشفرات ، هناك ثلاثة "نجوم" في السماء تتألق في نفس المعدل في حلقة مستمرة. لجعلها تومض بمعدلات مختلفة ، يمكنك تعيين خاصية animation-duration إلى قيم مختلفة لكل عنصر.
+ +## Instructions +
عيّن animation-duration للعناصر مع الفئات star-1 ، و star-2 ، و star-3 to 1s ، و 0.9s ، و 1.1s ، على التوالي.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تظل خاصية animation-duration للنجمة مع الفئة class star-1 على 1s. + testString: 'assert($(".star-1").css("animation-duration") == "1s", "The animation-duration property for the star with class star-1 should remain at 1s.");' + - text: يجب أن تكون خاصية animation-duration للنجمة ذات الفئة star-2 0.9. + testString: 'assert($(".star-2").css("animation-duration") == "0.9s", "The animation-duration property for the star with class star-2 should be 0.9s.");' + - text: يجب أن تكون animation-duration للنجمة مع الفئة class star-3 هي 1.1s. + testString: 'assert($(".star-3").css("animation-duration") == "1.1s", "The animation-duration property for the star with class star-3 should be 1.1s.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
+
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/center-an-element-horizontally-using-the-margin-property.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/center-an-element-horizontally-using-the-margin-property.arabic.md new file mode 100644 index 0000000000..a114fd5d34 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/center-an-element-horizontally-using-the-margin-property.arabic.md @@ -0,0 +1,57 @@ +--- +id: 587d78a3367417b2b2512ad0 +title: Center an Element Horizontally Using the margin Property +challengeType: 0 +videoUrl: '' +localeTitle: توسيط عنصر أفقيًا باستخدام خاصية الهامش +--- + +## Description +
أسلوب آخر لتحديد المواقع هو مركز عنصر كتلة أفقيا. إحدى الطرق للقيام بذلك هي تعيين margin الخاص به إلى قيمة تلقائي. هذه الطريقة تعمل للصور أيضا. الصور هي عناصر مضمنة افتراضيًا ، ولكن يمكن تغييرها لحظر العناصر عند تعيين خاصية display للحظر.
+ +## Instructions +
قم div على الصفحة بإضافة خاصية margin بقيمة تلقائية.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون div margin على تلقائي. + testString: 'assert(code.match(/margin:\s*?auto;/g), "The div should have a margin set to auto.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/change-an-elements-relative-position.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/change-an-elements-relative-position.arabic.md new file mode 100644 index 0000000000..5cf1ac61d9 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/change-an-elements-relative-position.arabic.md @@ -0,0 +1,61 @@ +--- +id: 587d781e367417b2b2512ac9 +title: Change an Element's Relative Position +challengeType: 0 +videoUrl: '' +localeTitle: تغيير موضع نسبي للعنصر +--- + +## Description +
تعامل CSS كل عنصر HTML كمربع خاص بها ، والذي يشار إليه عادة باسم CSS Box Model . تبدأ عناصر مستوى الحظر تلقائيًا في سطر جديد (فكّر في العناوين ، والفقرات ، والعناوين الفرعية) ، بينما تجلس العناصر المضمّنة داخل المحتوى المحيط (مثل الصور أو الامتدادات). يُسمى التنسيق الافتراضي للعناصر بهذه الطريقة normal flow للمستند ، ولكن يوفر CSS خاصية الموضع لتجاوزه. عندما يتم تعيين موضع عنصر ما إلى relative ، فإنه يتيح لك تحديد كيفية نقل CSS له بالنسبة إلى موضعه الحالي في التدفق العادي للصفحة. أزواج مع خصائص تعويض CSS من left أو right ، top أو bottom . يوضح ذلك عدد البكسلات أو النسب المئوية أو نظام الإدارة البيئية لنقل العنصر بعيدًا عن موضعه الطبيعي. المثال التالي ينقل الفقرة 10 بكسل من الأسفل:
ص {
موقف: قريب
أسفل: 10 بكسل ؛
}
لا يؤدي تغيير موضع عنصر ما إلى نسبي إلى إزالته من التدفق العادي - حيث لا تزال عناصر أخرى حوله تتصرف كما لو كان هذا العنصر في موضعه الافتراضي. ملحوظة
يمنحك التموضع الكثير من المرونة والقوة على التخطيط المرئي للصفحة. من الجيد أن نتذكر أنه بغض النظر عن موضع العناصر ، يجب تنظيم ترميز HTML الأساسي وجعله منطقيًا عند القراءة من الأعلى إلى الأسفل. هذه هي الطريقة التي يدخل بها المستخدمون الذين يعانون من إعاقات بصرية (الذين يعتمدون على أجهزة مساعدة مثل قارئات الشاشة) إلى المحتوى الخاص بك.
+ +## Instructions +
غيّر position h2 إلى relative ، واستخدم إزاحة CSS لتحريكها بمقدار 15 بكسل بعيدًا عن الجزء top من المكان الذي توجد فيه في التدفق العادي. لاحظ أنه لا يوجد أي تأثير على مواضع عناصر h1 و p المحيطة.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون لعنصر h2 خاصية position معيّنة إلى relative . + testString: 'assert($("h2").css("position") == "relative", "The h2 element should have a position property set to relative.");' + - text: يجب أن تستخدم شفرتك تخالف CSS لوضع h2 15px بشكلٍ نسبي بعيدًا عن top المكان الذي توجد فيه عادةً. + testString: 'assert($("h2").css("top") == "15px", "Your code should use a CSS offset to relatively position the h2 15px away from the top of where it normally sits.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +

On Being Well-Positioned

+

Move me!

+

I still think the h2 is where it normally sits.

+ + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/change-animation-timing-with-keywords.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/change-animation-timing-with-keywords.arabic.md new file mode 100644 index 0000000000..0502501945 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/change-animation-timing-with-keywords.arabic.md @@ -0,0 +1,89 @@ +--- +id: 587d78a8367417b2b2512ae7 +title: Change Animation Timing with Keywords +challengeType: 0 +videoUrl: '' +localeTitle: تغيير الرسوم المتحركة التوقيت مع الكلمات الرئيسية +--- + +## Description +
في الرسوم المتحركة في CSS ، تتحكم الخاصية animation-timing-function سرعة تغير عنصر متحرك خلال مدة الرسم المتحرك. إذا كانت الرسوم المتحركة عبارة عن سيارة تتحرك من النقطة A إلى النقطة B في وقت معين ( animation-duration ) ، فإن animation-timing-function توضح كيفية تسارع السيارة وتبطئها على مدار محرك الأقراص. هناك عدد من الكلمات الرئيسية المحددة مسبقًا المتاحة للخيارات الشائعة. على سبيل المثال ، القيمة الافتراضية هي ease ، والتي تبدأ بطيئة ، وتسرع في الوسط ، ثم تتباطأ مرة أخرى في النهاية. تتضمن الخيارات الأخرى ease-out ، وهو سريع في البداية ثم يبطئ ، ease-in ، وهو بطيء في البداية ، ثم يسرع في النهاية ، أو linear ، والذي يطبق سرعة حركة ثابتة طوال الوقت.
+ +## Instructions +
بالنسبة إلى العناصر ذات المعرف ball1 و ball2 ، أضف خاصية كل من animation-timing-function ، واضبط #ball1 على linear ، و #ball2 ease-out . لاحظ الفرق بين كيفية تحرك العناصر أثناء الرسم المتحرك ولكن معًا ، لأنهم يشتركون في نفس animation-duration تبلغ ثانيتين.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تكون قيمة خاصية animation-timing-function العنصر مع معرف ball1 خطية. + testString: 'assert($("#ball1").css("animation-timing-function") == "linear", "The value of the animation-timing-function property for the element with the id ball1 should be linear.");' + - text: يجب أن تكون قيمة خاصية animation-timing-function للعنصر مع معرف ball2 سهلة التخفيف. + testString: 'assert($("#ball2").css("animation-timing-function") == "ease-out", "The value of the animation-timing-function property for the element with the id ball2 should be ease-out.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/change-the-position-of-overlapping-elements-with-the-z-index-property.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/change-the-position-of-overlapping-elements-with-the-z-index-property.arabic.md new file mode 100644 index 0000000000..969563b2ab --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/change-the-position-of-overlapping-elements-with-the-z-index-property.arabic.md @@ -0,0 +1,71 @@ +--- +id: 587d78a3367417b2b2512acf +title: Change the Position of Overlapping Elements with the z-index Property +challengeType: 0 +videoUrl: '' +localeTitle: تغيير موضع تراكب العناصر مع خاصية فهرس z +--- + +## Description +
عندما يتم وضع العناصر للتراكب ، سيظهر العنصر الذي سيأتي لاحقًا في ترميز HTML ، بشكل افتراضي ، في أعلى العناصر الأخرى. ومع ذلك ، يمكن أن تحدد خاصية z-index ترتيب كيفية تكديس العناصر فوق بعضها البعض. يجب أن يكون عددًا صحيحًا (أي عددًا كاملاً وليس عشريًا) ، والقيم الأعلى لخاصية z-index لعنصر ما ، تحركه أعلى في المكدس من تلك ذات القيم الأقل.
+ +## Instructions +
إضافة خاصية z-index إلى العنصر مع اسم الفئة first (المستطيل الأحمر) وتعيينه إلى قيمة 2 بحيث يغطي العنصر الآخر (المستطيل الأزرق).
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يحتوي العنصر ذو الصنف first على قيمة z-index 2. + testString: 'assert($(".first").css("z-index") == "2", "The element with class first should have a z-index value of 2.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/create-a-gradual-css-linear-gradient.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/create-a-gradual-css-linear-gradient.arabic.md new file mode 100644 index 0000000000..e76c127a9b --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/create-a-gradual-css-linear-gradient.arabic.md @@ -0,0 +1,61 @@ +--- +id: 587d78a5367417b2b2512ad6 +title: Create a Gradual CSS Linear Gradient +challengeType: 0 +videoUrl: '' +localeTitle: إنشاء تدرج خطي متدرج CSS +--- + +## Description +
لا يقتصر تطبيق لون على عناصر HTML على لون واحد مسطح. يوفر CSS القدرة على استخدام انتقالات اللون ، والمعروفة باسم التدرجات ، على العناصر. يتم الوصول إلى هذا من خلال الدالة linear-gradient() لخاصية background . هنا الصيغة العامة: background: linear-gradient(gradient_direction, color 1, color 2, color 3, ...); تحدد الوسيطة الأولى الاتجاه الذي يبدأ منه انتقال اللون - يمكن تحديده كدرجة ، حيث يجعل 90deg تدرجًا رأسيًا ويصبح 45deg مائلًا مثل الخط المائل العكسي (Backslash). الوسيطات التالية تحدد ترتيب الألوان المستخدمة في التدرج. مثال: background: linear-gradient(90deg, red, yellow, rgb(204, 204, 255));
+ +## Instructions +
استخدم linear-gradient() background عنصر div ، #CCFFFF من اتجاه 35 درجة لتغيير اللون من #CCFFFF إلى #FFCCCC . ملحوظة
بينما هناك طرق أخرى لتحديد قيمة لون ، مثل rgb() أو hsl() ، استخدم قيم سداسية لهذا التحدي.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يحتوي عنصر div على background linear-gradient مع الاتجاه والألوان المحددين. + testString: 'assert(code.match(/background:\s*?linear-gradient\(35deg,\s*?(#CCFFFF|#CFF),\s*?(#FFCCCC|#FCC)\);/gi), "The div element should have a linear-gradient background with the specified direction and colors.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/create-a-graphic-using-css.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/create-a-graphic-using-css.arabic.md new file mode 100644 index 0000000000..f2ffaff045 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/create-a-graphic-using-css.arabic.md @@ -0,0 +1,71 @@ +--- +id: 587d78a6367417b2b2512add +title: Create a Graphic Using CSS +challengeType: 0 +videoUrl: '' +localeTitle: قم بإنشاء رسم باستخدام CSS +--- + +## Description +
من خلال التلاعب بمختصرات وخصائص مختلفة ، يمكنك عمل أشكال مثيرة للاهتمام. واحدة من أسهل في محاولة هو شكل هلال القمر. لهذا التحدي ، تحتاج إلى العمل مع خاصية box-shadow التي تقوم بتعيين ظل عنصر ، مع خاصية border-radius التي تتحكم في استدارة زوايا العنصر. سوف تقوم بإنشاء كائن مستدير وشفافة مع ظل هش يعوض قليلاً إلى الجانب - الظل سيكون في الواقع شكل القمر الذي تراه. لإنشاء كائن مستدير ، يجب تعيين الخاصية border-radius إلى قيمة 50٪. قد تتذكر من تحدي سابق أن خاصية box-shadow تأخذ قيمًا offset-x ، offset-y ، blur-radius ، و blur-radius spread-radius وقيمة اللون بهذا الترتيب. تعد قيم spread-radius blur-radius و blur-radius spread-radius اختيارية.
+ +## Instructions +
التعامل مع عنصر مربع في المحرر لإنشاء شكل القمر. أولاً ، قم بتغيير background-color إلى شفاف ، ثم قم بتعيين الخاصية border-radius إلى 50٪ لجعل الشكل الدائري. وأخيرًا ، قم بتغيير الخاصية box-shadow لتعيين offset-x إلى 25px ، و offset-y إلى 10px ، و blur-radius إلى 0 ، spread-radius إلى 0 ، و color to blue.
+ +## Tests +
+ +```yml +tests: + - text: يجب تعيين قيمة الخاصية background-color إلى transparent . + testString: 'assert(code.match(/background-color:\s*?transparent;/gi), "The value of the background-color property should be set to transparent.");' + - text: يجب تعيين قيمة خاصية border-radius إلى 50% . + testString: 'assert(code.match(/border-radius:\s*?50%;/gi), "The value of the border-radius property should be set to 50%.");' + - text: يجب تعيين قيمة الخاصية box-shadow إلى 25px للإزاحة offset-x ، و offset-x بكسل لـ offset-x offset-y ، و 0 لـ blur-radius ، و 0 لـ spread-radius ، وأخيراً اللون الأزرق للون. + testString: 'assert(code.match(/box-shadow:\s*?25px\s+?10px\s+?0(px)?\s+?0(px)?\s+?blue\s*?;/gi), "The value of the box-shadow property should be set to 25px for offset-x, 10px for offset-y, 0 for blur-radius, 0 for spread-radius, and finally blue for the color.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/create-a-horizontal-line-using-the-hr-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/create-a-horizontal-line-using-the-hr-element.arabic.md new file mode 100644 index 0000000000..310013f0dc --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/create-a-horizontal-line-using-the-hr-element.arabic.md @@ -0,0 +1,89 @@ +--- +id: 587d781b367417b2b2512abb +title: Create a Horizontal Line Using the hr Element +challengeType: 0 +videoUrl: '' +localeTitle: إنشاء خط أفقي باستخدام عنصر hr +--- + +## Description +
يمكنك استخدام علامة hr لإضافة خط أفقي عبر عرض عنصر محتواه. يمكن استخدام هذا لتعريف تغيير في الموضوع أو لفصل مجموعات المحتوى بشكل مرئي.
+ +## Instructions +
أضف علامة hr أسفل h4 التي تحتوي على عنوان البطاقة. ملحوظة
في HTML ، hr هي علامة ذاتية الإغلاق ، وبالتالي لا تحتاج إلى علامة إغلاق منفصلة.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تضيف الشفرة علامة hr إلى الترميز. + testString: 'assert($("hr").length == 1, "Your code should add an hr tag to the markup.");' + - text: يجب أن تأتي علامة hr بين العنوان والفقرة. + testString: 'assert(code.match(/<\/h4>\s*?|\s*?\/>)\s*?

/gi), "The hr tag should come between the title and the paragraph.");' + +``` + +

+ +## Challenge Seed +
+ +
+ +```html + +
+
+
+

GoogleAlphabet

+ +

Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.

+
+ +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/create-a-more-complex-shape-using-css-and-html.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/create-a-more-complex-shape-using-css-and-html.arabic.md new file mode 100644 index 0000000000..971a93cb37 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/create-a-more-complex-shape-using-css-and-html.arabic.md @@ -0,0 +1,89 @@ +--- +id: 587d78a6367417b2b2512ade +title: Create a More Complex Shape Using CSS and HTML +challengeType: 0 +videoUrl: '' +localeTitle: إنشاء شكل أكثر تعقيدًا باستخدام CSS و HTML +--- + +## Description +
واحدة من أكثر الأشكال شعبية في العالم هي شكل القلب ، وفي هذا التحدي عليك إنشاء واحد باستخدام CSS النقي. ولكن أولا ، تحتاج إلى فهم ::before و ::after pseudo-elements. يتم استخدام هذه العناصر الزائفة لإضافة شيء ما قبل أو بعد عنصر محدد. في المثال التالي ، يتم استخدام العنصر ::before pseudo-element لإضافة مستطيل إلى عنصر به heart الفئة:
.heart :: before {
يحتوى: ""؛
لون الخلفية: أصفر.
نصف قطر الحدود: 25٪ ؛
الموقع: مطلقة
الارتفاع: 50 بكسل ؛
العرض: 70 بكسل
أعلى: - 50 بكسل
اليسار: 5 بكسل ؛
}
بالنسبة لـ ::before و ::after pseudo-elements لتعمل بشكل صحيح ، يجب أن يكون لها خاصية content محددة. يتم استخدام هذه الخاصية عادةً لإضافة أشياء مثل صورة أو نص إلى العنصر المحدد. عندما يتم استخدام الـ ::before و ::after pseudo-elements لجعل الأشكال ، فإن خاصية content لا تزال مطلوبة ، لكن يتم ضبطها على سلسلة فارغة. في المثال أعلاه، عنصر مع فئة من heart لديه ::before الزائفة العنصر الذي ينتج مستطيل أصفر مع height و width من 50px 70px و، على التوالي. يحتوي هذا المستطيل على زوايا دائرية نظرًا لنصف قطره 25٪ ويتم وضعه تمامًا عند 5 بكسل من left و 50 بكسل فوق الجزء top من العنصر.
+ +## Instructions +
تحويل العنصر على الشاشة إلى القلب. في heart::after الاختيار ، قم بتغيير background-color الوردي و border-radius إلى 50٪. بعد ذلك ، استهدف العنصر heart الطبقة ( heart فقط) واملأ خاصية transform . استخدم وظيفة rotate() مع -45 درجة. (يعمل rotate() بنفس الطريقة التي يعمل بها skewX() و skewY() ). وأخيراً ، في heart::before selector ، قم بتعيين خاصية content الخاصة به إلى سلسلة فارغة.
+ +## Tests +
+ +```yml +tests: + - text: 'يجب أن تكون الخاصية background-color heart::after محدد الوردي.' + testString: 'assert(code.match(/\.heart::after\s*?{\s*?background-color\s*?:\s*?pink\s*?;/gi), "The background-color property of the heart::after selector should be pink.");' + - text: 'يجب أن يكون border-radius الحد heart::after محدد 50 ٪.' + testString: 'assert(code.match(/border-radius\s*?:\s*?50%/gi).length == 2, "The border-radius of the heart::after selector should be 50%.");' + - text: يجب أن تستخدم خاصية transform لفئة heart الدالة rotate() إلى -45 درجة. + testString: 'assert(code.match(/transform\s*?:\s*?rotate\(\s*?-45deg\s*?\)/gi), "The transform property for the heart class should use a rotate() function set to -45 degrees.");' + - text: 'يجب أن يكون content heart::before محدد سلسلة فارغة.' + testString: 'assert(code.match(/\.heart::before\s*?{\s*?content\s*?:\s*?("|")\1\s*?;/gi), "The content of the heart::before selector should be an empty string.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/create-movement-using-css-animation.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/create-movement-using-css-animation.arabic.md new file mode 100644 index 0000000000..d81fa03679 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/create-movement-using-css-animation.arabic.md @@ -0,0 +1,87 @@ +--- +id: 587d78a7367417b2b2512ae1 +title: Create Movement Using CSS Animation +challengeType: 0 +videoUrl: '' +localeTitle: إنشاء حركة باستخدام CSS الرسوم المتحركة +--- + +## Description +
عندما يكون للعنصر position محدد ، مثل fixed أو relative ، يمكن استخدام خصائص إزاحة CSS إلى right left top bottom في قواعد الرسوم المتحركة لإنشاء حركة. كما هو موضح في المثال أدناه ، يمكنك دفع العنصر إلى الأسفل ثم إلى الأعلى عن طريق تعيين الخاصية top للإطار الرئيسي 50% إلى 50 بكسل ، ولكن بعد تعيينه على 0px للأول ( 0% 100% ) والإطار الرئيسي الأخير ( 100% ).
keyframes rainbow {

لون الخلفية: أزرق ؛
العلوي: 0 بكسل ؛
}
50٪ {
background-color: green؛
العلوي: 50 بكسل
}
100٪ {
لون الخلفية: أصفر.
العلوي: 0 بكسل ؛
}
}
+ +## Instructions +
أضف حركة أفقية إلى الرسوم المتحركة div . باستخدام خاصية الإزاحة left ، قم بإضافة قاعدة @keyframes بحيث يبدأ قوس قزح عند 0 بكسل عند 0% ، وينتقل إلى 25 بكسل عند 50% ، وينتهي عند -25 بكسل عند 100% . لا تحل محل الخاصية top في المحرر - يجب أن يكون للرسوم المتحركة حركة رأسيًا وأفقيًا.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تستخدم قاعدة @keyframes لـ 0% الإزاحة left من 0px. + testString: 'assert(code.match(/0%\s*?{\s*?background-color:\s*?blue;\s*?top:\s*?0(px)?;\s*?left:\s*?0(px)?;\s*?}/gi), "The @keyframes rule for 0% should use the left offset of 0px.");' + - text: يجب أن تستخدم قاعدة @keyframes 50% الإزاحة left من 25 بكسل. + testString: 'assert(code.match(/50%\s*?{\s*?background-color:\s*?green;\s*?top:\s*?50px;\s*?left:\s*?25px;\s*?}/gi), "The @keyframes rule for 50% should use the left offset of 25px.");' + - text: يجب أن تستخدم قاعدة @keyframes لـ 100% الإزاحة left من -25 بكسل. + testString: 'assert(code.match(/100%\s*?{\s*?background-color:\s*?yellow;\s*?top:\s*?0(px)?;\s*?left:\s*?-25px;\s*?}/gi), "The @keyframes rule for 100% should use the left offset of -25px.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/create-texture-by-adding-a-subtle-pattern-as-a-background-image.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/create-texture-by-adding-a-subtle-pattern-as-a-background-image.arabic.md new file mode 100644 index 0000000000..98fa600929 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/create-texture-by-adding-a-subtle-pattern-as-a-background-image.arabic.md @@ -0,0 +1,53 @@ +--- +id: 587d78a5367417b2b2512ad8 +title: Create Texture by Adding a Subtle Pattern as a Background Image +challengeType: 0 +videoUrl: '' +localeTitle: خلق نسيج عن طريق إضافة نمط دقيق كخلفية صورة +--- + +## Description +
إحدى الطرق لإضافة الملمس والاهتمام إلى الخلفية وجعلها تبرز أكثر هي إضافة نمط دقيق. المفتاح هو التوازن ، لأنك لا تريد أن تبرز الخلفية أكثر من اللازم ، وأن تأخذها بعيدًا عن المقدمة. تدعم خاصية background وظيفة url() للربط بصورة للنسيج أو النمط المختار. يتم التفاف عنوان الارتباط بين علامات اقتباس داخل الأقواس.
+ +## Instructions +
باستخدام رابط من https://i.imgur.com/MJAkxbh.png ، تعيين background من صفحة كاملة مع body محدد.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون لعنصر body الخاص بك خاصية background معيّنة إلى url() بالرابط المحدد. + testString: 'assert(code.match(/background:\s*?url\(\s*("|"|)https:\/\/i\.imgur\.com\/MJAkxbh\.png\1\s*\)/gi), "Your body element should have a background property set to a url() with the given link.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/create-visual-balance-using-the-text-align-property.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/create-visual-balance-using-the-text-align-property.arabic.md new file mode 100644 index 0000000000..b4cf9f82a4 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/create-visual-balance-using-the-text-align-property.arabic.md @@ -0,0 +1,83 @@ +--- +id: 587d7791367417b2b2512ab3 +title: Create Visual Balance Using the text-align Property +challengeType: 0 +videoUrl: '' +localeTitle: إنشاء توازن مرئي باستخدام خاصية محاذاة النص +--- + +## Description +
يركز هذا القسم من المنهج على التصميم المرئي التطبيقي. تعتمد المجموعة الأولى من التحديات على تصميم البطاقة المعينة لإظهار عدد من المبادئ الأساسية. غالبًا ما يكون النص جزءًا كبيرًا من محتوى الويب. يحتوي CSS على عدة خيارات لكيفية محاذاةه مع خاصية text-align . text-align: justify; يتسبب في كافة أسطر النص باستثناء السطر الأخير لمقابلة الحواف اليمنى واليسرى لمربع السطر. text-align: center; مراكز النص text-align: right; محاذاة إلى اليمين text-align: left; (الافتراضي) يسار النص.
+ +## Instructions +
قم بمحاذاة نص علامة h4 ، والذي يشير إلى "Google" ، إلى المركز. ثم قم بتبرير علامة الفقرة التي تحتوي على معلومات حول كيفية تأسيس Google.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تستخدم التعليمات البرمجية الخاصة بك الخاصية محاذاة النص على علامة h4 إلى الوسط. + testString: 'assert($("h4").css("text-align") == "center", "Your code should use the text-align property on the h4 tag to set it to center.");' + - text: يجب أن تستخدم شفرتك خاصية محاذاة النص على علامة p لتعيينها لتبريرها. + testString: 'assert($("p").css("text-align") == "justify", "Your code should use the text-align property on the p tag to set it to justify.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+
+
+

Google

+

Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.

+
+ +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/create-visual-direction-by-fading-an-element-from-left-to-right.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/create-visual-direction-by-fading-an-element-from-left-to-right.arabic.md new file mode 100644 index 0000000000..ba8abb1e62 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/create-visual-direction-by-fading-an-element-from-left-to-right.arabic.md @@ -0,0 +1,76 @@ +--- +id: 587d78a7367417b2b2512ae2 +title: Create Visual Direction by Fading an Element from Left to Right +challengeType: 0 +videoUrl: '' +localeTitle: إنشاء اتجاه مرئي بواسطة Fading عنصر من اليسار إلى اليمين +--- + +## Description +
لهذا التحدي ، ستقوم بتغيير opacity عنصر متحرك بحيث يتلاشى تدريجياً عندما يصل إلى الجانب الأيمن من الشاشة. في الصورة المتحركة المعروضة ، يتحرك العنصر المستدير بخلفية التدرج إلى اليمين بواسطة علامة 50٪ للرسوم المتحركة في قاعدة @keyframes .
+ +## Instructions +
استهدف العنصر بمعرّف ball وأضف خاصية opacity إلى 0.1 عند 50% ، بحيث يتلاشى العنصر أثناء انتقاله إلى اليمين.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تحدد قاعدة keyframes opacity خاصية opacity إلى 0.1٪ عند 50٪. + testString: 'assert(code.match(/@keyframes fade\s*?{\s*?50%\s*?{\s*?(?:left:\s*?60%;\s*?opacity:\s*?0?\.1;|opacity:\s*?0?\.1;\s*?left:\s*?60%;)/gi), "The keyframes rule for fade should set the opacity property to 0.1 at 50%.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/decrease-the-opacity-of-an-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/decrease-the-opacity-of-an-element.arabic.md new file mode 100644 index 0000000000..c76fd66cc7 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/decrease-the-opacity-of-an-element.arabic.md @@ -0,0 +1,93 @@ +--- +id: 587d781c367417b2b2512abf +title: Decrease the Opacity of an Element +challengeType: 0 +videoUrl: '' +localeTitle: تقليل تعتيم عنصر +--- + +## Description +
يتم استخدام خاصية opacity في CSS لضبط العتامة ، أو العكس ، شفافية العنصر.
قيمة 1 معتمة ، وهي غير شفافة على الإطلاق.
القيمة 0.5 هي نصف شفاف.
القيمة 0 شفافة تمامًا.
سيتم تطبيق القيمة المقدمة على العنصر بأكمله ، سواء كانت هذه الصورة مع بعض الشفافية ، أو ألوان المقدمة والخلفية لكتلة من النص.
+ +## Instructions +
اضبط opacity علامات الإرساء على 0.7 باستخدام فئة links لتحديدها.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تقوم التعليمة البرمجية بتعيين الخاصية opacity إلى 0.7 على علامات الربط عن طريق تحديد فئة links . + testString: 'assert.approximately(parseFloat($(".links").css("opacity")), 0.7, 0.1, "Your code should set the opacity property to 0.7 on the anchor tags by selecting the class of links.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+
+
+

Alphabet

+
+

Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.

+
+ +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/learn-about-complementary-colors.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/learn-about-complementary-colors.arabic.md new file mode 100644 index 0000000000..b20bb3914a --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/learn-about-complementary-colors.arabic.md @@ -0,0 +1,68 @@ +--- +id: 587d78a3367417b2b2512ad1 +title: Learn about Complementary Colors +challengeType: 0 +videoUrl: '' +localeTitle: تعرف على الألوان التكميلية +--- + +## Description +
تعتبر نظرية اللون وتأثيرها على التصميم موضوعًا عميقًا ولا تغطي سوى التحديات الأساسية فقط. على موقع الويب ، يمكن للون جذب الانتباه إلى المحتوى أو إثارة المشاعر أو خلق تناغم بصري. يمكن أن يؤدي استخدام مجموعات مختلفة من الألوان إلى تغيير مظهر موقع الويب ، ويمكن أن يوضع الكثير من التفكير في اختيار لوحة ألوان تعمل مع المحتوى الخاص بك. تعد عجلة الألوان أداة مفيدة لتصور كيف ترتبط الألوان ببعضها - إنها دائرة حيث تكون درجات متشابهة من الجيران والألوان المختلفة متباعدة. عندما يكون هناك لونان في مواجهة بعضهما بعضا على عجلة القيادة ، يطلق عليهما ألوان تكميلية. لديهم ميزة أنه إذا تم دمجها ، فإنها "تلغي" بعضها البعض وتخلق لونًا رماديًا. ومع ذلك ، عند وضعها جنبًا إلى جنب ، تظهر هذه الألوان أكثر حيوية وتنتج تباينًا بصريًا قويًا. بعض الأمثلة من الألوان التكميلية مع رموزها السداسية:
الأحمر (# FF0000) والأزرق (# 00FFFF)
أخضر (# 00FF00) وأرجواني (# FF00FF)
الأزرق (# 0000FF) والأصفر (# FFFF00)
يختلف هذا عن نموذج ألوان RYB القديم الذي تم تدريسه في المدرسة ، والذي يحتوي على ألوان أساسية ومتكاملة مختلفة. تستخدم نظرية الألوان الحديثة نموذج RGB المضاف (مثل على شاشة الكمبيوتر) والطراز CMY (K) subtractive (كما في الطباعة). اقرأ هنا لمزيد من المعلومات حول هذا الموضوع المعقد. هناك العديد من أدوات اختيار الألوان المتاحة عبر الإنترنت التي لديها خيار للعثور على مجموعة مكملة للون. ملحوظة
بالنسبة إلى جميع تحديات الألوان: يمكن أن يكون استخدام اللون طريقة فعالة لإضافة الاهتمام المرئي إلى الصفحة. ومع ذلك ، لا ينبغي استخدام اللون وحده باعتباره الطريقة الوحيدة لنقل المعلومات المهمة لأن المستخدمين الذين يعانون من إعاقات بصرية قد لا يفهمون هذا المحتوى. ستتم تغطية هذه المشكلة بمزيد من التفصيل في تحديات إمكانية الوصول التطبيقية.
+ +## Instructions +
قم بتغيير خاصية background-color للفئات blue yellow إلى ألوانها الخاصة. لاحظ كيف تبدو الألوان مختلفة إلى جانب بعضها البعض مقارنة باللون الأبيض.
+ +## Tests +
+ +```yml +tests: + - text: و div عنصر مع الطبقة blue يجب أن يكون background-color من اللون الأزرق. + testString: 'assert($(".blue").css("background-color") == "rgb(0, 0, 255)", "The div element with class blue should have a background-color of blue.");' + - text: يجب أن يكون لعنصر div yellow background-color أصفر. + testString: 'assert($(".yellow").css("background-color") == "rgb(255, 255, 0)", "The div element with class yellow should have a background-color of yellow.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/learn-about-tertiary-colors.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/learn-about-tertiary-colors.arabic.md new file mode 100644 index 0000000000..c3d9c8eb71 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/learn-about-tertiary-colors.arabic.md @@ -0,0 +1,79 @@ +--- +id: 587d78a4367417b2b2512ad2 +title: Learn about Tertiary Colors +challengeType: 0 +videoUrl: '' +localeTitle: تعرف على ألوان التعليم العالي +--- + +## Description +
تعمل شاشات الكمبيوتر وشاشات الأجهزة على إنشاء ألوان مختلفة من خلال الجمع بين كميات الضوء الأحمر والأخضر والأزرق. هذا هو المعروف باسم نموذج RGB المضاف اللون في نظرية الألوان الحديثة. تسمى الأحمر (R) والأخضر (G) والأزرق (B) بالألوان الأساسية. يؤدي خلط لونين أساسيين إلى إنشاء الألوان الثانوية السماوي (G + B) والأرجواني (R + B) والأصفر (R + G). لقد رأيت هذه الألوان في تحدي الألوان التكميلية. هذه الألوان الثانوية تكون مكملة للون الأساسي غير المستخدم في إنشائها ، وهي عكس ذلك اللون الأساسي على عجلة الألوان. على سبيل المثال ، يرصد الأرجواني مع الأحمر والأزرق ، وهو مكمل للأخضر. الألوان الثلاثية هي نتيجة دمج لون أساسي مع أحد جوار الألوان الثانوية. على سبيل المثال ، الأحمر (الأساسي) والأصفر (ثانوي) جعل البرتقالي. هذا يضيف ستة ألوان إضافية إلى عجلة ألوان بسيطة لإجمالي 12 لونًا. هناك طرق مختلفة لاختيار ألوان مختلفة تؤدي إلى تركيبة متناسقة في التصميم. يسمى أحد الأمثلة التي يمكن أن تستخدم ألوان ثلاثية نظام الألوان المكملة والمقسمة. يبدأ هذا المخطط بلون أساسي ، ثم يجمعه مع لونين متاخمين لملحقه. توفر الألوان الثلاثة تباينًا بصريًا قويًا في التصميم ، ولكنها أكثر دقة من استخدام لونين متكاملين. في ما يلي ثلاث ألوان تم إنشاؤها باستخدام نظام الإنقسام المنفصل:
اللون رمز عشري
البرتقالي # FF7D00
ازرق سماوي # 00FFFF
توت العُليق # FF007D
+ +## Instructions +
قم بتغيير خاصية background-color بالفصول orange cyan raspberry إلى ألوانها الخاصة. تأكد من استخدام الشفرات السداسية كبرتقال ، وأن التوت ليس أسماء ألوان معترف بها بالمتصفح.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون لعنصر div orange background-color برتقالي. + testString: 'assert($(".orange").css("background-color") == "rgb(255, 125, 0)", "The div element with class orange should have a background-color of orange.");' + - text: و div عنصر مع الطبقة cyan ينبغي أن يكون background-color من السماوي. + testString: 'assert($(".cyan").css("background-color") == "rgb(0, 255, 255)", "The div element with class cyan should have a background-color of cyan.");' + - text: يجب أن يكون لعنصر div مع raspberry background-color للتوت. + testString: 'assert($(".raspberry").css("background-color") == "rgb(255, 0, 125)", "The div element with class raspberry should have a background-color of raspberry.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/learn-how-bezier-curves-work.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/learn-how-bezier-curves-work.arabic.md new file mode 100644 index 0000000000..55b360ab1e --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/learn-how-bezier-curves-work.arabic.md @@ -0,0 +1,89 @@ +--- +id: 587d78a9367417b2b2512ae8 +title: Learn How Bezier Curves Work +challengeType: 0 +videoUrl: '' +localeTitle: تعلم كيف بيجر المنحنيات العمل +--- + +## Description +
قدم التحدي الأخير خاصية عرض animation-timing-function وبعض الكلمات الرئيسية التي تغير سرعة الرسوم المتحركة على مدار مدتها. تقدم CSS خيارًا بخلاف الكلمات الرئيسية التي توفر تحكمًا أكثر دقة في كيفية تشغيل الرسم المتحرك ، من خلال استخدام منحنيات Bezier. في الرسوم المتحركة CSS ، يتم استخدام منحنيات Bezier مع وظيفة cubic-bezier . شكل المنحنى يمثل كيفية تشغيل الرسوم المتحركة. يعيش المنحنى على نظام إحداثي 1 في 1. المحور السيني لنظام الإحداثيات هذا هو مدة الرسم المتحرك (فكر فيه كمقياس زمني) ، والمحور الصادي هو التغيير في الرسوم المتحركة. تتكون الدالة cubic-bezier من أربع نقاط رئيسية على هذه الشبكة 1: 1: p0 ، p1 ، p2 ، p3 . يتم تعيين p0 و p3 لك - وهما نقطة البداية والنهاية التي تقع دائما على التوالي في الأصل (0 ، 0) و (1 ، 1). يمكنك تعيين قيم x و y للنقطتين الأخريين ، وحيث تضعها في الشبكة تملي شكل المنحنى الذي سيتبعه الرسم المتحرك. يتم ذلك في CSS عن طريق تعريف قيمتي x و y لنقاط " p1 و p2 في النموذج: (x1, y1, x2, y2) . سحب كل ذلك معا ، وهنا مثال لمنحنى بيزير في رمز CSS: animation-timing-function: cubic-bezier(0.25, 0.25, 0.75, 0.75); في المثال أعلاه ، تكون قيم x و y مكافئة لكل نقطة (x1 = 0.25 = y1 و x2 = 0.75 = y2) ، والتي إذا تذكرت من فئة الهندسة ، ينتج عنها خط يمتد من الأصل إلى النقطة (1) ، 1). هذا الرسم المتحرك هو تغيير خطي لعنصر خلال طول الرسم المتحرك ، وهو مماثل لاستخدام الكلمة الرئيسية linear . وبعبارة أخرى ، يتغير بسرعة ثابتة.
+ +## Instructions +
بالنسبة للعنصر الذي له معرف ball1 ، قم بتغيير قيمة خاصية animation-timing-function من linear إلى قيمة الدالة المكافئة cubic-bezier المكافئة لها. استخدم قيم النقاط الواردة في المثال أعلاه.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تكون قيمة خاصية animation-timing-function للعنصر مع معرف ball1 الخطية المكافئة. + testString: 'assert($("#ball1").css("animation-timing-function") == "cubic-bezier(0.25, 0.25, 0.75, 0.75)", "The value of the animation-timing-function property for the element with the id ball1 should be the linear-equivalent cubic-bezier function.");' + - text: يجب ألا تتغير قيمة خاصية animation-timing-function للعنصر مع معرف ball2 . + testString: 'assert($("#ball2").css("animation-timing-function") == "ease-out", "The value of the animation-timing-function property for the element with the id ball2 should not change.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/learn-how-the-css-keyframes-and-animation-properties-work.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/learn-how-the-css-keyframes-and-animation-properties-work.arabic.md new file mode 100644 index 0000000000..9e46bebbbf --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/learn-how-the-css-keyframes-and-animation-properties-work.arabic.md @@ -0,0 +1,77 @@ +--- +id: 587d78a7367417b2b2512adf +title: Learn How the CSS @keyframes and animation Properties Work +challengeType: 0 +videoUrl: '' +localeTitle: تعلم كيف تعمل CSSkeyframes وخصائص الرسوم المتحركة +--- + +## Description +
لتحريك عنصر ، تحتاج إلى معرفة خصائص الحركة وقاعدة @keyframes . تتحكم خصائص الرسم المتحرك في الكيفية التي ينبغي أن يتصرف بها @keyframes القاعدة @keyframes بما يحدث أثناء ذلك الرسم المتحرك. هناك ثمانية خصائص للرسوم المتحركة في المجموع. وهذا التحدي يبقيه بسيطة وتغطية اثنين من أهمها أولا: animation-name يحدد اسم للرسوم المتحركة، والذي يستخدم لاحقا من قبل @keyframes أن أقول CSS التي تسيطر على الذهاب مع والرسوم المتحركة. تحدد animation-duration الوقت للرسوم المتحركة. @keyframes هو كيفية تحديد ما يحدث بالضبط داخل الرسوم المتحركة على مدار المدة. يتم ذلك عن طريق إعطاء خصائص CSS "إطارات" محددة أثناء الرسوم المتحركة ، مع نسب تتراوح من 0٪ إلى 100٪. إذا قارنت هذا بفيلم ، فإن خصائص CSS لـ 0٪ هي كيفية عرض العنصر في المشهد الافتتاحي. تتمثل خصائص CSS بنسبة 100٪ في كيفية ظهور العنصر في النهاية قبل بدء القوائم مباشرةً. بعد ذلك ، يقوم CSS بتطبيق السحر على نقل العنصر خلال المدة المحددة للعمل على المشهد. في ما يلي مثال لتوضيح استخدام @keyframes وخصائص الرسم المتحرك:
#anim {
اسم الرسوم المتحركة: ملونة.
مدة الرسوم المتحركة: 3 ثوانٍ ؛
}
keyframes الملونة {

لون الخلفية: أزرق ؛
}
100٪ {
لون الخلفية: أصفر.
}
}
للعنصر مع anim الهوية، ورمز المقتطف أعلاه يحدد animation-name إلى colorful ويحدد animation-duration إلى 3 ثوان. ثم @keyframes القاعدة @keyframes بخصائص الرسم المتحرك بالاسم colorful . يضبط اللون على اللون الأزرق في بداية الرسم المتحرك (0٪) والذي سينتقل إلى اللون الأصفر بنهاية الصورة المتحركة (100٪). أنت لا تقتصر على الانتقالات في نهاية البداية فقط ، يمكنك تعيين خصائص للعنصر لأي نسبة تتراوح بين 0٪ و 100٪.
+ +## Instructions +
أنشئ rect للعنصر الذي يحتوي على rect id ، من خلال تعيين animation-name على قوس قزح animation-duration إلى 4 ثوانٍ. بعد ذلك ، قم بالإعلان عن قاعدة @keyframes ، وقم بتعيين background-color في بداية الرسم المتحرك ( 0% ) إلى اللون الأزرق ، وسط الرسم المتحرك ( 50% ) إلى اللون الأخضر ، ونهاية الحركة ( 100% ) إلى الأصفر.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون للعنصر ذو معرف rect خاصية animation-name ذات قيمة قوس قزح. + testString: 'assert($("#rect").css("animation-name") == "rainbow", "The element with id of rect should have an animation-name property with a value of rainbow.");' + - text: يجب أن يكون للعنصر ذي معرف rect خاصية animation-duration ذات قيمة 4 أضعاف. + testString: 'assert($("#rect").css("animation-duration") == "4s", "The element with id of rect should have an animation-duration property with a value of 4s.");' + - text: يجب أن تستخدم قاعدة @keyframes animation-name لقوس قزح. + testString: 'assert(code.match(/@keyframes\s+?rainbow\s*?{/g), "The @keyframes rule should use the animation-name of rainbow.");' + - text: يجب أن تستخدم قاعدة @keyframes لقوس قزح background-color أزرق عند 0٪. + testString: 'assert(code.match(/0%\s*?{\s*?background-color:\s*?blue;\s*?}/gi), "The @keyframes rule for rainbow should use a background-color of blue at 0%.");' + - text: يجب أن تستخدم قاعدة @keyframes لقوس قزح background-color خضراء بنسبة 50٪. + testString: 'assert(code.match(/50%\s*?{\s*?background-color:\s*?green;\s*?}/gi), "The @keyframes rule for rainbow should use a background-color of green at 50%.");' + - text: يجب أن تستخدم قاعدة @keyframes لقوس قزح background-color أصفر بنسبة 100٪. + testString: 'assert(code.match(/100%\s*?{\s*?background-color:\s*?yellow;\s*?}/gi), "The @keyframes rule for rainbow should use a background-color of yellow at 100%.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/lock-an-element-to-its-parent-with-absolute-positioning.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/lock-an-element-to-its-parent-with-absolute-positioning.arabic.md new file mode 100644 index 0000000000..ce46d3599d --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/lock-an-element-to-its-parent-with-absolute-positioning.arabic.md @@ -0,0 +1,72 @@ +--- +id: 587d781e367417b2b2512acb +title: Lock an Element to its Parent with Absolute Positioning +challengeType: 0 +videoUrl: '' +localeTitle: قفل عنصر إلى الوالد مع وضع مطلق +--- + +## Description +
الخيار التالي لخاصية position CSS absolute ، والذي يقوم بتثبيت العنصر في مكانه بالنسبة للحاوية الرئيسية. على عكس الوضع relative ، يؤدي هذا إلى إزالة العنصر من التدفق العادي للمستند ، لذلك فإن العناصر المحيطة به تتجاهله. يتم استخدام خصائص إزاحة CSS (أعلى أو أسفل وإلى اليسار أو اليمين) لضبط الموضع. واحد فارق بسيط مع تحديد المواقع المطلق هو أنه سيتم تأمين بالنسبة إلى أقرب السلف المتوضعة . إذا نسيت إضافة قاعدة الموضع إلى العنصر الرئيسي ، (عادة ما يتم ذلك باستخدام position: relative; ) ، سيظل المتصفح يبحث عن السلسلة وينتهي افتراضيًا بعلامة body.
+ +## Instructions +
قفل عنصر #searchbar في أعلى يمين section الأصل من خلال إعلان position أنه absolute . إعطائها top و right إزاحة من 50 بكسل لكل منهما.
+ +## Tests +
+ +```yml +tests: + - text: 'و #searchbar يجب أن يكون العنصر في position المقرر أن absolute .' + testString: 'assert($("#searchbar").css("position") == "absolute", "The #searchbar element should have a position set to absolute.");' + - text: 'يجب أن تستخدم شفرتك top إزاحة CSS بمقدار 50 بكسل في عنصر #searchbar .' + testString: 'assert($("#searchbar").css("top") == "50px", "Your code should use the top CSS offset of 50 pixels on the #searchbar element.");' + - text: 'يجب أن تستخدم شفرتك إزاحة CSS right من 50 بكسل في عنصر #searchbar .' + testString: 'assert($("#searchbar").css("right") == "50px", "Your code should use the right CSS offset of 50 pixels on the #searchbar element.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +

Welcome!

+
+ +
+ + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/lock-an-element-to-the-browser-window-with-fixed-positioning.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/lock-an-element-to-the-browser-window-with-fixed-positioning.arabic.md new file mode 100644 index 0000000000..ac8f78733e --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/lock-an-element-to-the-browser-window-with-fixed-positioning.arabic.md @@ -0,0 +1,84 @@ +--- +id: 587d781e367417b2b2512acc +title: Lock an Element to the Browser Window with Fixed Positioning +challengeType: 0 +videoUrl: '' +localeTitle: قفل عنصر إلى نافذة المتصفح مع تحديد المواقع الثابتة +--- + +## Description +
مخطط التخطيط التالي الذي يقدمه CSS هو موضع fixed ، وهو نوع من الموضع المطلق الذي يقوم بتأمين عنصر يتعلق بإطار المستعرض. مماثلة للموضع المطلق ، يتم استخدامه مع خصائص إزاحة CSS ويزيل العنصر أيضًا من التدفق العادي للمستند. عناصر أخرى لم تعد "تدرك" حيث يتم وضعها ، والتي قد تتطلب بعض التعديلات تخطيط في مكان آخر. يتمثل أحد الاختلافات الرئيسية بين المواضع fixed absolute عدم تحرك عنصر ذي موضع ثابت عند تمرير المستخدم.
+ +## Instructions +
يتم تمييز شريط التنقل في الشفرة بمعرف navbar . غيّر position ليتم fixed وإزاحته بمقدار 0 بكسل من top و 0 بكسل من left . لاحظ (عدم) التأثير على موقع h1 ، لم يتم دفعه لأسفل لاستيعاب شريط التنقل وسيتعين تعديله بشكل منفصل.
+ +## Tests +
+ +```yml +tests: + - text: 'و #navbar يجب أن يكون العنصر في position لتعيين fixed .' + testString: 'assert($("#navbar").css("position") == "fixed", "The #navbar element should have a position set to fixed.");' + - text: 'يجب أن تستخدم شفرتك top إزاحة CSS بمقدار 0 بكسل في عنصر #navbar .' + testString: 'assert($("#navbar").css("top") == "0px", "Your code should use the top CSS offset of 0 pixels on the #navbar element.");' + - text: 'يجب أن تستخدم شفرتك إزاحة CSS left من 0 بكسل في عنصر #navbar .' + testString: 'assert($("#navbar").css("left") == "0px", "Your code should use the left CSS offset of 0 pixels on the #navbar element.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+

Welcome!

+ +
+

I shift up when the #navbar is fixed to the browser window.

+ + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/make-a-css-heartbeat-using-an-infinite-animation-count.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/make-a-css-heartbeat-using-an-infinite-animation-count.arabic.md new file mode 100644 index 0000000000..2cb68c9d66 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/make-a-css-heartbeat-using-an-infinite-animation-count.arabic.md @@ -0,0 +1,119 @@ +--- +id: 587d78a8367417b2b2512ae4 +title: Make a CSS Heartbeat using an Infinite Animation Count +challengeType: 0 +videoUrl: '' +localeTitle: جعل CSS نبضات باستخدام عدد الرسوم المتحركة اللانهائي +--- + +## Description +
إليك مثالًا متحركًا مستمرًا آخر مع خاصية animation-iteration-count التي تستخدم القلب الذي صممته في تحدٍ سابق. تتألف الرسوم المتحركة ذات نبض القلب لمدة ثانية واحدة من قطعتين متحركتين. في heart العناصر (بما في ذلك :before و :after قطع) والرسوم المتحركة لتغيير حجم باستخدام transform الملكية، والخلفية div والرسوم المتحركة لتغيير لونه باستخدام background الملكية.
+ +## Instructions +
حافظ على نبض القلب بإضافة خاصية animation-iteration-count لكل من الطبقة back وفئة heart وتعيين القيمة إلى غير محدود. heart:before heart:after لا يحتاج المحددون إلى أي خصائص للرسوم المتحركة.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تكون لقيمة animation-iteration-count لفئة heart قيمة لانهائية. + testString: 'assert($(".heart").css("animation-iteration-count") == "infinite", "The animation-iteration-count property for the heart class should have a value of infinite.");' + - text: يجب أن يكون animation-iteration-count للفئة back قيمة لا نهائية. + testString: 'assert($(".back").css("animation-iteration-count") == "infinite", "The animation-iteration-count property for the back class should have a value of infinite.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/make-motion-more-natural-using-a-bezier-curve.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/make-motion-more-natural-using-a-bezier-curve.arabic.md new file mode 100644 index 0000000000..0440b9483a --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/make-motion-more-natural-using-a-bezier-curve.arabic.md @@ -0,0 +1,84 @@ +--- +id: 587d78a9367417b2b2512aea +title: Make Motion More Natural Using a Bezier Curve +challengeType: 0 +videoUrl: '' +localeTitle: جعل الحركة أكثر طبيعية باستخدام منحنى بيزيير +--- + +## Description +
هذا التحدي ينشط عنصرًا لتكرار حركة الكرة التي يتم لعبها. غطت التحديات السابقة منحنيات بيزيير المكعبة linear ease-out ، ولكن لا يصور أي منهما حركة شعوذة بدقة. تحتاج إلى تخصيص منحنى بيزير لهذا الغرض. animation-timing-function تلقائيًا في كل إطار مفتاحي عند تعيين عدد مرات تشغيل animation-iteration-count غير محدود. نظرًا لوجود قاعدة الإطار الرئيسي التي تم تعيينها في منتصف مدة الرسوم المتحركة ( 50% ) ، يؤدي ذلك إلى تقدمين متتاليين للرسوم المتحركة في حركة الكرة إلى أعلى وإلى أسفل. يحاكي المنحنى Bezier التكعيبي التالي حركة شعوذة: cubic-bezier(0.3, 0.4, 0.5, 1.6); لاحظ أن قيمة y2 أكبر من 1. على الرغم من أن المنحنى Bezier المكعّب يتم تعيينه على نظام إحداثيات 1 × 1 ، ولا يمكنه قبول سوى قيم x من 0 إلى 1 ، يمكن تعيين قيمة y لأعداد أكبر من واحد. هذا يؤدي إلى حركة كذاب مثالية لمحاكاة الكرة شعوذة.
+ +## Instructions +
تغيير قيمة animation-timing-function للعنصر مع معرف green إلى وظيفة بيكي cubic-bezier مع قيم x1 و y1 و x2 و y2 على التوالي إلى 0.311 ، 0.441 ، 0.444 ، 1.649.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تكون قيمة خاصية animation-timing-function للعنصر ذي معرف green عبارة cubic-bezier وظيفة cubic-bezier بقيم x1 و y1 و x2 و y2 كما هو محدد. + testString: 'assert($("#green").css("animation-timing-function") == "cubic-bezier(0.311, 0.441, 0.444, 1.649)", "The value of the animation-timing-function property for the element with the id green should be a cubic-bezier function with x1, y1, x2, y2 values as specified.' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/modify-fill-mode-of-an-animation.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/modify-fill-mode-of-an-animation.arabic.md new file mode 100644 index 0000000000..67125975a4 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/modify-fill-mode-of-an-animation.arabic.md @@ -0,0 +1,69 @@ +--- +id: 58a7a6ebf9a6318348e2d5aa +title: Modify Fill Mode of an Animation +challengeType: 0 +videoUrl: '' +localeTitle: تعديل وضع التعبئة من الرسوم المتحركة +--- + +## Description +
هذا رائع ، لكنه لا يعمل على الفور. لاحظ كيف تمت إعادة الرسوم المتحركة بعد مرور 500ms ثانية ، مما يتسبب في عودة الزر إلى اللون الأصلي. تريد أن يظل الزر مظللاً. يمكن القيام بذلك عن طريق تعيين خاصية animation-fill-mode إلى forwards . يحدد animation-fill-mode النمط المطبق على عنصر عندما ينتهي الرسم المتحرك. يمكنك تعيينه على النحو التالي: animation-fill-mode: forwards;
+ +## Instructions +
عيّن خاصية animation-fill-mode button:hover إلى forwards حتى يظل الزر مظللاً عندما يمرر المستخدم فوقه.
+ +## Tests +
+ +```yml +tests: + - text: 'button:hover should have a animation-fill-mode with a forwards .' + testString: 'assert(code.match(/button\s*?:\s*?hover\s*?{[\s\S]*animation-fill-mode\s*?:\s*?forwards\s*?;[\s\S]*}/gi) && code.match(/button\s*?:\s*?hover\s*?{[\s\S]*animation-name\s*?:\s*?background-color\s*?;[\s\S]*}/gi) && code.match(/button\s*?:\s*?hover\s*?{[\s\S]*animation-duration\s*?:\s*?500ms\s*?;[\s\S]*}/gi), "button:hover should have a animation-fill-mode property with a value of forwards.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/move-a-relatively-positioned-element-with-css-offsets.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/move-a-relatively-positioned-element-with-css-offsets.arabic.md new file mode 100644 index 0000000000..2f89b94b57 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/move-a-relatively-positioned-element-with-css-offsets.arabic.md @@ -0,0 +1,64 @@ +--- +id: 587d781e367417b2b2512aca +title: Move a Relatively Positioned Element with CSS Offsets +challengeType: 0 +videoUrl: '' +localeTitle: انقل عنصر تم تحديد موضعه نسبيًا باستخدام إزاحات CSS +--- + +## Description +
تخبر إزاحات CSS top أو bottom ، وإلى left أو right المتصفح عن مدى إزاحة عنصر متعلق بالمكان الذي سيجلس فيه في التدفق العادي للمستند. يتم تعويض عنصر بعيدًا عن نقطة معينة ، والتي تحرك العنصر بعيدًا عن الجانب المشار إليه (على نحو فعال ، في الاتجاه المعاكس). كما رأيت في التحدي الأخير ، فإن استخدام الإزاحة الأعلى نقل h2 الأسفل. وبالمثل ، فإن استخدام إزاحة اليسار يؤدي إلى تحريك عنصر إلى اليمين.

تعليمات

استخدم إزاحات CSS لنقل وحدات بكسل h2 15 إلى اليمين و 10 بكسل لأعلى.

اختبارات

 tests: - text: 'Your code should use a CSS offset to relatively position the <code>h2</code> 10px upwards. In other words, move it 10px away from the <code>bottom</code> of where it normally sits.' testString: 'assert($("h2").css("bottom") == "10px", "Your code should use a CSS offset to relatively position the <code>h2</code> 10px upwards. In other words, move it 10px away from the <code>bottom</code> of where it normally sits.");' - text: 'Your code should use a CSS offset to relatively position the <code>h2</code> 15px towards the right. In other words, move it 15px away from the <code>left</code> of where it normally sits.' testString: 'assert($("h2").css("left") == "15px", "Your code should use a CSS offset to relatively position the <code>h2</code> 15px towards the right. In other words, move it 15px away from the <code>left</code> of where it normally sits.");' 

بذور التحدي

 <head> <style> h2 { position: relative; } </style> </head> <body> <h1>On Being Well-Positioned</h1> <h2>Move me!</h2> <p>I still think the h2 is where it normally sits.</p> </body> 

حل

 // solution required 
+ +## Instructions +
استخدم إزاحات CSS لنقل وحدات بكسل h2 15 إلى اليمين و 10 بكسل لأعلى.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تستخدم شفرتك إزاحة CSS لوضع h2 10px صعودًا نسبيًا. بعبارة أخرى ، حركه بمقدار 10 بكسل بعيدًا عن bottom المكان الذي يجلس فيه عادةً. + testString: 'assert($("h2").css("bottom") == "10px", "Your code should use a CSS offset to relatively position the h2 10px upwards. In other words, move it 10px away from the bottom of where it normally sits.");' + - text: يجب أن تستخدم شفرتك تخالف CSS لوضع h2 15px نسبيًا نحو اليمين. بعبارة أخرى ، حركه بمقدار 15 بكسل بعيدًا عن left المكان الذي يجلس فيه عادةً. + testString: 'assert($("h2").css("left") == "15px", "Your code should use a CSS offset to relatively position the h2 15px towards the right. In other words, move it 15px away from the left of where it normally sits.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + + + +

On Being Well-Positioned

+

Move me!

+

I still think the h2 is where it normally sits.

+ + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/push-elements-left-or-right-with-the-float-property.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/push-elements-left-or-right-with-the-float-property.arabic.md new file mode 100644 index 0000000000..23928c19b5 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/push-elements-left-or-right-with-the-float-property.arabic.md @@ -0,0 +1,79 @@ +--- +id: 587d78a3367417b2b2512ace +title: Push Elements Left or Right with the float Property +challengeType: 0 +videoUrl: '' +localeTitle: دفع عناصر اليسار أو اليمين مع الخاصية العائمة +--- + +## Description +
الأداة المواقع التالية لا فعلا استخدام position ، ولكن يحدد float الملكية عنصر. تتم إزالة العناصر العائمة من التدفق العادي للمستند ودفعها إما إلى left أو right من عنصرها الأصلي المحتوي على العناصر. يتم استخدامه بشكل شائع مع خاصية width لتحديد مقدار المساحة الأفقية التي يتطلبها العنصر المضمن.
+ +## Instructions +
إن العلامات نظرا يعمل كذلك تخطيط عمودين، مع section و aside عناصر بجانب بعضها البعض. امنح العنصر #left float من left #right float على right .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يحتوي العنصر ذو المعرف left على قيمة float left . + testString: 'assert($("#left").css("float") == "left", "The element with id left should have a float value of left.");' + - text: يجب أن يكون للعنصر الذي له right معرف قيمة float من right . + testString: 'assert($("#right").css("float") == "right", "The element with id right should have a float value of right.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + + + +
+

Welcome!

+
+
+

Content

+

Good stuff

+
+ + + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/set-the-font-size-for-multiple-heading-elements.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/set-the-font-size-for-multiple-heading-elements.arabic.md new file mode 100644 index 0000000000..fd46f2d681 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/set-the-font-size-for-multiple-heading-elements.arabic.md @@ -0,0 +1,72 @@ +--- +id: 587d781c367417b2b2512ac2 +title: Set the font-size for Multiple Heading Elements +challengeType: 0 +videoUrl: '' +localeTitle: اضبط حجم الخط لعناصر العناوين المتعددة +--- + +## Description +
يتم استخدام الخاصية font-size لتحديد حجم النص في عنصر معين. يمكن استخدام هذه القاعدة لعناصر متعددة لإنشاء تناسق مرئي للنص على الصفحة. في هذا التحدي ، ستقوم بتعيين القيم لجميع علامات h1 إلى h6 لموازنة أحجام العناوين.
+ +## Instructions +
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تقوم التعليمات البرمجية بتعيين الخاصية font-size لعلامة h1 إلى 68 بكسل. + testString: 'assert($("h1").css("font-size") == "68px", "Your code should set the font-size property for the h1 tag to 68 pixels.");' + - text: يجب أن تقوم التعليمات البرمجية بتعيين الخاصية font-size للعلامة h2 إلى 52 بكسل. + testString: 'assert($("h2").css("font-size") == "52px", "Your code should set the font-size property for the h2 tag to 52 pixels.");' + - text: يجب أن تقوم التعليمات البرمجية بتعيين الخاصية font-size لعلامة h3 إلى 40 بكسل. + testString: 'assert($("h3").css("font-size") == "40px", "Your code should set the font-size property for the h3 tag to 40 pixels.");' + - text: يجب أن تقوم التعليمات البرمجية بتعيين الخاصية font-size لعلامة h4 إلى 32 بكسل. + testString: 'assert($("h4").css("font-size") == "32px", "Your code should set the font-size property for the h4 tag to 32 pixels.");' + - text: يجب أن تقوم التعليمات البرمجية بتعيين الخاصية font-size لعلامة h5 إلى 21 بكسل. + testString: 'assert($("h5").css("font-size") == "21px", "Your code should set the font-size property for the h5 tag to 21 pixels.");' + - text: يجب أن تقوم التعليمات البرمجية بتعيين الخاصية font-size لعلامة h6 إلى 14 بكسل. + testString: 'assert($("h6").css("font-size") == "14px", "Your code should set the font-size property for the h6 tag to 14 pixels.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +

This is h1 text

+

This is h2 text

+

This is h3 text

+

This is h4 text

+
This is h5 text
+
This is h6 text
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/set-the-font-size-of-paragraph-text.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/set-the-font-size-of-paragraph-text.arabic.md new file mode 100644 index 0000000000..774b04d3af --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/set-the-font-size-of-paragraph-text.arabic.md @@ -0,0 +1,56 @@ +--- +id: 587d781c367417b2b2512ac4 +title: Set the font-size of Paragraph Text +challengeType: 0 +videoUrl: '' +localeTitle: قم بتعيين حجم خط نص الفقرة +--- + +## Description +
لا تقتصر خاصية font-size في CSS على العناوين ، بل يمكن تطبيقها على أي عنصر يحتوي على نص.
+ +## Instructions +
غيّر قيمة الخاصية font-size للفقرة إلى 16 بكسل لجعلها أكثر وضوحًا.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون font-size علامة p الخاصة بك 16 بكسل. + testString: 'assert($("p").css("font-size") == "16px", "Your p tag should have a font-size of 16 pixels.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. +

+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/set-the-font-weight-for-multiple-heading-elements.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/set-the-font-weight-for-multiple-heading-elements.arabic.md new file mode 100644 index 0000000000..86e342e939 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/set-the-font-weight-for-multiple-heading-elements.arabic.md @@ -0,0 +1,90 @@ +--- +id: 587d781c367417b2b2512ac3 +title: Set the font-weight for Multiple Heading Elements +challengeType: 0 +videoUrl: '' +localeTitle: اضبط وزن الخط لعناصر العناوين المتعددة +--- + +## Description +
يمكنك تعيين font-size كل علامة عنوان في التحدي الأخير ، هنا ستقوم بتعديل font-weight . تحدد الخاصية font-weight كيفية ظهور أحرف سميكة أو رقيقة في قسم من النص.
+ +## Instructions +
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تقوم التعليمات البرمجية بتعيين الخاصية font-weight لعلامة h1 إلى 800. + testString: 'assert($("h1").css("font-weight") == "800", "Your code should set the font-weight property for the h1 tag to 800.");' + - text: يجب أن تقوم التعليمات البرمجية بتعيين الخاصية font-weight لعلامة h2 إلى 600. + testString: 'assert($("h2").css("font-weight") == "600", "Your code should set the font-weight property for the h2 tag to 600.");' + - text: يجب أن تقوم التعليمات البرمجية بتعيين الخاصية font-weight لعلامة h3 إلى 500. + testString: 'assert($("h3").css("font-weight") == "500", "Your code should set the font-weight property for the h3 tag to 500.");' + - text: يجب أن تقوم التعليمات البرمجية بتعيين الخاصية font-weight لعلامة h4 إلى 400. + testString: 'assert($("h4").css("font-weight") == "400", "Your code should set the font-weight property for the h4 tag to 400.");' + - text: يجب أن تقوم التعليمات البرمجية بتعيين الخاصية font-weight لعلامة h5 إلى 300. + testString: 'assert($("h5").css("font-weight") == "300", "Your code should set the font-weight property for the h5 tag to 300.");' + - text: يجب أن تقوم font-weight بتعيين الخاصية font-weight للعلامة h6 إلى 200. + testString: 'assert($("h6").css("font-weight") == "200", "Your code should set the font-weight property for the h6 tag to 200.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +

This is h1 text

+

This is h2 text

+

This is h3 text

+

This is h4 text

+
This is h5 text
+
This is h6 text
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/set-the-line-height-of-paragraphs.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/set-the-line-height-of-paragraphs.arabic.md new file mode 100644 index 0000000000..aa61b3c695 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/set-the-line-height-of-paragraphs.arabic.md @@ -0,0 +1,57 @@ +--- +id: 587d781d367417b2b2512ac5 +title: Set the line-height of Paragraphs +challengeType: 0 +videoUrl: '' +localeTitle: قم بتعيين ارتفاع سطر الفقرات +--- + +## Description +
توفر CSS خاصية line-height لتغيير ارتفاع كل سطر في كتلة نص. كما يوحي الاسم ، فإنه يغير مقدار المساحة العمودية التي يحصل عليها كل سطر من النص.
+ +## Instructions +
أضف خاصية line-height إلى علامة p واضبطها على 25 بكسل.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تحدد الشفرة line-height علامة p إلى 25 بكسل. + testString: 'assert($("p").css("line-height") == "25px", "Your code should set the line-height of the p tag to 25 pixels.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. +

+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-a-bezier-curve-to-move-a-graphic.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-a-bezier-curve-to-move-a-graphic.arabic.md new file mode 100644 index 0000000000..e75501ff8d --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-a-bezier-curve-to-move-a-graphic.arabic.md @@ -0,0 +1,84 @@ +--- +id: 587d78a9367417b2b2512ae9 +title: Use a Bezier Curve to Move a Graphic +challengeType: 0 +videoUrl: '' +localeTitle: استخدم منحنى Bezier لتحريك رسم +--- + +## Description +
ناقش تحدٍّ سابق الكلمة الرئيسية ease-out التي تصف تغييرًا في الرسوم المتحركة يُسرع أولاً ثم يتباطأ في نهاية الرسم المتحرك. على اليمين ، يظهر الفرق بين الكلمة الرئيسية ease-out (للعنصر الأزرق) والكلمة الرئيسية linear (للعنصر الأحمر). يمكن تحقيق تقدم الرسوم المتحركة مماثلة للكلمة الرئيسية ease-out خلال استخدام وظيفة منحنى بيزييه مكعب مخصصة. بشكل عام ، يؤدي تغيير نقاط ربط p1 و p2 إلى إنشاء منحنيات Bezier مختلفة ، والتي تتحكم في كيفية تقدم الحركة عبر الزمن. في ما يلي مثال لمنحنى بيزيير باستخدام قيم لتقليد نمط التخفيف: animation-timing-function: cubic-bezier(0, 0, 0.58, 1); تذكر أن جميع دالات cubic-bezier تبدأ بـ p0 في (0، 0) وتنتهي بـ p3 عند (1، 1). في هذا المثال ، يتحرك المنحنى بشكل أسرع خلال المحور ص (يبدأ عند 0 ، وينتقل إلى قيمة p1 y من 0 ، ثم ينتقل إلى قيمة p2 y 1) من تحركه عبر المحور X (0 إلى البداية ، ثم 0 لـ p1 ، حتى 0.58 لـ p2 ). نتيجة لذلك ، يتقدم التغيير في العنصر المتحرك بشكل أسرع من وقت الرسوم المتحركة لتلك الشريحة. باتجاه نهاية المنحنى ، تنعكس العلاقة بين التغير في قيم x و y ، حيث تتحرك قيمة y من 1 إلى 1 (بدون تغيير) ، وتتحرك قيم x من 0.58 إلى 1 ، مما يجعل تغيرات الرسوم المتحركة تقدمًا أبطأ مقارنة مدة الرسوم المتحركة.
+ +## Instructions +
لمعرفة تأثير هذا المنحنى Bezier أثناء العمل ، قم بتغيير animation-timing-function للعنصر ذي red إلى وظيفة cubic-bezier مع تعيين قيم x1 و y1 و x2 و y2 على التوالي إلى 0 ، 0 ، 0.58 ، 1 هذا سيجعل كلا العناصر يتقدمان من خلال الرسوم المتحركة بالمثل.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تكون قيمة خاصية animation-timing-function العنصر مع معرف red دالة cubic-bezier مع تعيين قيم x1 و y1 و x2 و y2 على التوالي إلى 0 ، 0 ، 0.58 ، 1. + testString: 'assert($("#red").css("animation-timing-function") == "cubic-bezier(0, 0, 0.58, 1)", "The value of the animation-timing-function property of the element with the id red should be a cubic-bezier function with x1, y1, x2, y2 values set respectively to 0, 0, 0.58, 1 .");' + - text: يجب ألا يحتوي العنصر ذو معرف red animation-timing-function خاصية animation-timing-function الخطية. + testString: 'assert($("#red").css("animation-timing-function") !== "linear", "The element with the id red should no longer have the animation-timing-function property of linear.");' + - text: يجب ألا تتغير قيمة خاصية animation-timing-function للعنصر ذي المعرف blue . + testString: 'assert($("#blue").css("animation-timing-function") == "ease-out", "The value of the animation-timing-function property for the element with the id blue should not change.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-a-css-linear-gradient-to-create-a-striped-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-a-css-linear-gradient-to-create-a-striped-element.arabic.md new file mode 100644 index 0000000000..39601f63c1 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-a-css-linear-gradient-to-create-a-striped-element.arabic.md @@ -0,0 +1,77 @@ +--- +id: 587d78a5367417b2b2512ad7 +title: Use a CSS Linear Gradient to Create a Striped Element +challengeType: 0 +videoUrl: '' +localeTitle: استخدم CSS Linear Gradient لإنشاء عنصر مخطط +--- + +## Description +
تتشابه دالة repeating-linear-gradient() إلى حد كبير مع linear-gradient() مع الفارق الرئيسي الذي يكرر نمط التدرج المحدد. ويقبل repeating-linear-gradient() مجموعة متنوعة من القيم ، ولكن من أجل البساطة ، ستعمل مع قيم زاوية وقيم توقف اللون في هذا التحدي. قيمة الزاوية هي اتجاه التدرج. تشبه نقاط توقف اللون قيم العرض التي تشير إلى مكان حدوث النقل ، ويتم تقديمها بنسبة مئوية أو عدد من وحدات البكسل. في المثال الموضحة في محرر التعليمة البرمجية ، يبدأ التدرج باللون yellow عند 0 بكسل والذي يمتزج باللون blue الثاني على بعد 40 بكسل من البداية. ونظرًا لأن توقف اللون التالي يبلغ 40 بكسل أيضًا ، يتغير التدرج فورًا إلى اللون green الثالث ، الذي يمتزج نفسه مع قيمة اللون الرابع red حيث أن هذا هو 80 بكسل بعيدًا عن بداية التدرج. في هذا المثال ، يساعد على التفكير في توقف اللون كزوجين حيث يتم مزج كل لونين معًا. 0px [yellow -- blend -- blue] 40px [green -- blend -- red] 80px إذا كان كل لونين من قيم إيقاف اللون هما نفس اللون ، فإن المزج ليس ملحوظًا لأنه بين نفس اللون ، متبوعًا بفترة انتقال صلبة إلى اللون التالي ، حتى ينتهي بك الأمر مع المشارب.
+ +## Instructions +
جعل خطوط عن طريق تغيير repeating-linear-gradient() لاستخدام زاوية التدرج من 45deg ، ثم تعيين أول لونين توقف عن اللون yellow ، وأخيرا توقف اللونين الثاني إلى اللون black .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تكون زاوية repeating-linear-gradient() 45 درجة. + testString: 'assert(code.match(/background:\s*?repeating-linear-gradient\(\s*?45deg/gi), "The angle of the repeating-linear-gradient() should be 45deg.");' + - text: يجب ألا تكون زاوية repeating-linear-gradient() 90 درجة + testString: 'assert(!code.match(/90deg/gi), "The angle of the repeating-linear-gradient() should no longer be 90deg");' + - text: يجب أن يكون لون التوقف عند 0 بكسل yellow . + testString: 'assert(code.match(/yellow\s+?0(px)?/gi), "The color stop at 0 pixels should be yellow.");' + - text: يجب أن تكون درجة اللون الواحدة عند 40 بكسل yellow . + testString: 'assert(code.match(/yellow\s+?40px/gi), "One color stop at 40 pixels should be yellow.");' + - text: يجب أن يكون اللون الثاني في 40 بكسل black . + testString: 'assert(code.match(/yellow\s+?40px,\s*?black\s+?40px/gi), "The second color stop at 40 pixels should be black.");' + - text: يجب أن تكون نقطة توقف اللون الأخيرة عند 80 بكسل black . + testString: 'assert(code.match(/black\s+?80px/gi), "The last color stop at 80 pixels should be black.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-css-animation-to-change-the-hover-state-of-a-button.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-css-animation-to-change-the-hover-state-of-a-button.arabic.md new file mode 100644 index 0000000000..a5d7e237d0 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-css-animation-to-change-the-hover-state-of-a-button.arabic.md @@ -0,0 +1,67 @@ +--- +id: 587d78a7367417b2b2512ae0 +title: Use CSS Animation to Change the Hover State of a Button +challengeType: 0 +videoUrl: '' +localeTitle: استخدم CSS Animation لتغيير حالة Hover لزر +--- + +## Description +
يمكنك استخدام @keyframes لتغيير لون زر في حالة التمرير الخاصة به. في ما يلي مثال على تغيير عرض الصورة على مؤشر الماوس:
<نمط>
img: hover {
اسم الرسوم المتحركة: العرض ؛
مدة الحركة: 500 مللي ثانية ؛
}

keyframes width {
100٪ {
العرض: 40 بكسل
}
}
</ النمط>

<img src = "https://bit.ly/smallgooglelogo" alt = "شعار Google" />
+ +## Instructions +
لاحظ أن ms يقف للمللي ثانية ، حيث 1000ms تساوي 1s. استخدم @keyframes لتغيير background-color عنصر button بحيث يصبح #4791d0 عندما #4791d0 المستخدم فوقها. يجب أن يكون لقاعدة @keyframes إدخال 100% .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تستخدم قاعدةkeyframes لون خلفية animation-name . + testString: 'assert(code.match(/@keyframes\s+?background-color\s*?{/g), "The @keyframes rule should use the animation-name background-color.");' + - text: 'يجب أن تكون هناك قاعدة واحدة تحت @keyframes تغير background-color إلى #4791d0 بنسبة 100٪.' + testString: 'assert(code.match(/100%\s*?{\s*?background-color:\s*?#4791d0;\s*?}/gi), "There should be one rule under @keyframes that changes the background-color to #4791d0 at 100%.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + + + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-the-css-transform-property-skewx-to-skew-an-element-along-the-x-axis.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-the-css-transform-property-skewx-to-skew-an-element-along-the-x-axis.arabic.md new file mode 100644 index 0000000000..8488d37f9e --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-the-css-transform-property-skewx-to-skew-an-element-along-the-x-axis.arabic.md @@ -0,0 +1,65 @@ +--- +id: 587d78a6367417b2b2512adb +title: Use the CSS Transform Property skewX to Skew an Element Along the X-Axis +challengeType: 0 +videoUrl: '' +localeTitle: استخدم skewX خاصية تحويل Transform إلى Skew an Element على طول X-Axis +--- + +## Description +
إن الوظيفة التالية لخاصية transform هي skewX() ، التي skewX() العنصر المحدد بمحاذاة X (الأفقي) بدرجة معينة. تحرف التعليمة البرمجية التالية عنصر الفقرة بمقدار -32 درجة على طول المحور X.
ص {
تحويل: skewX (-32deg) ؛
}
+ +## Instructions +
انحرف العنصر بمعرف bottom بمقدار 24 درجة على طول المحور السيني باستخدام خاصية transform .
+ +## Tests +
+ +```yml +tests: + - text: يجب تحريف العنصر ذو bottom المعرّف بمقدار 24 درجة على طول المحور السيني. + testString: 'assert(code.match(/#bottom\s*?{\s*?.*?\s*?transform:\s*?skewX\(24deg\);/g), "The element with id bottom should be skewed by 24 degrees along its X-axis.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-the-css-transform-property-skewy-to-skew-an-element-along-the-y-axis.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-the-css-transform-property-skewy-to-skew-an-element-along-the-y-axis.arabic.md new file mode 100644 index 0000000000..910f16edb4 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-the-css-transform-property-skewy-to-skew-an-element-along-the-y-axis.arabic.md @@ -0,0 +1,66 @@ +--- +id: 587d78a6367417b2b2512adc +title: Use the CSS Transform Property skewY to Skew an Element Along the Y-Axis +challengeType: 0 +videoUrl: '' +localeTitle: استخدم خاصية تحويل CSS skewY إلى Skew an Element على طول المحور ص +--- + +## Description +
وبالنظر إلى أن وظيفة skewX() العنصر المحدد على طول المحور X بواسطة درجة معينة ، فلا غرابة في أن الخاصية skewY() عنصرًا على المحور Y (الرأسي).
+ +## Instructions +
إمزج العنصر بمعرف top -10 درجات على طول المحور ص باستخدام خاصية transform .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يتم تحريف العنصر ذو top الهوية بمقدار -10 درجات على طول المحور Y. + testString: 'assert(code.match(/#top\s*?{\s*?.*?\s*?transform:\s*?skewY\(-10deg\);/g), "The element with id top should be skewed by -10 degrees along its Y-axis.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-the-css-transform-scale-property-to-change-the-size-of-an-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-the-css-transform-scale-property-to-change-the-size-of-an-element.arabic.md new file mode 100644 index 0000000000..411ff87cff --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-the-css-transform-scale-property-to-change-the-size-of-an-element.arabic.md @@ -0,0 +1,74 @@ +--- +id: 587d78a5367417b2b2512ad9 +title: Use the CSS Transform scale Property to Change the Size of an Element +challengeType: 0 +videoUrl: '' +localeTitle: استخدم خاصية مقياس تحويل CSS لتغيير حجم عنصر +--- + +## Description +
لتغيير مقياس عنصر ما ، يحتوي CSS على خاصية transform ، إلى جانب الدالة scale() . مثال الكود التالي يضاعف حجم جميع عناصر الفقرة في الصفحة:
ص {
تحويل: مقياس (2)؛
}
+ +## Instructions +
زيادة حجم العنصر مع معرف ball2 إلى 1.5 مرة حجمها الأصلي.
+ +## Tests +
+ +```yml +tests: + - text: '#ball2 خاصية transform لـ #ball2 حجمها 1.5 مرة حجمها.' + testString: 'assert(code.match(/#ball2\s*?{\s*?left:\s*?65%;\s*?transform:\s*?scale\(1\.5\);\s*?}|#ball2\s*?{\s*?transform:\s*?scale\(1\.5\);\s*?left:\s*?65%;\s*?}/gi), "Set the transform property for #ball2 to scale it 1.5 times its size.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-the-css-transform-scale-property-to-scale-an-element-on-hover.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-the-css-transform-scale-property-to-scale-an-element-on-hover.arabic.md new file mode 100644 index 0000000000..3fbe7803a7 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-the-css-transform-scale-property-to-scale-an-element-on-hover.arabic.md @@ -0,0 +1,65 @@ +--- +id: 587d78a5367417b2b2512ada +title: Use the CSS Transform scale Property to Scale an Element on Hover +challengeType: 0 +videoUrl: '' +localeTitle: استخدم خاصية مقياس تحويل CSS لقياس عنصر على التحويم +--- + +## Description +
تحتوي خاصية transform على مجموعة متنوعة من الوظائف التي تسمح لك بتوسيع نطاق عناصرك أو تحريكها أو تدويرها أو إمالتها ، إلخ. عند استخدامها مع فئات زائفة مثل :hover الذي يحدد حالة معينة لعنصر ما ، يمكن لعقار transform بسهولة إضافة تفاعلية إلى العناصر الخاصة بك. في ما يلي مثال لقياس عناصر الفقرة إلى 2.1 مرة حجمها الأصلي عندما يمرر المستخدم فوقها:
p: hover {
transform: scale (2.1)؛
}
+ +## Instructions +
إضافة قاعدة CSS ل hover حالة div واستخدام transform الملكية لقياس div عنصر إلى 1.1 مرات حجمها الأصلي عند مرور مستخدم أكثر من ذلك.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يتراوح حجم عنصر div 1.1 مرة عندما يمرر المستخدم فوقها. + testString: 'assert(code.match(/div:hover\s*?{\s*?transform:\s*?scale\(1\.1\);/gi), "The size of the div element should scale 1.1 times when the user hovers over it.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-the-em-tag-to-italicize-text.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-the-em-tag-to-italicize-text.arabic.md new file mode 100644 index 0000000000..51cb7806cc --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-the-em-tag-to-italicize-text.arabic.md @@ -0,0 +1,88 @@ +--- +id: 587d781a367417b2b2512ab9 +title: Use the em Tag to Italicize Text +challengeType: 0 +videoUrl: '' +localeTitle: استخدم علامة em لإضفاء طابع مائل على النص +--- + +## Description +
للتأكيد على النص ، يمكنك استخدام علامة em . يعرض هذا النص font-style: italic; ، حيث يقوم المستعرض بتطبيق CSS الخاص font-style: italic; إلى العنصر.
+ +## Instructions +
التفاف علامة em حول محتويات علامة الفقرة لاعطائها التركيز.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تضيف الشفرة علامة em إلى الترميز. + testString: 'assert($("em").length == 1, "Your code should add an em tag to the markup.");' + - text: يجب أن تلتف العلامة em حول محتويات علامة p ولكنها لا تحمل علامة p نفسها. + testString: 'assert($("p").children().length == 1 && $("em").children().length == 2, "The em tag should wrap around the contents of the p tag but not the p tag itself.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+
+
+

Google

+

Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.

+
+ +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-the-s-tag-to-strikethrough-text.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-the-s-tag-to-strikethrough-text.arabic.md new file mode 100644 index 0000000000..c8fe8e6d88 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-the-s-tag-to-strikethrough-text.arabic.md @@ -0,0 +1,90 @@ +--- +id: 587d781b367417b2b2512aba +title: Use the s Tag to Strikethrough Text +challengeType: 0 +videoUrl: '' +localeTitle: استخدم علامة s إلى نص يتوسطه خط +--- + +## Description +
لإنشاء خط يتوسطه النص ، وهو عندما يقطع خط أفقي عبر الأحرف ، يمكنك استخدام العلامة s . يُظهر أن جزءًا من النص لم يعد صالحًا. باستخدام علامة s ، يقوم المستعرض بتطبيق CSS من text-decoration: line-through; إلى العنصر.
+ +## Instructions +
التفاف s الكود حول "جوجل" داخل h4 العلامة ثم قم بإضافة كلمة الأبجدية بجانبه، والذي لا ينبغي أن يكون تنسيق يتوسطه خط.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تضيف الشفرة علامة s واحدة إلى الترميز. + testString: 'assert($("s").length == 1, "Your code should add one s tag to the markup.");' + - text: يجب أن تلتف العلامة s حول نص Google في علامة h4 . يجب ألا يحتوي على الكلمة الأبجدية. + testString: 'assert($("s").text().match(/Google/gi) && !$("s").text().match(/Alphabet/gi), "A s tag should wrap around the Google text in the h4 tag. It should not contain the word Alphabet.");' + - text: قم بتضمين الكلمة الأبجدية في علامة h4 ، بدون تنسيق يتوسطه خط. + testString: 'assert($("h4").html().match(/Alphabet/gi), "Include the word Alphabet in the h4 tag, without strikethrough formatting.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+
+
+

Google

+

Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.

+
+ +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-the-strong-tag-to-make-text-bold.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-the-strong-tag-to-make-text-bold.arabic.md new file mode 100644 index 0000000000..ec3eb4a7b1 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-the-strong-tag-to-make-text-bold.arabic.md @@ -0,0 +1,90 @@ +--- +id: 587d781a367417b2b2512ab7 +title: Use the strong Tag to Make Text Bold +challengeType: 0 +videoUrl: '' +localeTitle: استخدم العلامة القوية لجعل النص غامقًا +--- + +## Description +
لجعل النص عريضًا ، يمكنك استخدام العلامة strong . وغالبًا ما يستخدم هذا للفت الانتباه إلى النص ويرمز إلى أنه مهم. باستخدام العلامة strong ، يطبق المستعرض CSS font-weight: bold; إلى العنصر.
+ +## Instructions +
لف علامة strong حول "جامعة ستانفورد" داخل علامة p .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تضيف الشفرة علامة واحدة strong إلى الترميز. + testString: 'assert($("strong").length == 1, "Your code should add one strong tag to the markup.");' + - text: يجب أن تكون العلامة strong داخل علامة p . + testString: 'assert($("p").children("strong").length == 1, "The strong tag should be inside the p tag.");' + - text: يجب أن تلتف العلامة strong حول عبارة "جامعة ستانفورد". + testString: 'assert($("strong").text().match(/^Stanford University$/gi), "The strong tag should wrap around the words "Stanford University".");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+
+
+

Google

+

Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.

+
+ +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-the-text-transform-property-to-make-text-uppercase.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-the-text-transform-property-to-make-text-uppercase.arabic.md new file mode 100644 index 0000000000..d6af1fa718 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-the-text-transform-property-to-make-text-uppercase.arabic.md @@ -0,0 +1,96 @@ +--- +id: 587d781c367417b2b2512ac0 +title: Use the text-transform Property to Make Text Uppercase +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert($("h4").css("text-transform") === "uppercase", "The h4 text should be uppercase.");' + - text: '' + testString: 'assert(($("h4").text() !== $("h4").text().toUpperCase()), "The original text of the h4 should not be changed.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+
+
+

Alphabet

+
+

Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.

+
+ +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-the-u-tag-to-underline-text.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-the-u-tag-to-underline-text.arabic.md new file mode 100644 index 0000000000..b7e6853a12 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/use-the-u-tag-to-underline-text.arabic.md @@ -0,0 +1,88 @@ +--- +id: 587d781a367417b2b2512ab8 +title: Use the u Tag to Underline Text +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert($("u").length === 1, "Your code should add a u tag to the markup.");' + - text: '' + testString: 'assert($("u").text() === "Ph.D. students", "The u tag should wrap around the text "Ph.D. students".");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+
+
+

Google

+

Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.

+
+ +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/add-a-negative-margin-to-an-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/add-a-negative-margin-to-an-element.arabic.md new file mode 100644 index 0000000000..f1d001d1ca --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/add-a-negative-margin-to-an-element.arabic.md @@ -0,0 +1,86 @@ +--- +id: bad87fee1348bd9aedf08823 +title: Add a Negative Margin to an Element +challengeType: 0 +guideUrl: 'https://arabic.freecodecamp.org/guide/certificates/add-a-negative-margin-to-an-element' +videoUrl: '' +localeTitle: أضف هامشًا سلبيًا إلى عنصر +--- + +## Description +
عنصر في margin يتحكم في مقدار المسافة بين عنصر في border والعناصر المحيطة بها. إذا قمت بتعيين margin العنصر إلى قيمة سالبة ، فسيزداد حجم العنصر.
+ +## Instructions +
حاول تعيين margin إلى قيمة سالبة مثل القيمة للمربع الأحمر. غيّر margin المربع الأزرق إلى -15px ، حتى يملأ العرض الأفقي الكامل للمربع الأصفر حوله.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تعطي فئة blue-box عناصر - -15px من margin . + testString: 'assert($(".blue-box").css("margin-top") === "-15px", "Your blue-box class should give elements -15px of margin.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
padding
+
padding
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/add-borders-around-your-elements.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/add-borders-around-your-elements.arabic.md new file mode 100644 index 0000000000..5ed44a785d --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/add-borders-around-your-elements.arabic.md @@ -0,0 +1,108 @@ +--- +id: bad87fee1348bd9bedf08813 +title: Add Borders Around Your Elements +challengeType: 0 +guideUrl: 'https://arabic.freecodecamp.org/guide/certificates/add-borders-around-your-elements' +videoUrl: '' +localeTitle: أضف حدود حول عناصرك +--- + +## Description +
تحتوي حدود CSS على خصائص مثل style color width على سبيل المثال ، إذا أردنا إنشاء حد أحمر يبلغ 5 بيكسل حول عنصر HTML ، فيمكننا استخدام هذا الفصل الدراسي:
<نمط>
.thin-red-border {
لون الحدود: أحمر.
border-width: 5px؛
نمط الحدود: صلب ؛
}
</ النمط>
+ +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: يجب أن يكون لعنصر img الخاص بك فئة smaller-image . + testString: 'assert($("img").hasClass("smaller-image"), "Your img element should have the class smaller-image.");' + - text: '' + testString: 'assert($("img").hasClass("thick-green-border"), "Your img element should have the class thick-green-border.");' + - text: امنح صورتك عرضًا بحدود 10 10px . + testString: 'assert($("img").hasClass("thick-green-border") && parseInt($("img").css("border-top-width"), 10) >= 8 && parseInt($("img").css("border-top-width"), 10) <= 12, "Give your image a border width of 10px.");' + - text: امنح صورتك نمطًا حدوديًا solid . + testString: 'assert($("img").css("border-right-style") === "solid", "Give your image a border style of solid.");' + - text: '' + testString: 'assert($("img").css("border-left-color") === "rgb(0, 128, 0)", "The border around your img element should be green.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + + +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +
+

Things cats love:

+
    +
  • cat nip
  • +
  • laser pointers
  • +
  • lasagna
  • +
+

Top 3 things cats hate:

+
    +
  1. flea treatment
  2. +
  3. thunder
  4. +
  5. other cats
  6. +
+
+ +
+ +
+ + +
+ + +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/add-different-margins-to-each-side-of-an-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/add-different-margins-to-each-side-of-an-element.arabic.md new file mode 100644 index 0000000000..50b69a9f5e --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/add-different-margins-to-each-side-of-an-element.arabic.md @@ -0,0 +1,92 @@ +--- +id: bad87fee1248bd9aedf08824 +title: Add Different Margins to Each Side of an Element +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: لديك blue-box الطبقة يجب أن تعطي الجزء العلوي من عناصر 40px من margin . + testString: 'assert($(".blue-box").css("margin-top") === "40px", "Your blue-box class should give the top of elements 40px of margin.");' + - text: '' + testString: 'assert($(".blue-box").css("margin-right") === "20px", "Your blue-box class should give the right of elements 20px of margin.");' + - text: '' + testString: 'assert($(".blue-box").css("margin-bottom") === "20px", "Your blue-box class should give the bottom of elements 20px of margin.");' + - text: يجب أن تعطيك فئة blue-box يمين العناصر 40px من margin . + testString: 'assert($(".blue-box").css("margin-left") === "40px", "Your blue-box class should give the left of elements 40px of margin.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
margin
+ +
+
padding
+
padding
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/add-different-padding-to-each-side-of-an-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/add-different-padding-to-each-side-of-an-element.arabic.md new file mode 100644 index 0000000000..7310df9de3 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/add-different-padding-to-each-side-of-an-element.arabic.md @@ -0,0 +1,93 @@ +--- +id: bad87fee1348bd9aedf08824 +title: Add Different Padding to Each Side of an Element +challengeType: 0 +guideUrl: 'https://arabic.freecodecamp.org/guide/certificates/add-different-padding-to-each-side-of-an-element' +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: يجب أن تعطي 40px في blue-box أعلى العناصر 40px من padding . + testString: 'assert($(".blue-box").css("padding-top") === "40px", "Your blue-box class should give the top of the elements 40px of padding.");' + - text: يجب أن تعطي صفحتك blue-box حق العناصر المكوّنة من 20 20px من padding . + testString: 'assert($(".blue-box").css("padding-right") === "20px", "Your blue-box class should give the right of the elements 20px of padding.");' + - text: يجب أن تعطي صفحتك blue-box الجزء السفلي من العناصر 20 20px من padding . + testString: 'assert($(".blue-box").css("padding-bottom") === "20px", "Your blue-box class should give the bottom of the elements 20px of padding.");' + - text: '' + testString: 'assert($(".blue-box").css("padding-left") === "40px", "Your blue-box class should give the left of the elements 40px of padding.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
margin
+ +
+
padding
+
padding
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/add-rounded-corners-with-border-radius.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/add-rounded-corners-with-border-radius.arabic.md new file mode 100644 index 0000000000..83382a85db --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/add-rounded-corners-with-border-radius.arabic.md @@ -0,0 +1,108 @@ +--- +id: bad87fee1348bd9aedf08814 +title: Add Rounded Corners with border-radius +challengeType: 0 +guideUrl: 'https://arabic.freecodecamp.org/guide/certificates/add-rounded-corners-a-border-radius' +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert($("img").hasClass("thick-green-border"), "Your image element should have the class "thick-green-border".");' + - text: '' + testString: 'assert(parseInt($("img").css("border-top-left-radius")) > 8, "Your image should have a border radius of 10px");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + + +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +
+

Things cats love:

+
    +
  • cat nip
  • +
  • laser pointers
  • +
  • lasagna
  • +
+

Top 3 things cats hate:

+
    +
  1. flea treatment
  2. +
  3. thunder
  4. +
  5. other cats
  6. +
+
+ +
+ +
+ + +
+ + +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/adjust-the-margin-of-an-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/adjust-the-margin-of-an-element.arabic.md new file mode 100644 index 0000000000..154773b818 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/adjust-the-margin-of-an-element.arabic.md @@ -0,0 +1,87 @@ +--- +id: bad87fee1348bd9aedf08822 +title: Adjust the Margin of an Element +challengeType: 0 +guideUrl: 'https://arabic.freecodecamp.org/guide/certificates/adjust-the-margin-of-an-element' +videoUrl: '' +localeTitle: ضبط هامش عنصر +--- + +## Description +
عنصر في margin يتحكم في مقدار المسافة بين عنصر في border والعناصر المحيطة بها. هنا ، يمكننا ملاحظة أن الصندوق الأزرق والمربع الأحمر متداخلان داخل المربع الأصفر. لاحظ أن المربع الأحمر به margin أكبر من المربع الأزرق ، مما يجعله يبدو أصغر. عند زيادة margin الصندوق الأزرق ، سيزيد من المسافة بين حدوده والعناصر المحيطة به.
+ +## Instructions +
غيّر margin المربع الأزرق ليطابق ذلك المربع الأحمر.
+ +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert($(".blue-box").css("margin-top") === "20px", "Your blue-box class should give elements 20px of margin.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
margin
+ +
+
padding
+
padding
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/adjust-the-padding-of-an-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/adjust-the-padding-of-an-element.arabic.md new file mode 100644 index 0000000000..dfa9aec311 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/adjust-the-padding-of-an-element.arabic.md @@ -0,0 +1,85 @@ +--- +id: bad88fee1348bd9aedf08825 +title: Adjust the Padding of an Element +challengeType: 0 +guideUrl: 'https://arabic.freecodecamp.org/guide/certificates/adjust-the-padding-of-an-element' +videoUrl: '' +localeTitle: ضبط الحشو من عنصر +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: يجب أن تعطي فئة blue-box عناصر 20px من padding . + testString: 'assert($(".blue-box").css("padding-top") === "20px", "Your blue-box class should give elements 20px of padding.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
margin
+ +
+
padding
+
padding
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/attach-a-fallback-value-to-a-css-variable.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/attach-a-fallback-value-to-a-css-variable.arabic.md new file mode 100644 index 0000000000..b73597f515 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/attach-a-fallback-value-to-a-css-variable.arabic.md @@ -0,0 +1,254 @@ +--- +id: 5a9d7286424fe3d0e10cad13 +title: Attach a Fallback value to a CSS Variable +challengeType: 0 +videoUrl: '' +localeTitle: إرفاق قيمة الرجوع إلى متغير CSS +--- + +## Description +
عند استخدام المتغير كقيمة لعنوان CSS ، يمكنك إرفاق قيمة احتياطي سيعود متصفحك إليها إذا كان المتغير المحدد غير صالح. ملاحظة: لا يتم استخدام هذا الاحتياطي لزيادة توافق المتصفح ، ولن يعمل على متصفحات IE. بدلاً من ذلك ، يتم استخدامه بحيث يكون للمستعرض لون لعرضه إذا لم يتمكن من العثور على المتغير الخاص بك. إليك طريقة القيام بذلك:
الخلفية: var (- penguin-skin، black)؛
سيؤدي هذا إلى تعيين خلفية سوداء إذا لم يتم تعيين المتغير الخاص بك. لاحظ أن هذا يمكن أن يكون مفيدا لتصحيح الأخطاء.
+ +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: تطبيق القيمة الاحتياطية من black إلى خاصية background للفئة penguin-top . + testString: 'assert(code.match(/.penguin-top\s*?{[\s\S]*background\s*?:\s*?var\(\s*?--pengiun-skin\s*?,\s*?black\s*?\)\s*?;[\s\S]*}[\s\S]*.penguin-bottom\s{/gi), "Apply the fallback value of black to the background property of the penguin-top class.");' + - text: '' + testString: 'assert(code.match(/.penguin-bottom\s*?{[\s\S]*background\s*?:\s*?var\(\s*?--pengiun-skin\s*?,\s*?black\s*?\)\s*?;[\s\S]*}/gi), "Apply the fallback value of black to the background property of the penguin-bottom class.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/cascading-css-variables.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/cascading-css-variables.arabic.md new file mode 100644 index 0000000000..41186d8721 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/cascading-css-variables.arabic.md @@ -0,0 +1,250 @@ +--- +id: 5a9d7295424fe3d0e10cad14 +title: Cascading CSS variables +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: 'يعلن عن متغير --penguin-belly في :root --penguin-belly إلى pink .' + testString: 'assert(code.match(/:root\s*?{[\s\S]*--penguin-belly\s*?:\s*?pink\s*?;[\s\S]*}/gi), "declare the --penguin-belly variable in the :root and assign it to pink.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/change-a-variable-for-a-specific-area.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/change-a-variable-for-a-specific-area.arabic.md new file mode 100644 index 0000000000..5f31a78b44 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/change-a-variable-for-a-specific-area.arabic.md @@ -0,0 +1,252 @@ +--- +id: 5a9d72a1424fe3d0e10cad15 +title: Change a variable for a specific area +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +
عند إنشاء المتغيرات الخاصة بك في :root ، سيتم تعيين قيمة هذا المتغير للصفحة بأكملها. يمكنك بعد ذلك كتابة هذه المتغيرات عن طريق ضبطها مرة أخرى داخل عنصر محدد.
+ +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(code.match(/.penguin\s*?{[\s\S]*--penguin-belly\s*?:\s*?white\s*?;[\s\S]*}/gi), "The penguin class should reassign the --penguin-belly variable to white.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/change-the-color-of-text.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/change-the-color-of-text.arabic.md new file mode 100644 index 0000000000..5a98c1b958 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/change-the-color-of-text.arabic.md @@ -0,0 +1,81 @@ +--- +id: bad87fee1348bd9aedf08803 +title: Change the Color of Text +challengeType: 0 +videoUrl: '' +localeTitle: تغيير لون النص +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: يجب أن يكون عنصر h2 باللون الأحمر. + testString: 'assert($("h2").css("color") === "rgb(255, 0, 0)", "Your h2 element should be red.");' + - text: '' + testString: 'assert(code.match(/\s*CatPhotoApp\s*<\/h2>/)," Your style declaration should end with a ; .");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +
+

Things cats love:

+
    +
  • cat nip
  • +
  • laser pointers
  • +
  • lasagna
  • +
+

Top 3 things cats hate:

+
    +
  1. flea treatment
  2. +
  3. thunder
  4. +
  5. other cats
  6. +
+
+ +
+ +
+ + +
+ + +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/change-the-font-size-of-an-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/change-the-font-size-of-an-element.arabic.md new file mode 100644 index 0000000000..bfd2abfe59 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/change-the-font-size-of-an-element.arabic.md @@ -0,0 +1,85 @@ +--- +id: bad87fee1348bd9aedf08806 +title: Change the Font Size of an Element +challengeType: 0 +videoUrl: '' +localeTitle: تغيير حجم الخط من عنصر +--- + +## Description +
يتم التحكم في font-size الخاصية CSS font-size ، كما يلي:
h1 {
حجم الخط: 30 بكسل
}
+ +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: بين علامات style ، p العناصر p font-size 16px . يجب أن يكون حجم المتصفح ونص التكبير بنسبة 100٪. + testString: 'assert(code.match(/p\s*{\s*font-size\s*:\s*16\s*px\s*;\s*}/i), "Between the style tags, give the p elements font-size of 16px. Browser and Text zoom should be at 100%.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +
+

Things cats love:

+
    +
  • cat nip
  • +
  • laser pointers
  • +
  • lasagna
  • +
+

Top 3 things cats hate:

+
    +
  1. flea treatment
  2. +
  3. thunder
  4. +
  5. other cats
  6. +
+
+ +
+ +
+ + +
+ + +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/create-a-custom-css-variable.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/create-a-custom-css-variable.arabic.md new file mode 100644 index 0000000000..7fc7b568cf --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/create-a-custom-css-variable.arabic.md @@ -0,0 +1,245 @@ +--- +id: 5a9d726c424fe3d0e10cad11 +title: Create a custom CSS Variable +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +
في فئة penguin ، أنشئ اسمًا --penguin-skin وأعطيه قيمة gray
+ +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(code.match(/.penguin\s*?{[\s\S]*--penguin-skin\s*?:\s*?gray\s*?;[\s\S]*}/gi), "penguin class should declare the --penguin-skin variable and assign it to gray.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/give-a-background-color-to-a-div-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/give-a-background-color-to-a-div-element.arabic.md new file mode 100644 index 0000000000..e21dce016a --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/give-a-background-color-to-a-div-element.arabic.md @@ -0,0 +1,110 @@ +--- +id: bad87fed1348bd9aede07836 +title: Give a Background Color to a div Element +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +
إنشاء فئة تسمى silver-background مع background-color الفضة. قم بتعيين هذا الفصل إلى عنصر div الخاص بك.
+ +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert($("div").hasClass("silver-background"), "Give your div element the class silver-background.");' + - text: '' + testString: 'assert($("div").css("background-color") === "rgb(192, 192, 192)", "Your div element should have a silver background.");' + - text: '' + testString: 'assert(code.match(/\.silver-background\s*{\s*background-color:\s*silver;\s*}/), "Define a class named silver-background within the style element and assign the value of silver to the background-color property.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + + +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +
+

Things cats love:

+
    +
  • cat nip
  • +
  • laser pointers
  • +
  • lasagna
  • +
+

Top 3 things cats hate:

+
    +
  1. flea treatment
  2. +
  3. thunder
  4. +
  5. other cats
  6. +
+
+ +
+ +
+ + +
+ + +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/import-a-google-font.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/import-a-google-font.arabic.md new file mode 100644 index 0000000000..49fa5206ef --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/import-a-google-font.arabic.md @@ -0,0 +1,96 @@ +--- +id: bad87fee1348bd9aedf08807 +title: Import a Google Font +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +
بالإضافة إلى تحديد الخطوط العامة الموجودة في معظم أنظمة التشغيل ، يمكننا أيضًا تحديد خطوط ويب مخصصة غير قياسية للاستخدام على موقعنا على الويب. هناك مصادر متنوعة لخطوط الويب على الإنترنت ، ولكن في هذا المثال سنركز على مكتبة Google Fonts. Google Fonts هي مكتبة مجانية لخطوط الويب يمكنك استخدامها في CSS بالرجوع إلى عنوان URL الخاص بالخط. لذلك ، دعنا نمضي قدمًا ونستورد ونطبق خط Google (لاحظ أنه إذا تم حظر Google في بلدك ، فستحتاج إلى تخطي هذا التحدي). لاستيراد أحد خطوط Google ، يمكنك نسخ عنوان URL (الخطوط) من مكتبة Google Fonts ، ثم لصقه في HTML. لهذا التحدي ، سنقوم باستيراد خط Lobster . لإجراء ذلك ، انسخ مقتطف الشفرة التالي وألصقه في الجزء العلوي من محرر الشفرة (قبل عنصر style الافتتاحي): <link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css"> يمكنك الآن استخدام خط Lobster في CSS باستخدام Lobster باعتباره FAMILY_NAME كما في المثال التالي:
font-family: FAMILY_NAME, GENERIC_NAME; . GENERIC_NAME اختياري ، وهو خط احتياطي في حالة عدم توفر الخط المحدد الآخر. يتم تغطيتها في التحدي التالي. أسماء العائلة حساسة لحالة الأحرف وتحتاج إلى لفها بين علامتي تنصيص إذا كان هناك فراغ في الاسم. على سبيل المثال ، تحتاج إلى علامات اقتباس لاستخدام الخط "Open Sans" ، ولكن لا تستخدم خط Lobster .
+ +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(new RegExp("googleapis", "gi").test(code), "Import the Lobster font.");' + - text: '' + testString: 'assert($("h2").css("font-family").match(/lobster/i), "Your h2 element should use the font Lobster.");' + - text: استخدم محدد CSS h2 لتغيير الخط. + testString: 'assert(/\s*h2\s*\{\s*font-family\:\s*(\"|")?Lobster(\"|")?\s*;\s*\}/gi.test(code), "Use an h2 CSS selector to change the font.");' + - text: يجب أن يستمر عنصر p استخدام monospace للخط. + testString: 'assert($("p").css("font-family").match(/monospace/i), "Your p element should still use the font monospace.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +
+

Things cats love:

+
    +
  • cat nip
  • +
  • laser pointers
  • +
  • lasagna
  • +
+

Top 3 things cats hate:

+
    +
  1. flea treatment
  2. +
  3. thunder
  4. +
  5. other cats
  6. +
+
+ +
+ +
+ + +
+ + +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/improve-compatibility-with-browser-fallbacks.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/improve-compatibility-with-browser-fallbacks.arabic.md new file mode 100644 index 0000000000..13c967522c --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/improve-compatibility-with-browser-fallbacks.arabic.md @@ -0,0 +1,60 @@ +--- +id: 5b7d72c338cd7e35b63f3e14 +title: Improve Compatibility with Browser Fallbacks +challengeType: 0 +videoUrl: '' +localeTitle: تحسين التوافق مع Fallbacks المستعرض +--- + +## Description +
عند العمل مع CSS ، من المحتمل أن تصل إلى مشكلات توافق المستعرض في مرحلة ما. هذا هو السبب في أنه من المهم توفير fallbacks المتصفح لتجنب المشاكل المحتملة. عندما يقوم المتصفح بتوزيع CSS لصفحة ويب ، فإنه يتجاهل أي خصائص لا يتعرف عليها أو يدعمها. على سبيل المثال ، إذا كنت تستخدم متغير CSS لتعيين لون خلفية على أحد المواقع ، فسيتجاهل Internet Explorer لون الخلفية لأنه لا يدعم متغيرات CSS. في هذه الحالة ، سيستخدم المتصفح أي قيمة لديه لهذا الموقع. إذا لم يعثر على أي قيمة أخرى لهذه الخاصية ، فسيتم إرجاعها إلى القيمة الافتراضية ، والتي عادةً ما تكون غير مثالية. وهذا يعني أنه إذا كنت تريد توفير احتياطي للمتصفح ، فسيكون الأمر سهلاً مثل توفير قيمة أخرى مدعومة بشكل أوسع فورًا قبل الإعلان. وبهذه الطريقة ، سيكون للمتصفح القديم شيئًا ما يتراجع عنه ، في حين أن المتصفح الأحدث سوف يفسر أي إعلان يأتي لاحقًا في السلسلة.
+ +## Instructions +
يبدو أنه يتم استخدام متغير لضبط لون خلفية فئة .red-box . دعونا نحسن من توافق المتصفح الخاص بنا عن طريق إضافة إعلان background آخر قبل الإعلان الحالي وتعيين قيمته إلى اللون الأحمر.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تتضمن قاعدة .red-box الخاصة بك احتياطيًا مع تعيين background إلى اللون الأحمر مباشرةً قبل بيان background الموجود. + testString: 'assert(code.match(/.red-box\s*{[^}]*background:\s*(red|#ff0000|#f00|rgb\(\s*255\s*,\s*0\s*,\s*0\s*\)|rgb\(\s*100%\s*,\s*0%\s*,\s*0%\s*\)|hsl\(\s*0\s*,\s*100%\s*,\s*50%\s*\))\s*;\s*background:\s*var\(\s*--red-color\s*\);/gi), "Your .red-box rule should include a fallback with the background set to red immediately before the existing background declaration.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/inherit-styles-from-the-body-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/inherit-styles-from-the-body-element.arabic.md new file mode 100644 index 0000000000..ff7183ae60 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/inherit-styles-from-the-body-element.arabic.md @@ -0,0 +1,66 @@ +--- +id: bad87fee1348bd9aedf08746 +title: Inherit Styles from the Body Element +challengeType: 0 +videoUrl: '' +localeTitle: وراثة الأنماط من عنصر الجسم +--- + +## Description +
الآن لقد ثبت أن كل صفحة HTML لديها body عنصر، والتي لها body عنصر يمكن أيضا أن تكون على غرار مع CSS. تذكر أن بإمكانك تصميم عنصر body تمامًا مثل أي عنصر HTML آخر ، وسوف ترث جميع العناصر الأخرى أنماط عناصر body .
+ +## Instructions +
أولاً ، قم بإنشاء عنصر h1 باستخدام النص Hello World Then ، دعنا نمنح كل العناصر على صفحتك لون green بإضافة color: green; لإعلان أسلوب عنصر body . أخيرًا ، امنح عنصر body الخاص بك body عائلة monospace من خلال إضافة font-family: monospace; لإعلان أسلوب عنصر body .
+ +## Tests +
+ +```yml +tests: + - text: قم بإنشاء عنصر h1 . + testString: 'assert(($("h1").length > 0), "Create an h1 element.");' + - text: يجب أن يحتوي عنصر h1 على نص Hello World . + testString: 'assert(($("h1").length > 0 && $("h1").text().match(/hello world/i)), "Your h1 element should have the text Hello World.");' + - text: تأكد من أن عنصر h1 لديه علامة إغلاق. + testString: 'assert(code.match(/<\/h1>/g) && code.match(/

/g).length === code.match(/

h1 element has a closing tag.");' + - text: امنح body عنصر خاصية color green . + testString: 'assert(($("body").css("color") === "rgb(0, 128, 0)"), "Give your body element the color property of green.");' + - text: امنح body عنصر الخاصية monospace font-family monospace . + testString: 'assert(($("body").css("font-family").match(/monospace/i)), "Give your body element the font-family property of monospace.");' + - text: بك h1 عنصر يجب أن يرث الخط monospace من هاتفك body العنصر. + testString: 'assert(($("h1").length > 0 && $("h1").css("font-family").match(/monospace/i)), "Your h1 element should inherit the font monospace from your body element.");' + - text: بك h1 عنصر يجب أن يرث اللون الأخضر من هاتفك body العنصر. + testString: 'assert(($("h1").length > 0 && $("h1").css("color") === "rgb(0, 128, 0)"), "Your h1 element should inherit the color green from your body element.");' + +``` + +

+ +## Challenge Seed +
+ +
+ +```html + + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/make-circular-images-with-a-border-radius.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/make-circular-images-with-a-border-radius.arabic.md new file mode 100644 index 0000000000..7a09d92ac1 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/make-circular-images-with-a-border-radius.arabic.md @@ -0,0 +1,108 @@ +--- +id: bad87fee1348bd9aedf08815 +title: Make Circular Images with a border-radius +challengeType: 0 +videoUrl: '' +localeTitle: جعل الصور الدائرية مع نصف قطرها +--- + +## Description +
بالإضافة إلى وحدات البكسل ، يمكنك أيضًا تحديد نطاق border-radius باستخدام نسبة مئوية.
+ +## Instructions +
إعطاء صورة القط الخاص بك border-radius 50% .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون لشعاعك نصف قطر حدًا 50% ، مما يجعله دائريًا تمامًا. + testString: 'assert(parseInt($("img").css("border-top-left-radius")) > 48, "Your image should have a border radius of 50%, making it perfectly circular.");' + - text: تأكد من استخدام قيمة النسبة المئوية 50% . + testString: 'assert(code.match(/50%/g), "Be sure to use a percentage value of 50%.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + + +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +
+

Things cats love:

+
    +
  • cat nip
  • +
  • laser pointers
  • +
  • lasagna
  • +
+

Top 3 things cats hate:

+
    +
  1. flea treatment
  2. +
  3. thunder
  4. +
  5. other cats
  6. +
+
+ +
+ +
+ + +
+ + +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/override-all-other-styles-by-using-important.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/override-all-other-styles-by-using-important.arabic.md new file mode 100644 index 0000000000..88a2705e70 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/override-all-other-styles-by-using-important.arabic.md @@ -0,0 +1,75 @@ +--- +id: bad87fee1348bd9aedf07756 +title: Override All Other Styles by using Important +challengeType: 0 +videoUrl: '' +localeTitle: تجاوز كافة الأنماط الأخرى باستخدام هام +--- + +## Description +
ياي! لقد أثبتنا فقط أن الأنماط المضمنة ستتجاوز جميع إعلانات CSS في عنصر style . لكن انتظر. هناك طريقة أخيرة لتجاوز CSS. هذه هي أقوى طريقة للجميع. ولكن قبل القيام بذلك ، دعنا نتحدث عن سبب رغبتك في تجاوز CSS. في العديد من المواقف ، ستستخدم مكتبات CSS. قد تتجاوز هذه بطريق الخطأ CSS الخاص بك. لذلك عندما تحتاج بالتأكيد إلى التأكد من أن عنصر ما يحتوي على CSS خاص ، يمكنك استخدامه !important دعنا نرجع إلى إعلان الفصل pink-text . تذكر أنه تم تجاوز فئة pink-text لدينا بواسطة تعريفات فئة لاحقة ، وإعلانات معرف ، وأنماط مضمنة.
+ +## Instructions +
دعنا نضيف الكلمة الأساسية !important لإعلان اللون الخاص بعنصر النص الوردي الخاص بك للتأكد 100٪ من أن عنصر h1 سيكون لونه ورديًا. مثال على كيفية القيام بذلك هو: color: red !important;
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يحتوي عنصر h1 pink-text . + testString: 'assert($("h1").hasClass("pink-text"), "Your h1 element should have the class pink-text.");' + - text: يجب أن يحتوي عنصر h1 على الفصل blue-text . + testString: 'assert($("h1").hasClass("blue-text"), "Your h1 element should have the class blue-text.");' + - text: يجب أن يحتوي عنصر h1 على معرف orange-text . + testString: 'assert($("h1").attr("id") === "orange-text", "Your h1 element should have the id of orange-text.");' + - text: 'يجب أن يكون عنصر h1 بنمط color: white المضمن color: white .' + testString: 'assert(code.match(/h1 element should have the inline style of color: white.");' + - text: يجب أن يكون لديك تعريف فئة pink-text الكلمة الأساسية !important لتجاوز كافة التعريفات الأخرى. + testString: 'assert(code.match(/\.pink-text\s*?\{[\s\S]*?color:.*pink.*!important\s*;?[^\.]*\}/g), "Your pink-text class declaration should have the !important keyword to override all other declarations.");' + - text: يجب أن يكون عنصر h1 باللون الوردي. + testString: 'assert($("h1").css("color") === "rgb(255, 192, 203)", "Your h1 element should be pink.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +

Hello World!

+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/override-class-declarations-by-styling-id-attributes.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/override-class-declarations-by-styling-id-attributes.arabic.md new file mode 100644 index 0000000000..8fe08627da --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/override-class-declarations-by-styling-id-attributes.arabic.md @@ -0,0 +1,74 @@ +--- +id: bad87fee1348bd8aedf06756 +title: Override Class Declarations by Styling ID Attributes +challengeType: 0 +videoUrl: '' +localeTitle: تجاوز تعريفات الطبقة عن طريق تحديد سمات المعرف +--- + +## Description +
لقد أثبتنا فقط أن المتصفحات تقرأ CSS من الأعلى إلى الأسفل. ويعني هذا أنه في حالة وجود تعارض ، سيستخدم المتصفح أي إعلان من لغة CSS يظهر في النهاية. لكننا لم ننتهي بعد. هناك طرق أخرى يمكنك من خلالها تجاوز CSS. هل تتذكر سمات معرف؟ لنقم بتجاوز فصول blue-text pink-text blue-text ، وجعل عنصر h1 برتقاليًا ، من خلال إعطاء عنصر h1 ثم تصميم ذلك المعرف.
+ +## Instructions +
امنح عنصر h1 سمة id orange-text . تذكر أن أنماط المعرّف تبدو كالتالي: <h1 id="orange-text"> ترك فصول pink-text blue-text pink-text في عنصر h1 . قم بإنشاء تعريف CSS لمعرف orange-text الخاص بك في عنصر style الخاص بك. إليك مثال على ما يبدو عليه هذا:
# brown-text {
اللون: بني؛
}
ملاحظة: لا يهم ما إذا كنت قد أعلنت CSS هذا أعلى أو أسفل فئة النص الوردي ، نظرًا لأن سمة المعرّف ستحظى دائمًا بالأسبقية.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يحتوي عنصر h1 pink-text . + testString: 'assert($("h1").hasClass("pink-text"), "Your h1 element should have the class pink-text.");' + - text: يجب أن يحتوي عنصر h1 على الفصل blue-text . + testString: 'assert($("h1").hasClass("blue-text"), "Your h1 element should have the class blue-text.");' + - text: امنح عنصر h1 معرف orange-text . + testString: 'assert($("h1").attr("id") === "orange-text", "Give your h1 element the id of orange-text.");' + - text: يجب أن يكون هناك عنصر h1 واحد فقط. + testString: 'assert(($("h1").length === 1), "There should be only one h1 element.");' + - text: قم بإنشاء إعلان CSS لمعرف orange-text الخاص بك + testString: 'assert(code.match(/#orange-text\s*{/gi), "Create a CSS declaration for your orange-text id");' + - text: لا تعطي h1 الخاص بك أي سمات style . + testString: 'assert(!code.match(//gi), "Do not give your h1 any style attributes.");' + - text: يجب أن يكون عنصر h1 باللون البرتقالي. + testString: 'assert($("h1").css("color") === "rgb(255, 165, 0)", "Your h1 element should be orange.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +

Hello World!

+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/override-class-declarations-with-inline-styles.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/override-class-declarations-with-inline-styles.arabic.md new file mode 100644 index 0000000000..fbd2a54935 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/override-class-declarations-with-inline-styles.arabic.md @@ -0,0 +1,73 @@ +--- +id: bad87fee1348bd9aedf06756 +title: Override Class Declarations with Inline Styles +challengeType: 0 +videoUrl: '' +localeTitle: تجاوز التعريفات فئة باستخدام الأنماط المضمّنة +--- + +## Description +
لذلك قمنا ثبت أن الإعلانات معرف تجاوز الإعلانات الطبقة، بغض النظر عن مكان يتم الإعلان عنها في حياتك style CSS عنصر. هناك طرق أخرى يمكنك من خلالها تجاوز CSS. هل تتذكر الأنماط المضمنة؟
+ +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: يجب أن يحتوي عنصر h1 pink-text . + testString: 'assert($("h1").hasClass("pink-text"), "Your h1 element should have the class pink-text.");' + - text: '' + testString: 'assert($("h1").hasClass("blue-text"), "Your h1 element should have the class blue-text.");' + - text: يجب أن يحتوي عنصر h1 على معرف orange-text . + testString: 'assert($("h1").attr("id") === "orange-text", "Your h1 element should have the id of orange-text.");' + - text: '' + testString: 'assert(document.querySelector("h1[style]"), "Give your h1 element an inline style.");' + - text: يجب أن يكون عنصر h1 أبيض. + testString: 'assert($("h1").css("color") === "rgb(255, 255, 255)", "Your h1 element should be white.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +

Hello World!

+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/override-styles-in-subsequent-css.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/override-styles-in-subsequent-css.arabic.md new file mode 100644 index 0000000000..6bc76f95b9 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/override-styles-in-subsequent-css.arabic.md @@ -0,0 +1,65 @@ +--- +id: bad87fee1348bd9aedf04756 +title: Override Styles in Subsequent CSS +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +
إنشاء فئة CSS إضافية تسمى blue-text يعطي عنصر باللون الأزرق. تأكد من أنه أقل من pink-text الفصل pink-text . قم blue-text فئة blue-text على عنصر h1 بالإضافة إلى فصل pink-text ، ودعنا نرى أيهما يفوز. يتم تطبيق سمات فئات متعددة على عنصر HTML بمسافة بينها مثل: class="class1 class2" ملاحظة: لا يهم أي ترتيب يتم سرد الفئات في عنصر HTML. ومع ذلك ، فإن ترتيب إعلانات class في قسم <style> هو ما هو مهم. سوف يكون للإعلان الثاني الأسبقية على الأول. نظرًا لأنه يتم الإعلان عن .blue-text الثانية ، فإنه يؤدي إلى تجاوز سمات .pink-text
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يحتوي عنصر h1 pink-text . + testString: 'assert($("h1").hasClass("pink-text"), "Your h1 element should have the class pink-text.");' + - text: يجب أن يحتوي عنصر h1 على الفصل blue-text . + testString: 'assert($("h1").hasClass("blue-text"), "Your h1 element should have the class blue-text.");' + - text: يجب أن ينتمي blue-text pink-text إلى نفس عنصر h1 . + testString: 'assert($(".pink-text").hasClass("blue-text"), "Both blue-text and pink-text should belong to the same h1 element.");' + - text: '' + testString: 'assert($("h1").css("color") === "rgb(0, 0, 255)", "Your h1 element should be blue.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +

Hello World!

+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/prioritize-one-style-over-another.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/prioritize-one-style-over-another.arabic.md new file mode 100644 index 0000000000..4996bd5432 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/prioritize-one-style-over-another.arabic.md @@ -0,0 +1,60 @@ +--- +id: bad87fee1348bd9aedf08756 +title: Prioritize One Style Over Another +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: يجب أن يحتوي عنصر h1 pink-text . + testString: 'assert($("h1").hasClass("pink-text"), "Your h1 element should have the class pink-text.");' + - text: يجب أن يحتوي <style> على فئة CSS pink-text يغير color . + testString: 'assert(code.match(/\.pink-text\s*\{\s*color\s*:\s*.+\s*;\s*\}/g), "Your <style> should have a pink-text CSS class that changes the color.");' + - text: '' + testString: 'assert($("h1").css("color") === "rgb(255, 192, 203)", "Your h1 element should be pink.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +

Hello World!

+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/set-the-font-family-of-an-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/set-the-font-family-of-an-element.arabic.md new file mode 100644 index 0000000000..1ea5b19947 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/set-the-font-family-of-an-element.arabic.md @@ -0,0 +1,89 @@ +--- +id: bad87fee1348bd9aede08807 +title: Set the Font Family of an Element +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +
يمكنك تعيين الخط الذي يجب أن يستخدمه عنصر ما ، باستخدام خاصية font-family . على سبيل المثال ، إذا أردت تعيين خط عنصر h2 على sans-serif ، sans-serif CSS التالي:
h2 {
عائلة الخط: sans-serif؛
}
+ +## Instructions +
اجعل جميع عناصر p تستخدم خط monospace .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تستخدم عناصر p الخاصة بك monospace الخط. + testString: 'assert($("p").not(".red-text").css("font-family").match(/monospace/i), "Your p elements should use the font monospace.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +
+

Things cats love:

+
    +
  • cat nip
  • +
  • laser pointers
  • +
  • lasagna
  • +
+

Top 3 things cats hate:

+
    +
  1. flea treatment
  2. +
  3. thunder
  4. +
  5. other cats
  6. +
+
+ +
+ +
+ + +
+ + +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/set-the-id-of-an-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/set-the-id-of-an-element.arabic.md new file mode 100644 index 0000000000..da3d4fbe9b --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/set-the-id-of-an-element.arabic.md @@ -0,0 +1,110 @@ +--- +id: bad87eee1348bd9aede07836 +title: Set the id of an Element +challengeType: 0 +videoUrl: '' +localeTitle: عيّن معرف عنصر +--- + +## Description +
بالإضافة إلى الفصول الدراسية ، يمكن أن يحتوي كل عنصر HTML أيضًا على سمة id . هناك العديد من المزايا لاستخدام سمات id : يمكنك استخدام id لوضع نمط لعنصر واحد ، وبعد ذلك ستعرف أنه يمكنك استخدامها لتحديد عناصر محددة وتعديلها باستخدام جافا سكريبت. يجب أن تكون سمات id فريدة. لن تقوم المتصفحات بفرض هذا ، ولكنها أفضل الممارسات المتفق عليها على نطاق واسع. لذا يرجى عدم إعطاء أكثر من عنصر واحد نفس سمة id . في ما يلي مثال على كيفية إعطاء عنصر h2 معرف تطبيق cat-photo-app : <h2 id="cat-photo-app">
+ +## Instructions +
امنح form الخاص بك form " cat-photo-form .
+ +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert($("form").attr("id") === "cat-photo-form", "Give your form element the id of cat-photo-form.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + + +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +
+

Things cats love:

+
    +
  • cat nip
  • +
  • laser pointers
  • +
  • lasagna
  • +
+

Top 3 things cats hate:

+
    +
  1. flea treatment
  2. +
  3. thunder
  4. +
  5. other cats
  6. +
+
+ +
+ +
+ + +
+ + +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/size-your-images.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/size-your-images.arabic.md new file mode 100644 index 0000000000..50d82fd0be --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/size-your-images.arabic.md @@ -0,0 +1,97 @@ +--- +id: bad87fee1348bd9acdf08812 +title: Size Your Images +challengeType: 0 +videoUrl: '' +localeTitle: حجم صورك +--- + +## Description +
يحتوي CSS على خاصية تسمى width الذي يتحكم في عرض العنصر. تمامًا مثل الخطوط ، سنستخدم px (بكسل) لتحديد عرض الصورة. على سبيل المثال ، إذا أردنا إنشاء فئة CSS تسمى larger-image تعطي عناصر HTML عرضًا يبلغ 500 بكسل ، فسنستخدم:
<نمط>
.larger-image {
العرض: 500 بكسل ؛
}
</ النمط>
+ +## Instructions +
قم بإنشاء فئة باسم smaller-image واستخدمها لتغيير حجم الصورة بحيث يكون عرضها 100 بكسل فقط. ملحوظة
نظرًا لاختلاف تنفيذ المتصفح ، قد تحتاج إلى التكبير بنسبة 100٪ لاجتياز الاختبارات على هذا التحدي.
+ +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert($("img[src="https://bit.ly/fcc-relaxing-cat"]").attr("class") === "smaller-image", "Your img element should have the class smaller-image.");' + - text: يجب أن تكون صورتك بعرض 100 بكسل. يجب أن يكون تكبير المتصفح بنسبة 100٪. + testString: 'assert($("img").width() === 100, "Your image should be 100 pixels wide. Browser zoom should be at 100%.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + + +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +
+

Things cats love:

+
    +
  • cat nip
  • +
  • laser pointers
  • +
  • lasagna
  • +
+

Top 3 things cats hate:

+
    +
  1. flea treatment
  2. +
  3. thunder
  4. +
  5. other cats
  6. +
+
+ +
+ +
+ + +
+ + +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/specify-how-fonts-should-degrade.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/specify-how-fonts-should-degrade.arabic.md new file mode 100644 index 0000000000..a5a5805e3c --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/specify-how-fonts-should-degrade.arabic.md @@ -0,0 +1,101 @@ +--- +id: bad87fee1348bd9aedf08808 +title: Specify How Fonts Should Degrade +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: يجب أن يستخدم عنصر h2 الخط Lobster . + testString: 'assert($("h2").css("font-family").match(/^"?lobster/i), "Your h2 element should use the font Lobster.");' + - text: يجب أن يتحلل عنصر h2 إلى monospace للخط عندما لا يكون Lobster متاحًا. + testString: 'assert(/\s*h2\s*\{\s*font-family\:\s*(\"|")?Lobster(\"|")?,\s*monospace\s*;\s*\}/gi.test(code), "Your h2 element should degrade to the font monospace when Lobster is not available.");' + - text: '' + testString: 'assert(new RegExp("", "gi").test(code), "Be sure to close your comment by adding -->.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + + +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +
+

Things cats love:

+
    +
  • cat nip
  • +
  • laser pointers
  • +
  • lasagna
  • +
+

Top 3 things cats hate:

+
    +
  1. flea treatment
  2. +
  3. thunder
  4. +
  5. other cats
  6. +
+
+ +
+ +
+ + +
+ + +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/style-multiple-elements-with-a-css-class.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/style-multiple-elements-with-a-css-class.arabic.md new file mode 100644 index 0000000000..3d2349ba98 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/style-multiple-elements-with-a-css-class.arabic.md @@ -0,0 +1,93 @@ +--- +id: bad87fee1348bd9aefe08806 +title: Style Multiple Elements with a CSS Class +challengeType: 0 +videoUrl: '' +localeTitle: نمط عناصر متعددة مع فئة CSS +--- + +## Description +
تتيح لك الفئات استخدام أنماط CSS نفسها في عناصر HTML المتعددة. يمكنك رؤية ذلك من خلال تطبيق فئة red-text عنصر p الأول.
+ +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: يجب أن يكون عنصر h2 باللون الأحمر. + testString: 'assert($("h2").css("color") === "rgb(255, 0, 0)", "Your h2 element should be red.");' + - text: يجب أن يحتوي عنصر h2 red-text للفئة. + testString: 'assert($("h2").hasClass("red-text"), "Your h2 element should have the class red-text.");' + - text: يجب أن يكون عنصر p الأول باللون الأحمر. + testString: 'assert($("p:eq(0)").css("color") === "rgb(255, 0, 0)", "Your first p element should be red.");' + - text: '' + testString: 'assert(!($("p:eq(1)").css("color") === "rgb(255, 0, 0)") && !($("p:eq(2)").css("color") === "rgb(255, 0, 0)"), "Your second and third p elements should not be red.");' + - text: يجب أن يكون عنصر p الأول الخاص بك يحتوي على red-text . + testString: 'assert($("p:eq(0)").hasClass("red-text"), "Your first p element should have the class red-text.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +
+

Things cats love:

+
    +
  • cat nip
  • +
  • laser pointers
  • +
  • lasagna
  • +
+

Top 3 things cats hate:

+
    +
  1. flea treatment
  2. +
  3. thunder
  4. +
  5. other cats
  6. +
+
+ +
+ +
+ + +
+ + +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/style-the-html-body-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/style-the-html-body-element.arabic.md new file mode 100644 index 0000000000..2af778d7e1 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/style-the-html-body-element.arabic.md @@ -0,0 +1,55 @@ +--- +id: bad87fee1348bd9aedf08736 +title: Style the HTML Body Element +challengeType: 0 +videoUrl: '' +localeTitle: قم بتهيئة عنصر نص HTML +--- + +## Description +
الآن دعونا نبدأ الحديث والتحدث عن الميراث CSS. كل صفحة HTML لديها body عنصر.
+ +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert($("body").css("background-color") === "rgb(0, 0, 0)", "Give your body element the background-color of black.");' + - text: '' + testString: 'assert(code.match(/ + +``` + + + + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/understand-absolute-versus-relative-units.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/understand-absolute-versus-relative-units.arabic.md new file mode 100644 index 0000000000..c35b93c64c --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/understand-absolute-versus-relative-units.arabic.md @@ -0,0 +1,85 @@ +--- +id: bad82fee1322bd9aedf08721 +title: Understand Absolute versus Relative Units +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: يجب أن تحتوي فئة red-box خاصية padding . + testString: 'assert($(".red-box").css("padding-top") != "0px" && $(".red-box").css("padding-right") != "0px" && $(".red-box").css("padding-bottom") != "0px" && $(".red-box").css("padding-left") != "0px", "Your red-box class should have a padding property.");' + - text: يجب أن تعطي صفحتك red-box عناصر 1.5 م من padding . + testString: 'assert(code.match(/\.red-box\s*?{\s*?.*?\s*?.*?\s*?padding:\s*?1\.5em/gi), "Your red-box class should give elements 1.5em of padding.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
margin
+ +
+
padding
+
padding
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-a-css-class-to-style-an-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-a-css-class-to-style-an-element.arabic.md new file mode 100644 index 0000000000..cfb7044d83 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-a-css-class-to-style-an-element.arabic.md @@ -0,0 +1,91 @@ +--- +id: bad87fee1348bd9aecf08806 +title: Use a CSS Class to Style an Element +challengeType: 0 +videoUrl: '' +localeTitle: استخدم فئة CSS لتصميم عنصر +--- + +## Description +
تعد الطبقات أنماطًا قابلة لإعادة الاستخدام يمكن إضافتها إلى عناصر HTML. في ما يلي مثال على تصنيف فئة CSS:
<نمط>
.blue-text {
اللون الازرق؛
}
</ النمط>
يمكنك أن ترى أننا أنشأنا فئة CSS تسمى blue-text داخل علامة <style> . يمكنك تطبيق فئة إلى عنصر HTML مثل هذا: <h2 class="blue-text">CatPhotoApp</h2> لاحظ أنه في الخاص بك CSS style عنصر، أسماء فئة تبدأ بنقطة. في سمة فئة عناصر HTML ، لا يتضمن اسم الفئة الفترة.
+ +## Instructions +
داخل عنصر style الخاص بك ، قم بتغيير محدد h2 إلى .red-text محدد .red-text بتحديث قيمة blue من blue إلى red . امنح عنصر h2 عنصر السمة class بقيمة 'red-text' .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون عنصر h2 باللون الأحمر. + testString: 'assert($("h2").css("color") === "rgb(255, 0, 0)", "Your h2 element should be red.");' + - text: يجب أن يحتوي عنصر h2 red-text للفئة. + testString: 'assert($("h2").hasClass("red-text"), "Your h2 element should have the class red-text.");' + - text: يجب أن تعلن ورقة الأنماط الخاصة بك عن فئة red-text وأن يكون لونها أحمر. + testString: 'assert(code.match(/\.red-text\s*\{\s*color\s*:\s*red;\s*\}/g), "Your stylesheet should declare a red-text class and have its color set to red.");' + - text: 'لا تستخدم إعلانات نمط مضمن مثل style="color: red" في عنصر h2 .' + testString: 'assert($("h2").attr("style") === undefined, "Do not use inline style declarations like style="color: red" in your h2 element.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +
+

Things cats love:

+
    +
  • cat nip
  • +
  • laser pointers
  • +
  • lasagna
  • +
+

Top 3 things cats hate:

+
    +
  1. flea treatment
  2. +
  3. thunder
  4. +
  5. other cats
  6. +
+
+ +
+ +
+ + +
+ + +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-a-custom-css-variable.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-a-custom-css-variable.arabic.md new file mode 100644 index 0000000000..0302660da1 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-a-custom-css-variable.arabic.md @@ -0,0 +1,264 @@ +--- +id: 5a9d727a424fe3d0e10cad12 +title: Use a custom CSS Variable +challengeType: 0 +videoUrl: '' +localeTitle: استخدم متغير CSS مخصص +--- + +## Description +
بعد إنشاء المتغير ، يمكنك تعيين قيمته إلى خصائص CSS الأخرى عن طريق الرجوع إلى الاسم الذي قدمته.
الخلفية: var (- penguin-skin)؛
سيؤدي ذلك إلى تغيير خلفية أي عنصر تستهدفه باللون الرمادي لأن هذه هي قيمة --penguin-skin . لاحظ أنه لن يتم تطبيق الأنماط إلا إذا كانت أسماء المتغيرات مطابقة تمامًا.
+ +## Instructions +
تطبيق متغير --penguin-skin إلى الخاصية background --penguin-skin penguin-top ، penguin-bottom ، right-hand left-hand .
+ +## Tests +
+ +```yml +tests: + - text: تطبيق متغير --penguin-skin إلى الخاصية background للفئة penguin-top . + testString: 'assert(code.match(/.penguin-top\s*?{[\s\S]*background\s*?:\s*?var\s*?\(\s*?--penguin-skin\s*?\)\s*?;[\s\S]*}[\s\S]*.penguin-bottom\s{/gi), "Apply the --penguin-skin variable to the background property of the penguin-top class.");' + - text: تطبيق متغير --penguin-skin إلى خاصية background للفئة penguin-bottom . + testString: 'assert(code.match(/.penguin-bottom\s*?{[\s\S]*background\s*?:\s*?var\s*?\(\s*?--penguin-skin\s*?\)\s*?;[\s\S]*}[\s\S]*.right-hand\s{/gi), "Apply the --penguin-skin variable to the background property of the penguin-bottom class.");' + - text: تطبيق متغير --penguin-skin على خاصية background للفئة right-hand . + testString: 'assert(code.match(/.right-hand\s*?{[\s\S]*background\s*?:\s*?var\s*?\(\s*?--penguin-skin\s*?\)\s*?;[\s\S]*}[\s\S]*.left-hand\s{/gi), "Apply the --penguin-skin variable to the background property of the right-hand class.");' + - text: تطبيق متغير --penguin-skin على خاصية background للفئة left-hand . + testString: 'assert(code.match(/.left-hand\s*?{[\s\S]*background\s*?:\s*?var\s*?\(\s*?--penguin-skin\s*?\)\s*?;[\s\S]*}/gi), "Apply the --penguin-skin variable to the background property of the left-hand class.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-a-media-query-to-change-a-variable.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-a-media-query-to-change-a-variable.arabic.md new file mode 100644 index 0000000000..ab17aa717c --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-a-media-query-to-change-a-variable.arabic.md @@ -0,0 +1,280 @@ +--- +id: 5a9d72ad424fe3d0e10cad16 +title: Use a media query to change a variable +challengeType: 0 +videoUrl: '' +localeTitle: استخدم استعلام وسائط لتغيير متغير +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(code.match(/media\s*?\(\s*?max-width\s*?:\s*?350px\s*?\)\s*?{[\s\S]*:root\s*?{[\s\S]*--penguin-size\s*?:\s*?200px\s*?;[\s\S]*}[\s\S]*}/gi), ":root should reassign the --penguin-size variable to 200px.");' + - text: ':root يجب أن يعيد :root تغيير --penguin-skin إلى black .' + testString: 'assert(code.match(/media\s*?\(\s*?max-width\s*?:\s*?350px\s*?\)\s*?{[\s\S]*:root\s*?{[\s\S]*--penguin-skin\s*?:\s*?black\s*?;[\s\S]*}[\s\S]*}/gi), ":root should reassign the --penguin-skin variable to black.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-abbreviated-hex-code.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-abbreviated-hex-code.arabic.md new file mode 100644 index 0000000000..8c17d6a14b --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-abbreviated-hex-code.arabic.md @@ -0,0 +1,84 @@ +--- +id: bad87fee1348bd9aedf08719 +title: Use Abbreviated Hex Code +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert($(".red-text").css("color") === "rgb(255, 0, 0)", "Give your h1 element with the text I am red! the color red.");' + - text: '' + testString: 'assert(code.match(/\.red-text\s*?{\s*?color:\s*?#F00\s*?;\s*?}/gi), "Use the abbreviate hex code for the color red instead of the hex code #FF0000.");' + - text: '' + testString: 'assert($(".green-text").css("color") === "rgb(0, 255, 0)", "Give your h1 element with the text I am green! the color green.");' + - text: '' + testString: 'assert(code.match(/\.green-text\s*?{\s*?color:\s*?#0F0\s*?;\s*?}/gi), "Use the abbreviated hex code for the color green instead of the hex code #00FF00.");' + - text: '' + testString: 'assert($(".cyan-text").css("color") === "rgb(0, 255, 255)", "Give your h1 element with the text I am cyan! the color cyan.");' + - text: '' + testString: 'assert(code.match(/\.cyan-text\s*?{\s*?color:\s*?#0FF\s*?;\s*?}/gi), "Use the abbreviated hex code for the color cyan instead of the hex code #00FFFF.");' + - text: '' + testString: 'assert($(".fuchsia-text").css("color") === "rgb(255, 0, 255)", "Give your h1 element with the text I am fuchsia! the color fuchsia.");' + - text: '' + testString: 'assert(code.match(/\.fuchsia-text\s*?{\s*?color:\s*?#F0F\s*?;\s*?}/gi), "Use the abbreviated hex code for the color fuchsia instead of the hex code #FF00FF.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +

I am red!

+ +

I am fuchsia!

+ +

I am cyan!

+ +

I am green!

+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-an-id-attribute-to-style-an-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-an-id-attribute-to-style-an-element.arabic.md new file mode 100644 index 0000000000..910872d734 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-an-id-attribute-to-style-an-element.arabic.md @@ -0,0 +1,116 @@ +--- +id: bad87dee1348bd9aede07836 +title: Use an id Attribute to Style an Element +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: امنح عنصر form الخاص بك معرف صورة cat-photo-form . + testString: 'assert($("form").attr("id") === "cat-photo-form", "Give your form element the id of cat-photo-form.");' + - text: يجب أن يحتوي عنصر form على background-color الأخضر. + testString: 'assert($("#cat-photo-form").css("background-color") === "rgb(0, 128, 0)", "Your form element should have the background-color of green.");' + - text: تأكد من أن عنصر form يحتوي على سمة id . + testString: 'assert(code.match(//gi) && code.match(//gi).length > 0, "Make sure your form element has an id attribute.");' + - text: لا تعطي form الخاص بك أي سمات class أو style . + testString: 'assert(!code.match(//gi) && !code.match(//gi), "Do not give your form any class or style attributes.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + + +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +
+

Things cats love:

+
    +
  • cat nip
  • +
  • laser pointers
  • +
  • lasagna
  • +
+

Top 3 things cats hate:

+
    +
  1. flea treatment
  2. +
  3. thunder
  4. +
  5. other cats
  6. +
+
+ +
+ +
+ + +
+ + +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-attribute-selectors-to-style-elements.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-attribute-selectors-to-style-elements.arabic.md new file mode 100644 index 0000000000..e93822ab1f --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-attribute-selectors-to-style-elements.arabic.md @@ -0,0 +1,114 @@ +--- +id: 58c383d33e2e3259241f3076 +title: Use Attribute Selectors to Style Elements +challengeType: 0 +videoUrl: '' +localeTitle: استخدم محددات السمات لعناصر النمط +--- + +## Description +
لقد كنت تعطي سمات id أو class إلى العناصر التي ترغب في تحديد أسلوبها. تُعرف هذه المعرّفات باسم محددات الهوية والفئة. هناك محددات CSS أخرى يمكنك استخدامها لتحديد مجموعات مخصصة من العناصر إلى النمط. دعونا نخرج CatPhotoApp مرة أخرى لممارسة استخدام CSS Selectors. بالنسبة لهذا التحدي ، ستستخدم محدد السمة [attr=value] لتمييز مربعات الاختيار في CatPhotoApp. يتطابق هذا المحدد وعناصر الأنماط مع قيمة سمة محددة. على سبيل المثال ، يؤدي التعليمة البرمجية أدناه إلى تغيير هوامش جميع العناصر type السمة وقيمة مماثلة radio :
[type = 'radio'] {
الهامش: 20px 0px 20px 0px؛
}
+ +## Instructions +
باستخدام محدد السمة type ، حاول إعطاء مربعات الاختيار في CatPhotoApp هامشًا أعلى من 10 بكسل وهامشًا سفليًا يبلغ 15 بكسل.
+ +## Tests +
+ +```yml +tests: + - text: يجب استخدام محدد السمة type لتحديد مربعات الاختيار. + testString: 'assert(code.match(/ + +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +
+

Things cats love:

+
    +
  • cat nip
  • +
  • laser pointers
  • +
  • lasagna
  • +
+

Top 3 things cats hate:

+
    +
  1. flea treatment
  2. +
  3. thunder
  4. +
  5. other cats
  6. +
+
+ +
+ +
+ + +
+ + +
+
+ +``` + + + + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-clockwise-notation-to-specify-the-margin-of-an-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-clockwise-notation-to-specify-the-margin-of-an-element.arabic.md new file mode 100644 index 0000000000..df8d9995e5 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-clockwise-notation-to-specify-the-margin-of-an-element.arabic.md @@ -0,0 +1,89 @@ +--- +id: bad87fee1348bd9afdf08726 +title: Use Clockwise Notation to Specify the Margin of an Element +challengeType: 0 +videoUrl: '' +localeTitle: استخدم "Clockwise Notation" لتحديد "هامش العنصر" +--- + +## Description +
دعونا نحاول مرة أخرى ، ولكن مع margin هذه المرة. بدلا من تحديد عنصر في margin-top ، margin-right ، margin-bottom ، و margin-left خصائص فردية، يمكنك تحديد كل منهم في سطر واحد، مثل هذا: margin: 10px 20px 10px 20px; تعمل هذه القيم الأربعة مثل الساعة: أعلى ، يمين ، سفلي ، يسار ، وستنتج نفس النتيجة تمامًا مثل استخدام إرشادات الهامش الخاصة بالجانب.
+ +## Instructions +
استخدام Clockwise Notation لإعطاء عنصر مع blue-box الطبقة هامش 40px على جانبها العلوي والأيسر، ولكن فقط 20px على القاع والجانب الأيمن.
+ +## Tests +
+ +```yml +tests: + - text: لديك blue-box الطبقة يجب أن تعطي الجزء العلوي من عناصر 40px من margin . + testString: 'assert($(".blue-box").css("margin-top") === "40px", "Your blue-box class should give the top of elements 40px of margin.");' + - text: يجب أن تعطي فئة blue-box حق العناصر 20 20px من margin . + testString: 'assert($(".blue-box").css("margin-right") === "20px", "Your blue-box class should give the right of elements 20px of margin.");' + - text: يجب أن تعطي صفحتك blue-box أسفل العناصر 20 20px من margin . + testString: 'assert($(".blue-box").css("margin-bottom") === "20px", "Your blue-box class should give the bottom of elements 20px of margin.");' + - text: يجب أن تعطيك فئة blue-box يمين العناصر 40px من margin . + testString: 'assert($(".blue-box").css("margin-left") === "40px", "Your blue-box class should give the left of elements 40px of margin.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
margin
+ +
+
padding
+
padding
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-clockwise-notation-to-specify-the-padding-of-an-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-clockwise-notation-to-specify-the-padding-of-an-element.arabic.md new file mode 100644 index 0000000000..98662d75a0 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-clockwise-notation-to-specify-the-padding-of-an-element.arabic.md @@ -0,0 +1,91 @@ +--- +id: bad87fee1348bd9aedf08826 +title: Use Clockwise Notation to Specify the Padding of an Element +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert($(".blue-box").css("padding-top") === "40px", "Your blue-box class should give the top of elements 40px of padding.");' + - text: يجب أن تعطي صفحتك blue-box حق العناصر 20px من padding . + testString: 'assert($(".blue-box").css("padding-right") === "20px", "Your blue-box class should give the right of elements 20px of padding.");' + - text: يجب أن تعطي صفحتك blue-box الجزء السفلي من العناصر 20 20px من padding . + testString: 'assert($(".blue-box").css("padding-bottom") === "20px", "Your blue-box class should give the bottom of elements 20px of padding.");' + - text: '' + testString: 'assert($(".blue-box").css("padding-left") === "40px", "Your blue-box class should give the left of elements 40px of padding.");' + - text: '' + testString: 'assert(!/padding-top|padding-right|padding-bottom|padding-left/.test(code), "You should use the clockwise notation to set the padding of blue-box class.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
margin
+ +
+
padding
+
padding
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-css-selectors-to-style-elements.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-css-selectors-to-style-elements.arabic.md new file mode 100644 index 0000000000..482826e728 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-css-selectors-to-style-elements.arabic.md @@ -0,0 +1,87 @@ +--- +id: bad87fee1348bd9aedf08805 +title: Use CSS Selectors to Style Elements +challengeType: 0 +videoUrl: '' +localeTitle: استخدم CSS Selectors إلى عناصر النمط +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(!$("h2").attr("style"), "Remove the style attribute from your h2 element.");' + - text: '' + testString: 'assert($("style") && $("style").length > 1, "Create a style element.");' + - text: يجب أن يكون عنصر h2 باللون الأزرق. + testString: 'assert($("h2").css("color") === "rgb(0, 0, 255)", "Your h2 element should be blue.");' + - text: تأكد من أن تصريح h2 الخاص بأنماط h2 الخاص بك صالح مع قوس منقوطة وإغلاق. + testString: 'assert(code.match(/h2\s*\{\s*color\s*:.*;\s*\}/g), "Ensure that your stylesheet h2 declaration is valid with a semicolon and closing brace.");' + - text: '' + testString: 'assert(code.match(/<\/style>/g) && code.match(/<\/style>/g).length === (code.match(//g) || []).length, "Make sure all your style elements are valid and have a closing tag.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +
+

Things cats love:

+
    +
  • cat nip
  • +
  • laser pointers
  • +
  • lasagna
  • +
+

Top 3 things cats hate:

+
    +
  1. flea treatment
  2. +
  3. thunder
  4. +
  5. other cats
  6. +
+
+ +
+ +
+ + +
+ + +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-css-variables-to-change-several-elements-at-once.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-css-variables-to-change-several-elements-at-once.arabic.md new file mode 100644 index 0000000000..4bd09079a4 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-css-variables-to-change-several-elements-at-once.arabic.md @@ -0,0 +1,252 @@ +--- +id: 5a9d725e424fe3d0e10cad10 +title: Use CSS Variables to change several elements at once +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +
تعد متغيرات CSS طريقة فعالة لتغيير العديد من خصائص أنماط CSS مرة واحدة عن طريق تغيير قيمة واحدة فقط. اتبع الإرشادات أدناه لمعرفة كيف يمكن لتغيير ثلاث قيم فقط تغيير تصميم العديد من العناصر.
+ +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: يجب أن تعلن فئة penguin عن متغير --penguin-skin وتعيينه إلى gray . + testString: 'assert(code.match(/.penguin\s*?{[\s\S]*--penguin-skin\s*?:\s*?gray\s*?;[\s\S]*}/gi), "penguin class should declare the --penguin-skin variable and assign it to gray.");' + - text: يجب أن تعلن الطبقة penguin المتغير --penguin-belly وتعيينه إلى white . + testString: 'assert(code.match(/.penguin\s*?{[\s\S]*--penguin-belly\s*?:\s*?white\s*?;[\s\S]*}/gi), "penguin class should declare the --penguin-belly variable and assign it to white.");' + - text: '' + testString: 'assert(code.match(/.penguin\s*?{[\s\S]*--penguin-beak\s*?:\s*?orange\s*?;[\s\S]*}/gi), "penguin class should declare the --penguin-beak variable and assign it to orange.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-hex-code-for-specific-colors.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-hex-code-for-specific-colors.arabic.md new file mode 100644 index 0000000000..3e6ced6db2 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-hex-code-for-specific-colors.arabic.md @@ -0,0 +1,55 @@ +--- +id: bad87fee1348bd9aedf08726 +title: Use Hex Code for Specific Colors +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +
هل تعلم أن هناك طرقًا أخرى لتمثيل الألوان في CSS؟ يُطلق على أحد هذه الطرق الرمز السداسي العشري ، أو الشفرة السداسية hex code . عادة ما نستخدم decimals ، أو الأرقام الأساسية 10 ، والتي تستخدم الرموز من 0 إلى 9 لكل رقم. Hexadecimals (أو hex ) هي قاعدة أرقام 16. هذا يعني أنه يستخدم ستة عشر رموز متميزة. مثل الكسور العشرية ، تمثل الرموز من 0 إلى 9 القيم من صفر إلى تسعة. ثم تمثل A ، B ، C ، D ، E ، F القيم من عشرة إلى خمسة عشر. بالإجمال ، يمكن أن يمثل 0 إلى F رقماً hexadecimal ، مما يمنحنا إجمالي 16 قيمة ممكنة. يمكنك العثور على مزيد من المعلومات حول الأرقام السداسية العشرية هنا . في CSS ، يمكننا استخدام 6 أرقام سداسية عشرية لتمثيل الألوان ، اثنان لكل منهما للمكونات الحمراء (R) ، والأخضر (G) ، والأزرق (B). على سبيل المثال ، يكون الرقم #000000 باللون الأسود ويعد أيضًا أقل قيمة ممكنة. يمكنك العثور على مزيد من المعلومات حول نظام ألوان RGB هنا .
الجسم {
اللون: # 000000؛
}
+ +## Instructions +
استبدل الكلمة black في لون خلفية عنصر body مع تمثيل hex code ، #000000 .
+ +## Tests +
+ +```yml +tests: + - text: أعط عنصر body لون خلفية اللون الأسود. + testString: 'assert($("body").css("background-color") === "rgb(0, 0, 0)", "Give your body element the background-color of black.");' + - text: استخدم hex code للون الأسود بدلاً من الكلمة black . + testString: 'assert(code.match(/body\s*{(([\s\S]*;\s*?)|\s*?)background.*\s*:\s*?#000(000)?((\s*})|(;[\s\S]*?}))/gi), "Use the hex code for the color black instead of the word black.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-hex-code-to-mix-colors.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-hex-code-to-mix-colors.arabic.md new file mode 100644 index 0000000000..bc26fed22a --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-hex-code-to-mix-colors.arabic.md @@ -0,0 +1,84 @@ +--- +id: bad87fee1348bd9aedf08721 +title: Use Hex Code to Mix Colors +challengeType: 0 +videoUrl: '' +localeTitle: استخدم Hex Code لخلط الألوان +--- + +## Description +
للمراجعة ، تستخدم الرموز السداسية ستة أرقام سداسية عشرية لتمثيل الألوان ، كل منها رقمان لكل من المكونات الحمراء (R) ، والأخضر (G) ، والأزرق (B). من هذه الألوان الثلاثة النقية (الأحمر والأخضر والأزرق) ، يمكننا تغيير مقادير كل منها لإنشاء أكثر من 16 مليون لون آخر! على سبيل المثال ، البرتقالي هو أحمر خالص ، ويخلط مع بعض اللون الأخضر ، ولا أزرق. في الشفرة #FFA500 ، يُترجم هذا إلى #FFA500 . الرقم 0 هو أقل رقم في الشفرة السداسية ، ويمثل غيابًا تامًا للون. الرقم F هو أعلى رقم في الشفرة السداسية ، ويمثل أقصى سطوع ممكن.
+ +## Instructions +
استبدل الكلمات اللونية في عنصر style بنا برموز عرافة صحيحة.
اللون رمز عشري
المراوغ الأزرق #1E90FF
أخضر #00FF00
البرتقالي #FFA500
أحمر #FF0000
+ +## Tests +
+ +```yml +tests: + - text: امنح عنصر h1 بنص I am red! color احمر. + testString: 'assert($(".red-text").css("color") === "rgb(255, 0, 0)", "Give your h1 element with the text I am red! the color red.");' + - text: استخدم hex code للون الأحمر بدلاً من الكلمة red . + testString: 'assert(code.match(/\.red-text\s*?{\s*?color:\s*?#FF0000\s*?;\s*?}/gi), "Use the hex code for the color red instead of the word red.");' + - text: امنح عنصر h1 بنص I am green! color الأخضر. + testString: 'assert($(".green-text").css("color") === "rgb(0, 255, 0)", "Give your h1 element with the text I am green! the color green.");' + - text: استخدم hex code للون الأخضر بدلاً من الكلمة green . + testString: 'assert(code.match(/\.green-text\s*?{\s*?color:\s*?#00FF00\s*?;\s*?}/gi), "Use the hex code for the color green instead of the word green.");' + - text: امنح عنصر h1 بالنص I am dodger blue! color الأزرق المراوغ. + testString: 'assert($(".dodger-blue-text").css("color") === "rgb(30, 144, 255)", "Give your h1 element with the text I am dodger blue! the color dodger blue.");' + - text: استخدم hex code dodgerblue بدلًا من الكلمة dodgerblue . + testString: 'assert(code.match(/\.dodger-blue-text\s*?{\s*?color:\s*?#1E90FF\s*?;\s*?}/gi), "Use the hex code for the color dodger blue instead of the word dodgerblue.");' + - text: '' + testString: 'assert($(".orange-text").css("color") === "rgb(255, 165, 0)", "Give your h1 element with the text I am orange! the color orange.");' + - text: استخدم hex code للون البرتقالي بدلاً من الكلمة orange . + testString: 'assert(code.match(/\.orange-text\s*?{\s*?color:\s*?#FFA500\s*?;\s*?}/gi), "Use the hex code for the color orange instead of the word orange.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +

I am red!

+ +

I am green!

+ +

I am dodger blue!

+ +

I am orange!

+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-rgb-to-mix-colors.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-rgb-to-mix-colors.arabic.md new file mode 100644 index 0000000000..fbb0c2152c --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-rgb-to-mix-colors.arabic.md @@ -0,0 +1,84 @@ +--- +id: bad82fee1348bd9aedf08721 +title: Use RGB to Mix Colors +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert($(".red-text").css("color") === "rgb(255, 0, 0)", "Give your h1 element with the text I am red! the color red.");' + - text: '' + testString: 'assert(code.match(/\.red-text\s*?{\s*?color:\s*?rgb\(\s*?255\s*?,\s*?0\s*?,\s*?0\s*?\)\s*?;\s*?}/gi), "Use rgb for the color red.");' + - text: '' + testString: 'assert($(".orchid-text").css("color") === "rgb(218, 112, 214)", "Give your h1 element with the text I am orchid! the color orchid.");' + - text: '' + testString: 'assert(code.match(/\.orchid-text\s*?{\s*?color:\s*?rgb\(\s*?218\s*?,\s*?112\s*?,\s*?214\s*?\)\s*?;\s*?}/gi), "Use rgb for the color orchid.");' + - text: '' + testString: 'assert($(".blue-text").css("color") === "rgb(0, 0, 255)", "Give your h1 element with the text I am blue! the color blue.");' + - text: '' + testString: 'assert(code.match(/\.blue-text\s*?{\s*?color:\s*?rgb\(\s*?0\s*?,\s*?0\s*?,\s*?255\s*?\)\s*?;\s*?}/gi), "Use rgb for the color blue.");' + - text: امنح عنصر h1 بالنص I am sienna! color سيينا. + testString: 'assert($(".sienna-text").css("color") === "rgb(160, 82, 45)", "Give your h1 element with the text I am sienna! the color sienna.");' + - text: استخدم rgb للون sienna. + testString: 'assert(code.match(/\.sienna-text\s*?{\s*?color:\s*?rgb\(\s*?160\s*?,\s*?82\s*?,\s*?45\s*?\)\s*?;\s*?}/gi), "Use rgb for the color sienna.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +

I am red!

+ +

I am orchid!

+ +

I am sienna!

+ +

I am blue!

+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-rgb-values-to-color-elements.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-rgb-values-to-color-elements.arabic.md new file mode 100644 index 0000000000..7029b45e7c --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-css/use-rgb-values-to-color-elements.arabic.md @@ -0,0 +1,55 @@ +--- +id: bad87fee1348bd9aede08718 +title: Use RGB values to Color Elements +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +
هناك طريقة أخرى لتمثيل الألوان في CSS باستخدام قيم RGB . تبدو قيمة RGB للون الأسود كالتالي: rgb(0, 0, 0) تبدو قيمة RGB للأبيض كما يلي: rgb(255, 255, 255) بدلاً من استخدام ستة أرقام ست عشرية كما تفعل مع الشفرة السداسية ، مع RGB لك حدد سطوع كل لون برقم بين 0 و 255. إذا قمت بإجراء الحساب ، فإن الرقمين لواحد لون يساوي 16 مرة 16 ، مما يعطينا 256 قيمة إجمالية. لذا فإن RGB ، التي تبدأ العد من الصفر ، تحتوي على نفس العدد بالضبط من القيم المحتملة مثل الرمز السداسي. إليك مثال على كيفية تغيير خلفية الجسم إلى اللون البرتقالي باستخدام رمز RGB الخاص به.
الجسم {
background-color: rgb (255، 165، 0)؛
}
+ +## Instructions +
دعنا نستبدل الشفرة السداسية في لون خلفية عنصر body مع قيمة RGB للون الأسود: rgb(0, 0, 0)
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون لعنصر body الخاص بك خلفية سوداء. + testString: 'assert($("body").css("background-color") === "rgb(0, 0, 0)", "Your body element should have a black background.");' + - text: استخدم rgb لإعطاء عنصر body لونًا أسود. + testString: 'assert(code.match(/rgb\s*\(\s*0\s*,\s*0\s*,\s*0\s*\)/ig), "Use rgb to give your body element a color of black.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/add-a-submit-button-to-a-form.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/add-a-submit-button-to-a-form.arabic.md new file mode 100644 index 0000000000..53492c488d --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/add-a-submit-button-to-a-form.arabic.md @@ -0,0 +1,77 @@ +--- +id: bad87fee1348bd9aedd08830 +title: Add a Submit Button to a Form +challengeType: 0 +guideUrl: 'https://arabic.freecodecamp.org/guide/certificates/add-a-submit-button-to-a-form' +videoUrl: '' +localeTitle: إضافة زر إرسال إلى نموذج +--- + +## Description +
دعنا نضيف زر submit إلى النموذج الخاص بك. يؤدي النقر على هذا الزر إلى إرسال البيانات من النموذج إلى عنوان URL الذي حددته باستخدام سمة action للنموذج. في ما يلي مثال زر الإرسال: <button type="submit">this button submits the form</button>
+ +## Instructions +
أضف زرًا باعتباره العنصر الأخير في عنصر form الخاص بك مع نوع submit ، و "إرسال" كنصه.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يحتوي النموذج الخاص بك على زر بداخله. + testString: 'assert($("form").children("button").length > 0, "Your form should have a button inside it.");' + - text: يجب أن يحتوي زر الإرسال على type السمة الذي تم تعيينه submit . + testString: 'assert($("button").attr("type") === "submit", "Your submit button should have the attribute type set to submit.");' + - text: يجب أن يحتوي زر الإرسال فقط على النص "إرسال". + testString: 'assert($("button").text().match(/^\s*submit\s*$/gi), "Your submit button should only have the text "Submit".");' + - text: تأكد من أن عنصر button يحتوي على علامة إغلاق. + testString: 'assert(code.match(/<\/button>/g) && code.match(/
+ +## Challenge Seed +
+ +
+ +```html +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +

Things cats love:

+
    +
  • cat nip
  • +
  • laser pointers
  • +
  • lasagna
  • +
+

Top 3 things cats hate:

+
    +
  1. flea treatment
  2. +
  3. thunder
  4. +
  5. other cats
  6. +
+
+ +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/add-images-to-your-website.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/add-images-to-your-website.arabic.md new file mode 100644 index 0000000000..ebec595b3d --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/add-images-to-your-website.arabic.md @@ -0,0 +1,60 @@ +--- +id: bad87fee1348bd9aedf08812 +title: Add Images to Your Website +challengeType: 0 +guideUrl: 'https://arabic.freecodecamp.org/guide/certificates/add-images-to-your-website' +videoUrl: '' +localeTitle: إضافة الصور إلى موقع الويب الخاص بك +--- + +## Description +
يمكنك إضافة الصور إلى موقع الويب الخاص بك باستخدام عنصر img ، والإشارة إلى عنوان URL للصورة المحددة باستخدام السمة src . مثال على ذلك: <img src="https://www.your-image-source.com/your-image.jpg"> لاحظ أن عناصر img ذاتية الإغلاق. يجب أن تحتوي جميع عناصر img على سمة alt . يستخدم النص داخل سمة alt لقارئات الشاشة لتحسين إمكانية الوصول ويظهر في حالة فشل تحميل الصورة. ملاحظة: إذا كانت الصورة مزخرفة تمامًا ، فإن استخدام سمة alt فارغة هو أفضل ممارسة. من الناحية المثالية ، يجب ألا تحتوي سمة alt على أحرف خاصة ما لم تكن هناك حاجة إليها. دعنا نضيف سمة alt إلى مثال img بنا أعلاه: <img src="https://www.your-image-source.com/your-image.jpg" alt="Author standing on a beach with two thumbs up.">
+ +## Instructions +
لنحاول إضافة صورة إلى موقعنا على الويب: إدراج علامة img ، قبل عنصر h2 . الآن تعيين السمة src بحيث يشير إلى هذا العنوان: https://bit.ly/fcc-relaxing-cat أخيرا لا تنس أن تعطي صورتك نص alt .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تحتوي صفحتك على عنصر صورة. + testString: 'assert($("img").length > 0, "Your page should have an image element.");' + - text: يجب أن تحتوي صورتك على سمة src تشير إلى الصورة الصغيرة. + testString: 'assert(new RegExp("\/\/bit.ly\/fcc-relaxing-cat|\/\/s3.amazonaws.com\/freecodecamp\/relaxing-cat.jpg", "gi").test($("img").attr("src")), "Your image should have a src attribute that points to the kitten image.");' + - text: يجب أن يحتوي عنصر الصورة على سمة alt . + testString: 'assert(code.match(/alt\s*?=\s*?(\"|\").*(\"|\")/), "Your image element must have an alt attribute.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html +

CatPhotoApp

+
+ + +

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

+

Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/add-placeholder-text-to-a-text-field.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/add-placeholder-text-to-a-text-field.arabic.md new file mode 100644 index 0000000000..a32570a3fe --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/add-placeholder-text-to-a-text-field.arabic.md @@ -0,0 +1,73 @@ +--- +id: bad87fee1348bd9aedf08830 +title: Add Placeholder Text to a Text Field +challengeType: 0 +guideUrl: 'https://arabic.freecodecamp.org/guide/certificates/add-placeholder-text-to-a-text-field' +videoUrl: '' +localeTitle: إضافة نص العنصر النائب إلى حقل نص +--- + +## Description +
نص العنصر النائب هو ما يتم عرضه في عنصر input قبل قيام المستخدم input أي شيء. يمكنك إنشاء نص عنصر نائب مثل: <input type="text" placeholder="this is placeholder text">
+ +## Instructions +
placeholder قيمة placeholder input النص إلى "عنوان URL لصورة القط".
+ +## Tests +
+ +```yml +tests: + - text: أضف سمة placeholder لعنصر input النص الحالي. + testString: 'assert($("input[placeholder]").length > 0, "Add a placeholder attribute to the existing text input element.");' + - text: عيّن قيمة سمة العنصر النائب الخاصة بك إلى "عنوان URL لصورة القط". + testString: 'assert($("input") && $("input").attr("placeholder") && $("input").attr("placeholder").match(/cat\s+photo\s+URL/gi), "Set the value of your placeholder attribute to "cat photo URL".");' + - text: يجب أن يحتوي عنصر input النهائي على صيغة صحيحة. + testString: 'assert($("input[type=text]").length > 0 && code.match(/\s]+))?)+\s*|\s*)\/?>/gi), "The finished input element should have valid syntax.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +

Things cats love:

+
    +
  • cat nip
  • +
  • laser pointers
  • +
  • lasagna
  • +
+

Top 3 things cats hate:

+
    +
  1. flea treatment
  2. +
  3. thunder
  4. +
  5. other cats
  6. +
+ +
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/check-radio-buttons-and-checkboxes-by-default.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/check-radio-buttons-and-checkboxes-by-default.arabic.md new file mode 100644 index 0000000000..31a83d38cc --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/check-radio-buttons-and-checkboxes-by-default.arabic.md @@ -0,0 +1,78 @@ +--- +id: bad87fee1348bd9aedd08835 +title: Check Radio Buttons and Checkboxes by Default +challengeType: 0 +videoUrl: '' +localeTitle: تحقق من أزرار الراديو و Checkboxes حسب الافتراضي +--- + +## Description +
يمكنك تعيين مربع اختيار أو زر اختيار ليتم فحصه افتراضيًا باستخدام السمة checked . للقيام بذلك ، قم فقط بإضافة الكلمة "محدد" إلى داخل عنصر الإدخال. على سبيل المثال: <input type="radio" name="test-name" checked>
+ +## Instructions +
عيّن أول radio buttons checkboxes وأول checkboxes على كلاهما يتم تحديدها افتراضيًا.
+ +## Tests +
+ +```yml +tests: + - text: يجب تحديد زر الاختيار الأول في النموذج بشكل افتراضي. + testString: 'assert($("input[type="radio"]").prop("checked"), "Your first radio button on your form should be checked by default.");' + - text: يجب تحديد مربع الاختيار الأول في النموذج بشكل افتراضي. + testString: 'assert($("input[type="checkbox"]").prop("checked"), "Your first checkbox on your form should be checked by default.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +

Things cats love:

+
    +
  • cat nip
  • +
  • laser pointers
  • +
  • lasagna
  • +
+

Top 3 things cats hate:

+
    +
  1. flea treatment
  2. +
  3. thunder
  4. +
  5. other cats
  6. +
+
+ +
+ + +
+ + +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/comment-out-html.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/comment-out-html.arabic.md new file mode 100644 index 0000000000..ad4b95506c --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/comment-out-html.arabic.md @@ -0,0 +1,63 @@ +--- +id: bad87fee1348bd9aedf08804 +title: Comment out HTML +challengeType: 0 +videoUrl: '' +localeTitle: تعليق من HTML +--- + +## Description +
تذكر أنه لبدء التعليق ، تحتاج إلى استخدام <!-- وإنهاء تعليق ، تحتاج إلى استخدام --> هنا سوف تحتاج إلى إنهاء التعليق قبل بدء عنصر h2 الخاص بك.
+ +## Instructions +
قم بالتعليق على عنصر h1 والعنصر p ، ولكن ليس عنصر h2 الخاص بك.
+ +## Tests +
+ +```yml +tests: + - text: قم بالتعليق على عنصر h1 بحيث لا يكون مرئيًا على صفحتك. + testString: 'assert(($("h1").length === 0), "Comment out your h1 element so that it is not visible on your page.");' + - text: اترك عنصر h2 مُعالج بحيث يكون مرئيًا على صفحتك. + testString: 'assert(($("h2").length > 0), "Leave your h2 element uncommented so that it is visible on your page.");' + - text: قم بالتعليق على عنصر p الخاص بك بحيث لا يكون مرئيًا على صفحتك. + testString: 'assert(($("p").length === 0), "Comment out your p element so that it is not visible on your page.");' + - text: تأكد من إغلاق كل تعليقاتك باستخدام --> . + testString: 'assert(code.match(/[^fc]-->/g).length > 1, "Be sure to close each of your comments with -->.");' + - text: لا تقم بتغيير ترتيب h1 h2 أو p في التعليمة البرمجية. + testString: 'assert((code.match(/<([a-z0-9]){1,2}>/g)[0]==="

" && code.match(/<([a-z0-9]){1,2}>/g)[1]==="

" && code.match(/<([a-z0-9]){1,2}>/g)[2]==="

") , "Do not change the order of the h1 h2 or p in the code.");' + +``` + +

+ +## Challenge Seed +
+ +
+ +```html + + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/create-a-bulleted-unordered-list.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/create-a-bulleted-unordered-list.arabic.md new file mode 100644 index 0000000000..ebeb88f00b --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/create-a-bulleted-unordered-list.arabic.md @@ -0,0 +1,63 @@ +--- +id: bad87fee1348bd9aedf08827 +title: Create a Bulleted Unordered List +challengeType: 0 +videoUrl: '' +localeTitle: قم بإنشاء قائمة غير مرتبة بالعدادات +--- + +## Description +
يحتوي HTML على عنصر خاص لإنشاء unordered lists أو قوائم أنماط النقطة. تبدأ القوائم غير مرتبة باستخدام عنصر <ul> الافتتاحي ، متبوعًا بأي عدد من عناصر <li> . وأخيرًا ، تغلق القوائم غير المرتبة بـ </ul> على سبيل المثال:
<UL>
<li> والحليب </ لى>
<li> والجبن </ لى>
</ UL>
إنشاء قائمة نمط نقطي من "الحليب" و "الجبن".
+ +## Instructions +
أزل آخر عنصرين من p وأنشئ قائمة غير مرتبة من ثلاثة أشياء تحبها القطط في أسفل الصفحة.
+ +## Tests +
+ +```yml +tests: + - text: إنشاء عنصر ul . + testString: 'assert($("ul").length > 0, "Create a ul element.");' + - text: يجب أن يكون لديك ثلاثة عناصر li داخل عنصر ul الخاص بك. + testString: 'assert($("ul li").length > 2, "You should have three li elements within your ul element.");' + - text: تأكد من أن عنصر ul لديه علامة إغلاق. + testString: 'assert(code.match(/<\/ul>/gi) && code.match(/
+ +## Challenge Seed +
+ +
+ +```html +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

+

Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/create-a-form-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/create-a-form-element.arabic.md new file mode 100644 index 0000000000..f4d7137a63 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/create-a-form-element.arabic.md @@ -0,0 +1,72 @@ +--- +id: bad87fee1348bd9aede08830 +title: Create a Form Element +challengeType: 0 +videoUrl: '' +localeTitle: إنشاء عنصر النموذج +--- + +## Description +
يمكنك إنشاء نماذج ويب تقوم بالفعل بإرسال البيانات إلى خادم لا يستخدم أكثر من HTML خالص. يمكنك القيام بذلك عن طريق تحديد إجراء على عنصر form الخاص بك. على سبيل المثال: <form action="/url-where-you-want-to-submit-form-data"></form>
+ +## Instructions +
ضع حقل النص داخل عنصر form ، وأضف السمة action="/submit-cat-photo" إلى عنصر النموذج.
+ +## Tests +
+ +```yml +tests: + - text: ضع عنصر إدخال النص داخل عنصر form . + testString: 'assert($("form") && $("form").children("input") && $("form").children("input").length > 0, "Nest your text input element within a form element.");' + - text: تأكد من احتواء form على سمة action تم تعيينها على /submit-cat-photo + testString: 'assert($("form").attr("action") === "/submit-cat-photo", "Make sure your form has an action attribute which is set to /submit-cat-photo");' + - text: تأكد من أن عنصر form يحتوي على علامات فتح وغلق جيدة الإنشاء. + testString: 'assert(code.match(/<\/form>/g) && code.match(/
/g) && code.match(/<\/form>/g).length === code.match(//g).length, "Make sure your form element has well-formed open and close tags.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +

Things cats love:

+
    +
  • cat nip
  • +
  • laser pointers
  • +
  • lasagna
  • +
+

Top 3 things cats hate:

+
    +
  1. flea treatment
  2. +
  3. thunder
  4. +
  5. other cats
  6. +
+ +
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/create-a-set-of-checkboxes.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/create-a-set-of-checkboxes.arabic.md new file mode 100644 index 0000000000..c83e8b68a3 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/create-a-set-of-checkboxes.arabic.md @@ -0,0 +1,79 @@ +--- +id: bad87fee1348bd9aedf08835 +title: Create a Set of Checkboxes +challengeType: 0 +videoUrl: '' +localeTitle: قم بإنشاء مجموعة من مربعات الاختيار +--- + +## Description +
تستخدم النماذج عادة checkboxes للأسئلة التي قد تحتوي على أكثر من إجابة واحدة. مربعات الاختيار هي نوع من input يمكن دمج كل مربعات الاختيار داخل عنصر label الخاص بها. من خلال لف عنصر input داخل عنصر label ، سيقوم تلقائيًا بربط إدخال مربع الاختيار مع عنصر التسمية المحيط به. يجب أن تحتوي جميع مدخلات خانة الاختيار ذات الصلة على سمة name نفسه. فهو يعتبر أفضل الممارسات لتحديد بشكل واضح على العلاقة بين مربع input والمناظرة label عن طريق تعيين for سمة على label عنصر لتتناسب مع id سمة من يرتبط input عنصر. في ما يلي مثال على مربع اختيار: <label for="loving"><input id="loving" type="checkbox" name="personality"> Loving</label>
+ +## Instructions +
أضف إلى مجموعتك مجموعة من ثلاثة مربعات اختيار. يجب أن يكون كل مربع متداخل داخل عنصر label الخاص به. يجب على جميع الثلاثة تقاسم سمة name personality .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تحتوي صفحتك على ثلاثة عناصر من خانة الاختيار. + testString: 'assert($("input[type="checkbox"]").length > 2, "Your page should have three checkbox elements.");' + - text: يجب أن يكون كل عنصر من عناصر خانة الاختيار الثلاثة متداخلاً في عنصر label الخاص به. + testString: 'assert($("label > input[type="checkbox"]:only-child").length > 2, "Each of your three checkbox elements should be nested in its own label element.");' + - text: تأكد من أن كل عنصر من عناصر label لديه علامة إغلاق. + testString: 'assert(code.match(/<\/label>/g) && code.match(/
+ +## Challenge Seed +
+ +
+ +```html +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +

Things cats love:

+
    +
  • cat nip
  • +
  • laser pointers
  • +
  • lasagna
  • +
+

Top 3 things cats hate:

+
    +
  1. flea treatment
  2. +
  3. thunder
  4. +
  5. other cats
  6. +
+ + +
+ + + +
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/create-a-set-of-radio-buttons.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/create-a-set-of-radio-buttons.arabic.md new file mode 100644 index 0000000000..34624b9a1b --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/create-a-set-of-radio-buttons.arabic.md @@ -0,0 +1,83 @@ +--- +id: bad87fee1348bd9aedf08834 +title: Create a Set of Radio Buttons +challengeType: 0 +videoUrl: '' +localeTitle: قم بإنشاء مجموعة من أزرار الراديو +--- + +## Description +
يمكنك استخدام radio buttons للإجابة على الأسئلة حيث تريد أن يمنحك المستخدم إجابة واحدة فقط من الخيارات المتعددة. أزرار الراديو هي نوع من input . يمكن تداخل كل زر من أزرار الراديو داخل عنصر label الخاص به. من خلال لف عنصر input داخل عنصر label ، سيقوم تلقائيًا بربط إدخال زر الراديو مع عنصر التسمية المحيط به. يجب أن يكون لكل أزرار الراديو ذات الصلة سمة name نفسه لإنشاء مجموعة أزرار الراديو. من خلال إنشاء مجموعة راديو ، سيؤدي تحديد أي زر راديو فردي إلى إلغاء تحديد الأزرار الأخرى في نفس المجموعة تلقائيًا ، مما يضمن إجابة واحدة فقط من قبل المستخدم. في ما يلي مثال على زر الاختيار:
<التسمية>
<input type = "radio" name = "indoor-outdoor"> داخلي
</ التسمية>
فهو يعتبر أفضل الممارسات لوضع for السمة على label عنصر، مع قيمة يطابق قيمة id السمة ل input عنصر. يسمح ذلك للتقنيات المساعدة لإنشاء علاقة مرتبطة بين الملصق وعنصر input الطفل. فمثلا:
<label for = "indoor">
<input id = "indoor" type = "radio" name = "indoor-outdoor"> داخلي
</ التسمية>
+ +## Instructions +
أضف زوجًا من أزرار التحديد إلى النموذج ، كل منها متداخل في عنصر التسمية الخاص به. ينبغي للمرء أن يكون خيار indoor والآخر ينبغي أن يكون خيار في outdoor . يجب أن يشترك كلاهما في خاصية name of indoor-outdoor لإنشاء مجموعة راديو.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تحتوي صفحتك على عنصري زر راديو. + testString: 'assert($("input[type="radio"]").length > 1, "Your page should have two radio button elements.");' + - text: امنح أزرار الاختيار الخاصة بك السمة name indoor-outdoor . + testString: 'assert($("label > input[type="radio"]").filter("[name="indoor-outdoor"]").length > 1, "Give your radio buttons the name attribute of indoor-outdoor.");' + - text: يجب أن يتداخل كل عنصر من عناصر زر الراديو في عنصر label الخاص به. + testString: 'assert($("label > input[type="radio"]:only-child").length > 1, "Each of your two radio button elements should be nested in its own label element.");' + - text: تأكد من أن كل عنصر من عناصر label لديه علامة إغلاق. + testString: 'assert((code.match(/<\/label>/g) && code.match(/
+ +## Challenge Seed +
+ +
+ +```html +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +

Things cats love:

+
    +
  • cat nip
  • +
  • laser pointers
  • +
  • lasagna
  • +
+

Top 3 things cats hate:

+
    +
  1. flea treatment
  2. +
  3. thunder
  4. +
  5. other cats
  6. +
+
+ + +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/create-a-text-field.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/create-a-text-field.arabic.md new file mode 100644 index 0000000000..dab67bb77c --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/create-a-text-field.arabic.md @@ -0,0 +1,69 @@ +--- +id: bad87fee1348bd9aedf08829 +title: Create a Text Field +challengeType: 0 +videoUrl: '' +localeTitle: إنشاء حقل النص +--- + +## Description +undefined + +## Instructions +
أنشئ عنصر input من نوع text أسفل قوائمك.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يحتوي تطبيقك على عنصر input من نوع text . + testString: 'assert($("input[type=text]").length > 0, "Your app should have an input element of type text.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +

Things cats love:

+
    +
  • cat nip
  • +
  • laser pointers
  • +
  • lasagna
  • +
+

Top 3 things cats hate:

+
    +
  1. flea treatment
  2. +
  3. thunder
  4. +
  5. other cats
  6. +
+ + +
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/create-an-ordered-list.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/create-an-ordered-list.arabic.md new file mode 100644 index 0000000000..93d8d54f00 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/create-an-ordered-list.arabic.md @@ -0,0 +1,79 @@ +--- +id: bad87fee1348bd9aedf08828 +title: Create an Ordered List +challengeType: 0 +videoUrl: '' +localeTitle: إنشاء قائمة مرتبة +--- + +## Description +
يحتوي HTML على عنصر خاص آخر لإنشاء ordered lists أو قوائم ذات تعداد رقمي. تبدأ القوائم التي يتم <ol> بعنصر فتح <ol> ، متبوعًا بأي عدد من عناصر <li> . وأخيرًا ، يتم إغلاق القوائم </ol> على سبيل المثال:
<رأ>
<li> وغارفيلد </ لى>
<li> وسيلفستر </ لى>
</ OL>
إنشاء قائمة مرقمة من "Garfield" و "Sylvester".
+ +## Instructions +
إنشاء قائمة مرتبة من أهم 3 أشياء تكرهها القطط.
+ +## Tests +
+ +```yml +tests: + - text: 'يجب أن يكون لديك قائمة مرتبة لـ "أهم ثلاثة أشياء للقطط التي تكره:"' + testString: 'assert((/Top 3 things cats hate:/i).test($("ol").prev().text()), "You should have an ordered list for "Top 3 things cats hate:"");' + - text: '' + testString: 'assert((/Things cats love:/i).test($("ul").prev().text()), "You should have an unordered list for "Things cats love:"");' + - text: يجب أن يكون لديك عنصر ul واحد فقط. + testString: 'assert.equal($("ul").length, 1, "You should have only one ul element.");' + - text: يجب أن يكون لديك عنصر ol واحد فقط. + testString: 'assert.equal($("ol").length, 1, "You should have only one ol element.");' + - text: يجب أن يكون لديك ثلاثة عناصر li داخل عنصر ul الخاص بك. + testString: 'assert.equal($("ul li").length, 3, "You should have three li elements within your ul element.");' + - text: يجب أن يكون لديك ثلاثة عناصر li في عنصر ol الخاص بك. + testString: 'assert.equal($("ol li").length, 3, "You should have three li elements within your ol element.");' + - text: تأكد من أن عنصر ul لديه علامة إغلاق. + testString: 'assert(code.match(/<\/ul>/g) && code.match(/<\/ul>/g).length === code.match(/
+ +## Challenge Seed +
+ +
+ +```html +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +

Things cats love:

+
    +
  • cat nip
  • +
  • laser pointers
  • +
  • lasagna
  • +
+

Top 3 things cats hate:

+ +
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/declare-the-doctype-of-an-html-document.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/declare-the-doctype-of-an-html-document.arabic.md new file mode 100644 index 0000000000..5b0fe55e47 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/declare-the-doctype-of-an-html-document.arabic.md @@ -0,0 +1,52 @@ +--- +id: 587d78aa367417b2b2512aed +title: Declare the Doctype of an HTML Document +challengeType: 0 +videoUrl: '' +localeTitle: قم بتعريف Doctype من مستند HTML +--- + +## Description +
تغطي التحديات حتى الآن عناصر HTML محددة واستخداماتها. ومع ذلك ، هناك بعض العناصر التي تعطي الهيكل العام لصفحتك ، ويجب تضمينها في كل مستند HTML. في الجزء العلوي من المستند ، تحتاج إلى إخبار المتصفح بإصدار HTML الذي تستخدمه صفحتك. HTML هي لغة متطورة ، ويتم تحديثها بانتظام. تدعم معظم المتصفحات الرئيسية أحدث المواصفات ، وهي HTML5. ومع ذلك ، قد تستخدم صفحات الويب القديمة الإصدارات السابقة من اللغة. أنت تخبر المتصفح بهذه المعلومات عن طريق إضافة العلامة <!DOCTYPE ...> على السطر الأول ، حيث يكون الجزء " ... " هو إصدار HTML. بالنسبة إلى HTML5 ، تستخدم <!DOCTYPE html> . ! و DOCTYPE الكبيرة مهمة ، خاصة بالنسبة للمتصفحات القديمة. ليست html حساسة لحالة الأحرف. بعد ذلك ، يجب أن يتم لف بقية تعليمات HTML البرمجية الخاصة بك في علامات html . ينتقل الافتتاح <html> مباشرة أسفل السطر <!DOCTYPE html> ، ويذهب الإغلاق </html> في نهاية الصفحة. في ما يلي مثال على بنية الصفحة:
<! DOCTYPE html>
<HTML>
<! - رمز HTML الخاص بك هنا ->
</ HTML>
+ +## Instructions +
أضف علامة DOCTYPE لـ HTML5 إلى أعلى مستند HTML الفارغ في محرر الشفرة. تحته ، إضافة علامات html فتح وإغلاق ، والتي التفاف حول عنصر h1 . يمكن أن يتضمن العنوان أي نص.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تتضمن التعليمات البرمجية الخاصة بك علامة <!DOCTYPE html> . + testString: 'assert(code.match(//gi), "Your code should include a <!DOCTYPE html> tag.");' + - text: يجب أن يكون هناك عنصر html واحد. + testString: 'assert($("html").length == 1, "There should be one html element.");' + - text: يجب أن تلتف علامات html حول عنصر h1 واحد. + testString: 'assert(code.match(/\s*?

\s*?.*?\s*?<\/h1>\s*?<\/html>/gi), "The html tags should wrap around one h1 element.");' + +``` + +

+ +## Challenge Seed +
+ +
+ +```html + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/define-the-head-and-body-of-an-html-document.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/define-the-head-and-body-of-an-html-document.arabic.md new file mode 100644 index 0000000000..655b03a34b --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/define-the-head-and-body-of-an-html-document.arabic.md @@ -0,0 +1,66 @@ +--- +id: 587d78aa367417b2b2512aec +title: Define the Head and Body of an HTML Document +challengeType: 0 +videoUrl: '' +localeTitle: حدد رأس ونص مستند HTML +--- + +## Description +
يمكنك إضافة مستوى آخر من التنظيم في مستند HTML الخاص بك داخل علامات html مع عناصر head body . أي ترميز يحتوي على معلومات حول صفحتك ، سينتقل إلى علامة head . ثم أي الترميز مع محتوى الصفحة (ما يعرض للمستخدم) سيذهب الى body علامة. عادةً ما يتم إدخال عناصر البيانات meta ، مثل link والبيانات meta title style ، داخل عنصر head . إليك مثال لتخطيط الصفحة:
<! DOCTYPE html>
<HTML>
<رئيس>
<! - عناصر البيانات التعريفية ->
</ head>
<body>
<! - محتويات الصفحة ->
</ body>
</ HTML>
+ +## Instructions +
تحرير الترميز بحيث يكون هناك head body . و head وينبغي أن تتضمن عنصرا فقط title ، و body عنصر يجب أن يشمل فقط h1 و p .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون هناك عنصر head واحد فقط على الصفحة. + testString: 'assert($("head").length == 1, "There should be only one head element on the page.");' + - text: '' + testString: 'assert($("body").length == 1, "There should be only one body element on the page.");' + - text: '' + testString: 'assert($("html").children("head").length == 1, "The head element should be a child of the html element.");' + - text: في body يجب أن يكون العنصر طفل من html العنصر. + testString: 'assert($("html").children("body").length == 1, "The body element should be a child of the html element.");' + - text: يجب أن يلف عنصر head حول عنصر title . + testString: 'assert(code.match(/\s*?\s*?.*?\s*?<\/title>\s*?<\/head>/gi), "The <code>head</code> element should wrap around the <code>title</code> element.");' + - text: '' + testString: 'assert($("body").children("h1").length == 1 && $("body").children("p").length == 1, "The <code>body</code> element should wrap around both the <code>h1</code> and <code>p</code> elements.");' + +``` + +</section> + +## Challenge Seed +<section id='challengeSeed'> + +<div id='html-seed'> + +```html +<!DOCTYPE html> +<html> + <title>The best page ever + +

The best page ever

+

Cat ipsum dolor sit amet, jump launch to pounce upon little yarn mouse, bare fangs at toy run hide in litter box until treats are fed. Go into a room to decide you didn't want to be in there anyway. I like big cats and i can not lie kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff. Meow i could pee on this if i had the energy for slap owner's face at 5am until human fills food dish yet scamper. Knock dish off table head butt cant eat out of my own dish scratch the furniture. Make meme, make cute face. Sleep in the bathroom sink chase laser but pee in the shoe. Paw at your fat belly licks your face and eat grass, throw it back up kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

+ + + +``` + + + + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/delete-html-elements.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/delete-html-elements.arabic.md new file mode 100644 index 0000000000..664e3a52af --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/delete-html-elements.arabic.md @@ -0,0 +1,57 @@ +--- +id: bad87fed1348bd9aedf08833 +title: Delete HTML Elements +challengeType: 0 +videoUrl: '' +localeTitle: احذف عناصر HTML +--- + +## Description +
لا يمتلك هاتفنا مساحة عمودية كبيرة. دعونا نزيل العناصر غير الضرورية حتى نتمكن من البدء في بناء CatPhotoApp.
+ +## Instructions +
احذف عنصر h1 حتى نتمكن من تبسيط طريقة العرض الخاصة بنا.
+ +## Tests +
+ +```yml +tests: + - text: احذف عنصر h1 . + testString: 'assert(!code.match(/

/gi) && !code.match(/<\/h1>/gi), "Delete your h1 element.");' + - text: اترك عنصر h2 على الصفحة. + testString: 'assert(code.match(/

[\w\W]*<\/h2>/gi), "Leave your h2 element on the page.");' + - text: اترك عنصر p الخاص بك على الصفحة. + testString: 'assert(code.match(/

[\w\W]*<\/p>/gi), "Leave your p element on the page.");' + +``` + +

+ +## Challenge Seed +
+ +
+ +```html +

Hello World

+ +

CatPhotoApp

+ +

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/fill-in-the-blank-with-placeholder-text.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/fill-in-the-blank-with-placeholder-text.arabic.md new file mode 100644 index 0000000000..8fb389d8cf --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/fill-in-the-blank-with-placeholder-text.arabic.md @@ -0,0 +1,53 @@ +--- +id: bad87fee1348bd9aedf08833 +title: Fill in the Blank with Placeholder Text +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +
استبدال النص داخل عنصر p مع الكلمات القليلة الأولى من هذا النص ipsum كيتي: Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.
+ +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert.isTrue((/Kitty(\s)+ipsum/gi).test($("p").text()), "Your p element should contain the first few words of the provided kitty ipsum text.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html +

Hello World

+ +

CatPhotoApp

+ +

Hello Paragraph

+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/headline-with-the-h2-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/headline-with-the-h2-element.arabic.md new file mode 100644 index 0000000000..6bf700ae46 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/headline-with-the-h2-element.arabic.md @@ -0,0 +1,55 @@ +--- +id: bad87fee1348bd9aedf0887a +title: Headline with the h2 Element +challengeType: 0 +videoUrl: '' +localeTitle: العنوان مع عنصر h2 +--- + +## Description +undefined + +## Instructions +
إضافة علامة h2 تقول "CatPhotoApp" لإنشاء element HTML ثاني أسفل عنصر h1 "Hello World".
+ +## Tests +
+ +```yml +tests: + - text: قم بإنشاء عنصر h2 . + testString: 'assert(($("h2").length > 0), "Create an h2 element.");' + - text: '' + testString: 'assert(code.match(/<\/h2>/g) && code.match(/<\/h2>/g).length === code.match(/

/g).length, "Make sure your h2 element has a closing tag.");' + - text: '' + testString: 'assert.isTrue((/cat(\s)?photo(\s)?app/gi).test($("h2").text()), "Your h2 element should have the text "CatPhotoApp".");' + - text: يجب أن يحتوي عنصر h1 على النص "Hello World". + testString: 'assert.isTrue((/hello(\s)+world/gi).test($("h1").text()), "Your h1 element should have the text "Hello World".");' + +``` + +

+ +## Challenge Seed +
+ +
+ +```html +

Hello World

+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/inform-with-the-paragraph-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/inform-with-the-paragraph-element.arabic.md new file mode 100644 index 0000000000..73284ecca6 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/inform-with-the-paragraph-element.arabic.md @@ -0,0 +1,54 @@ +--- +id: bad87fee1348bd9aedf08801 +title: Inform with the Paragraph Element +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +
تعد العناصر p العنصر المفضل لنص الفقرة على مواقع الويب. p قصيرة في "الفقرة". يمكنك إنشاء عنصر فقرة مثل: <p>I'm ap tag!</p>
+ +## Instructions +
قم بإنشاء عنصر p أسفل عنصر h2 ، وأعطه النص "Hello Paragraph".
+ +## Tests +
+ +```yml +tests: + - text: قم بإنشاء عنصر p . + testString: 'assert(($("p").length > 0), "Create a p element.");' + - text: يجب أن يحتوي عنصر p على النص "Hello Paragraph". + testString: 'assert.isTrue((/hello(\s)+paragraph/gi).test($("p").text()), "Your p element should have the text "Hello Paragraph".");' + - text: تأكد من أن عنصر p لديه علامة إغلاق. + testString: 'assert(code.match(/<\/p>/g) && code.match(/<\/p>/g).length === code.match(/

p element has a closing tag.");' + +``` + +

+ +## Challenge Seed +
+ +
+ +```html +

Hello World

+

CatPhotoApp

+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/introduction-to-html5-elements.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/introduction-to-html5-elements.arabic.md new file mode 100644 index 0000000000..cbc7e68d15 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/introduction-to-html5-elements.arabic.md @@ -0,0 +1,63 @@ +--- +id: bad87fee1348bd9aecf08801 +title: Introduction to HTML5 Elements +challengeType: 0 +videoUrl: '' +localeTitle: مقدمة إلى عناصر HTML5 +--- + +## Description +
يقدم HTML5 مزيدًا من علامات HTML الوصفية. تشمل هذه header footer nav video article section وغيرها. تجعل هذه العلامات HTML أسهل في القراءة ، وتساعد أيضًا في تحسين محركات البحث (SEO) وإمكانية الوصول. تساعد علامة HTML5 main محركات البحث والمطورين الآخرين في العثور على المحتوى الرئيسي لصفحتك. ملحوظة
تتم تغطية العديد من علامات HTML5 الجديدة وفوائدها في قسم "إمكانية الوصول التطبيقي".
+ +## Instructions +
إنشاء الثاني p العنصر بعد القائمة p عنصر مع النص كيتي هوز التالية: Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched. التفاف الفقرات مع علامة main فتح وإغلاق.
+ +## Tests +
+ +```yml +tests: + - text: تحتاج 2 p العناصر مع النص كيتي هوز. + testString: 'assert($("p").length > 1, "You need 2 p elements with Kitty Ipsum text.");' + - text: تأكد من أن كل عنصر من عناصر p لديه علامة إغلاق. + testString: 'assert(code.match(/<\/p>/g) && code.match(/<\/p>/g).length === code.match(/

p elements has a closing tag.");' + - text: يجب أن يحتوي عنصر p على الكلمات القليلة الأولى من kitty ipsum text الإضافية المتوفرة. + testString: 'assert.isTrue((/Purr\s+jump\s+eat/gi).test($("p").text()), "Your p element should contain the first few words of the provided additional kitty ipsum text.");' + - text: يجب أن يحتوي main عنصر main واحد. + testString: 'assert($("main").length === 1, "Your code should have one main element.");' + - text: يجب أن يحتوي العنصر main على عنصرين فقرة كأطفال. + testString: 'assert($("main").children("p").length === 2, "The main element should have two paragraph elements as children.");' + - text: يجب أن تأتي العلامة الافتتاحية main قبل علامة الفقرة الأولى. + testString: 'assert(code.match(/

\s*?

/g), "The opening main tag should come before the first paragraph tag.");' + - text: يجب أن تأتي علامة الإغلاق main بعد علامة فقرة الإغلاق الثانية. + testString: 'assert(code.match(/<\/p>\s*?<\/main>/g), "The closing main tag should come after the second closing paragraph tag.");' + +``` + +

+ +## Challenge Seed +
+ +
+ +```html +

CatPhotoApp

+ +

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/link-to-external-pages-with-anchor-elements.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/link-to-external-pages-with-anchor-elements.arabic.md new file mode 100644 index 0000000000..780ac883c0 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/link-to-external-pages-with-anchor-elements.arabic.md @@ -0,0 +1,62 @@ +--- +id: bad87fee1348bd9aedf08816 +title: Link to External Pages with Anchor Elements +challengeType: 0 +videoUrl: '' +localeTitle: وصلة إلى الصفحات الخارجية مع عناصر مرساة +--- + +## Description +
يمكنك استخدام عناصر anchor للربط بمحتوى خارج صفحة الويب الخاصة بك. تحتاج عناصر anchor إلى عنوان ويب مقصود يسمى سمة href . هم أيضا بحاجة إلى مرساة النص. في ما يلي مثال: <a href="https://freecodecamp.org">this links to freecodecamp.org</a> ثم يعرض المتصفح النص "روابط إلى freecodecamp.org" كحلقة يمكنك النقر عليها. وسيأخذك هذا الرابط إلى عنوان الويب https://www.freecodecamp.org .
+ +## Instructions +
إنشاء a العنصر الذي يربط http://freecatphotoapp.com ولديه "صور القط"، كما لها anchor text .
+ +## Tests +
+ +```yml +tests: + - text: الخاص بك a يجب أن يكون العنصر في anchor text من "صور القط". + testString: 'assert((/cat photos/gi).test($("a").text()), "Your a element should have the anchor text of "cat photos".");' + - text: 'تحتاج إلى a العنصر الذي يربط http://freecatphotoapp .com' + testString: 'assert(/http:\/\/(www\.)?freecatphotoapp\.com/gi.test($("a").attr("href")), "You need an a element that links to http://freecatphotoapp.com");' + - text: تأكد من a عنصر يحتوي على علامة إغلاق. + testString: 'assert(code.match(/<\/a>/g) && code.match(/<\/a>/g).length === code.match(/a element has a closing tag.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html +

CatPhotoApp

+
+ + + + A cute orange cat lying on its back. + +

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

+

Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/link-to-internal-sections-of-a-page-with-anchor-elements.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/link-to-internal-sections-of-a-page-with-anchor-elements.arabic.md new file mode 100644 index 0000000000..d4b77c19e5 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/link-to-internal-sections-of-a-page-with-anchor-elements.arabic.md @@ -0,0 +1,73 @@ +--- +id: bad88fee1348bd9aedf08816 +title: Link to Internal Sections of a Page with Anchor Elements +challengeType: 0 +videoUrl: '' +localeTitle: رابط إلى الأقسام الداخلية لصفحة مع عناصر الارتساء +--- + +## Description +
يمكن أيضًا استخدام عناصر الربط لإنشاء روابط داخلية للانتقال إلى أقسام مختلفة داخل صفحة الويب. لإنشاء رابط داخلي ، يمكنك تعيين سمة href لرابط إلى رمز hash # plus وقيمة السمة id للعنصر الذي تريد ربطه داخليًا ، وعادةً ما يكون أسفل الصفحة. ستحتاج بعد ذلك إلى إضافة نفس سمة id إلى العنصر الذي تقوم بالارتباط إليه. id هو سمة تصف عنصرًا بشكل فريد. في ما يلي مثال لرابط الربط الداخلي والعنصر المستهدف:
<a href="#contacts-header"> جهات الاتصال </a>
...
<h2 id = "contacts-header"> جهات الاتصال </ h2>
عندما ينقر المستخدمون على رابط جهات الاتصال ، سيتم نقلك إلى قسم صفحة الويب باستخدام عنصر عنوان جهات الاتصال .
+ +## Instructions +
غيّر رابطك الخارجي إلى رابط داخلي عن طريق تغيير سمة href إلى "#footer" والنص من "صور القط" إلى "الانتقال إلى أسفل". أزل السمة target="_blank" من علامة الربط لأن هذا يؤدي إلى فتح المستند المرتبط في علامة تبويب نافذة جديدة. ثم أضف سمة id بقيمة "تذييل" إلى عنصر <footer> في أسفل الصفحة.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون هناك علامة ارتساء واحدة فقط على صفحتك. + testString: 'assert($("a").length == 1, "There should be only one anchor tag on your page.");' + - text: يجب أن يكون هناك علامة footer واحدة فقط على صفحتك. + testString: 'assert($("footer").length == 1, "There should be only one footer tag on your page.");' + - text: 'و a ينبغي أن يكون سمة ل href السمة تعيين "#footer".' + testString: 'assert($("a").eq(0).attr("href") == "#footer", "The a tag should have an href attribute set to "#footer".");' + - text: و a لا ينبغي أن يكون العلامة target السمة + testString: 'assert(typeof $("a").eq(0).attr("target") == typeof undefined || $("a").eq(0).attr("target") == true, "The a tag should not have a target attribute");' + - text: و a ينبغي أن يكون النص "الانتقال إلى أسفل". + testString: 'assert($("a").eq(0).text().match(/Jump to Bottom/gi), "The a text should be "Jump to Bottom".");' + - text: يجب أن تحتوي علامة footer سمة id تعيينها على "تذييل الصفحة". + testString: 'assert($("footer").eq(0).attr("id") == "footer", "The footer tag should have an id attribute set to "footer".");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html +

CatPhotoApp

+
+ + cat photos + + A cute orange cat lying on its back. + +

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff. Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched. Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

+

Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched. Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff. Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

+

Meowwww loved it, hated it, loved it, hated it yet spill litter box, scratch at owner, destroy all furniture, especially couch or lay on arms while you're using the keyboard. Missing until dinner time toy mouse squeak roll over. With tail in the air lounge in doorway. Man running from cops stops to pet cats, goes to jail.

+

Intently stare at the same spot poop in the plant pot but kitten is playing with dead mouse. Get video posted to internet for chasing red dot leave fur on owners clothes meow to be let out and mesmerizing birds leave fur on owners clothes or favor packaging over toy so purr for no reason. Meow to be let out play time intently sniff hand run outside as soon as door open yet destroy couch.

+ +
+ + + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/make-dead-links-using-the-hash-symbol.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/make-dead-links-using-the-hash-symbol.arabic.md new file mode 100644 index 0000000000..d4b9815481 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/make-dead-links-using-the-hash-symbol.arabic.md @@ -0,0 +1,57 @@ +--- +id: bad87fee1348bd9aedf08817 +title: Make Dead Links Using the Hash Symbol +challengeType: 0 +videoUrl: '' +localeTitle: جعل الروابط الميتة باستخدام رمز التجزئة +--- + +## Description +
أحيانا كنت ترغب في إضافة a عناصر لموقع الويب الخاص بك قبل ان تعرفه حيث سيربط. هذا مفيد أيضًا عند تغيير سلوك الارتباط باستخدام JavaScript ، والذي سنتعرف عليه لاحقًا.
+ +## Instructions +
القيمة الحالية لسمة href عبارة عن رابط يشير إلى "http://freecatphotoapp.com". استبدل قيمة السمة href بـ # ، والمعروف أيضًا باسم رمز التجزئة ، لإنشاء رابط ميت. على سبيل المثال: href="#"
+ +## Tests +
+ +```yml +tests: + - text: 'يجب أن يكون العنصر الخاص بك a وصلة ميتة مع تعيين قيمة href على "#".' + testString: 'assert($("a").attr("href") === "#", "Your a element should be a dead link with the value of the href attribute set to "#".");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

+

Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/nest-an-anchor-element-within-a-paragraph.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/nest-an-anchor-element-within-a-paragraph.arabic.md new file mode 100644 index 0000000000..765b6cffc1 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/nest-an-anchor-element-within-a-paragraph.arabic.md @@ -0,0 +1,72 @@ +--- +id: bad87fee1348bd9aede08817 +title: Nest an Anchor Element within a Paragraph +challengeType: 0 +videoUrl: '' +localeTitle: عش عنصر الارتساء ضمن فقرة +--- + +## Description +
يمكنك تضمين الروابط داخل عناصر نصية أخرى.
<P>
إليك <a target="_blank" href="http://freecodecamp.org"> رابط إلى freecodecamp.org </a> لتتبعه.
</ P>
دعونا نقسم المثال: يتم التفاف النص العادي في عنصر p :
<p> Here's a ... for you to follow. </p> التالي هو عنصر anchor <a> (الذي يتطلب علامة إغلاق </a> ):
<a> ... </a> target عبارة عن سمة علامة ارتساء تحدد مكان فتح الرابط "_blank" القيمة "_blank" لفتح الرابط في علامة تبويب جديدة href عبارة عن سمة علامة ارتساء تحتوي على عنوان URL لـ الرابط:
<a href="http://freecodecamp.org"> ... </a> سيعرض النص "link to freecodecamp.org" ، داخل عنصر anchor text يدعى anchor text الرابط ، رابطًا للنقر:
<a href=" ... ">link to freecodecamp.org</a> الناتج النهائي للمثال كما يلي:

إليك رابط لـ freecodecamp.org لتتبعه .

+ +## Instructions +
الآن عش الموجودة لديك a عنصر داخل الجديد p عنصر (فقط بعد القائمة main عنصر). يجب أن تحتوي الفقرة الجديدة على نص يقول "عرض المزيد من صور القط" ، حيث تكون "صور القط" ارتباطًا ، وبقية النص عبارة عن نص عادي.
+ +## Tests +
+ +```yml +tests: + - text: 'تحتاج إلى a العنصر الذي يربط "http://freecatphotoapp.com".' + testString: 'assert(($("a[href=\"http://freecatphotoapp.com\"]").length > 0 || $("a[href=\"http://www.freecatphotoapp.com\"]").length > 0), "You need an a element that links to "http://freecatphotoapp.com".");' + - text: الخاص بك a يجب أن يكون عنصر النص مرساة "صور القط" + testString: 'assert($("a").text().match(/cat\sphotos/gi), "Your a element should have the anchor text of "cat photos"");' + - text: إنشاء جديد p العنصر حول الخاص a العنصر. يجب أن يكون هناك 3 علامات p على الأقل في كود HTML الخاص بك. + testString: 'assert($("p") && $("p").length > 2, "Create a new p element around your a element. There should be at least 3 total p tags in your HTML code.");' + - text: '' + testString: 'assert(($("a[href=\"http://freecatphotoapp.com\"]").parent().is("p") || $("a[href=\"http://www.freecatphotoapp.com\"]").parent().is("p")), "Your a element should be nested within your new p element.");' + - text: يجب أن يحتوي عنصر p على النص "عرض المزيد" (مع وجود مسافة بعده). + testString: 'assert(($("a[href=\"http://freecatphotoapp.com\"]").parent().text().match(/View\smore\s/gi) || $("a[href=\"http://www.freecatphotoapp.com\"]").parent().text().match(/View\smore\s/gi)), "Your p element should have the text "View more " (with a space after it).");' + - text: الخاص بك a يجب أن لا يكون عنصر النص "عرض أكثر". + testString: 'assert(!$("a").text().match(/View\smore/gi), "Your a element should not have the text "View more".");' + - text: تأكد من أن كل عنصر من عناصر p لديه علامة إغلاق. + testString: 'assert(code.match(/<\/p>/g) && code.match(/

/g).length === code.match(/

p elements has a closing tag.");' + - text: تأكد من أن كل a عناصرك لديه علامة إغلاق. + testString: 'assert(code.match(/<\/a>/g) && code.match(//g).length === code.match(/a elements has a closing tag.");' + +``` + +

+ +## Challenge Seed +
+ +
+ +```html +

CatPhotoApp

+
+ + cat photos + + A cute orange cat lying on its back. + +

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

+

Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/nest-many-elements-within-a-single-div-element.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/nest-many-elements-within-a-single-div-element.arabic.md new file mode 100644 index 0000000000..67392a4a89 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/nest-many-elements-within-a-single-div-element.arabic.md @@ -0,0 +1,83 @@ +--- +id: bad87fee1348bd9aede08835 +title: Nest Many Elements within a Single div Element +challengeType: 0 +videoUrl: '' +localeTitle: Nest العديد من العناصر داخل عنصر div مفرد +--- + +## Description +
عنصر div ، المعروف أيضًا باسم عنصر القسمة ، هو حاوية للأغراض العامة للعناصر الأخرى. ربما يكون عنصر div هو أكثر عناصر HTML شيوعًا على الإطلاق. تمامًا مثل أي عنصر آخر غير الإغلاق الذاتي ، يمكنك فتح عنصر div باستخدام <div> وإغلاقه في سطر آخر باستخدام </div> .
+ +## Instructions +
اجعل "تحب قطط الأشياء" و "أشياء تكره القطط" تسرد كل عنصر div واحد. تلميح: حاول وضع الخاص بك افتتاح div العلامة فوق بك "القطط الأمور الحب" p العنصر الخاص بك وإغلاق div الوسم الخاص بك بعد إغلاق ol العلامة بحيث أن كلا من القوائم الخاصة بك هي واحدة ضمن div .
+ +## Tests +
+ +```yml +tests: + - text: ضع عناصر p داخل عنصر div الخاص بك. + testString: 'assert($("div").children("p").length > 1, "Nest your p elements inside your div element.");' + - text: عش ul داخل عنصر div الخاص بك. + testString: 'assert($("div").children("ul").length > 0, "Nest your ul element inside your div element.");' + - text: قم ol عنصر ol الخاص بك داخل عنصر div الخاص بك. + testString: 'assert($("div").children("ol").length > 0, "Nest your ol element inside your div element.");' + - text: تأكد من أن عنصر div يحتوي على علامة إغلاق. + testString: 'assert(code.match(/<\/div>/g) && code.match(/<\/div>/g).length === code.match(/
/g).length, "Make sure your div element has a closing tag.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +

Things cats love:

+
    +
  • cat nip
  • +
  • laser pointers
  • +
  • lasagna
  • +
+

Top 3 things cats hate:

+
    +
  1. flea treatment
  2. +
  3. thunder
  4. +
  5. other cats
  6. +
+ +
+ +
+ + +
+ + +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/say-hello-to-html-elements.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/say-hello-to-html-elements.arabic.md new file mode 100644 index 0000000000..55c2158052 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/say-hello-to-html-elements.arabic.md @@ -0,0 +1,49 @@ +--- +id: bd7123c8c441eddfaeb5bdef +title: Say Hello to HTML Elements +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +
مرحبًا بك في تحديات ترميز HTML لـ freeCodeCamp. ستوجهك هذه الخطوات من خلال تطوير الويب خطوة بخطوة. أولاً ، ستبدأ ببناء صفحة ويب بسيطة باستخدام HTML. يمكنك تحرير code في code editor الخاص بك ، والذي تم تضمينه في صفحة الويب هذه. هل ترى الرمز في محرر التعليمات البرمجية الذي يقول <h1>Hello</h1> ؟ هذا هو element HTML. تحتوي معظم عناصر HTML على opening tag closing tag . تبدو علامات الفتح بالشكل التالي: <h1> تبدو علامات الإغلاق كما يلي: </h1> الفرق الوحيد بين علامات الفتح والإغلاق هو شرطة مائلة للأمام بعد قوس الفتح لعلامة إغلاق. لكل تحد اختبارات يمكنك تشغيلها في أي وقت بالنقر فوق الزر "تشغيل الاختبارات". عندما تجتاز جميع الاختبارات ، ستتم مطالبتك بإرسال الحل والانتقال إلى التحدي التالي في الترميز.
+ +## Instructions +
لتمرير الاختبار على هذا التحدي ، قم بتغيير نص عنصر h1 ليقول "Hello World".
+ +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert.isTrue((/hello(\s)+world/gi).test($("h1").text()), "Your h1 element should have the text "Hello World".");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html +

Hello

+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/turn-an-image-into-a-link.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/turn-an-image-into-a-link.arabic.md new file mode 100644 index 0000000000..6931428502 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/turn-an-image-into-a-link.arabic.md @@ -0,0 +1,61 @@ +--- +id: bad87fee1348bd9aedf08820 +title: Turn an Image into a Link +challengeType: 0 +videoUrl: '' +localeTitle: تحويل صورة إلى رابط +--- + +## Description +
يمكنك جعل العناصر إلى روابط التي تعشش لهم داخل a عنصر. عش صورتك داخل a عنصر. في ما يلي مثال: <a href="#"><img src="https://bit.ly/fcc-running-cats" alt="Three kittens running towards the camera."></a> تذكر أن تستخدم # ك a العنصر href الملكية من أجل تحويله إلى رابط معطل.
+ +## Instructions +
ضع عنصر الصورة الموجود داخل عنصر الارتساء. بعد الانتهاء من ذلك ، مرّر مؤشر الماوس فوق صورتك باستخدام المؤشر. يجب أن يصبح المؤشر الطبيعي لمؤشر المؤشر مؤشر النقر على الرابط. الصورة الآن رابط.
+ +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert($("a").children("img").length > 0, "Nest the existing img element within an a element.");' + - text: '' + testString: 'assert(new RegExp("#").test($("a").children("img").parent().attr("href")), "Your a element should be a dead link with a href attribute set to #.");' + - text: '' + testString: 'assert(code.match(/<\/a>/g) && code.match(//g).length === code.match(/a elements has a closing tag.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

+

Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/uncomment-html.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/uncomment-html.arabic.md new file mode 100644 index 0000000000..d7bddefc95 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/uncomment-html.arabic.md @@ -0,0 +1,61 @@ +--- +id: bad87fee1348bd9aedf08802 +title: Uncomment HTML +challengeType: 0 +videoUrl: '' +localeTitle: Uncomment HTML +--- + +## Description +undefined + +## Instructions +
إلغاء h2 عناصر h1 و h2 و p .
+ +## Tests +
+ +```yml +tests: + - text: اجعل عنصر h1 مرئيًا على صفحتك من خلال إلغاء تحميله. + testString: 'assert($("h1").length > 0, "Make your h1 element visible on your page by uncommenting it.");' + - text: اجعل عنصر h2 مرئيًا على صفحتك من خلال إلغاء تحميله. + testString: 'assert($("h2").length > 0, "Make your h2 element visible on your page by uncommenting it.");' + - text: اجعل العنصر p مرئيًا على صفحتك من خلال إلغاء تحميله. + testString: 'assert($("p").length > 0, "Make your p element visible on your page by uncommenting it.");' + - text: تأكد من حذف جميع علامات التعليق الزائدة ، مثل --> . + testString: 'assert(!/[^fc]-->/gi.test(code.replace(/ * + +``` + + + + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/use-html5-to-require-a-field.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/use-html5-to-require-a-field.arabic.md new file mode 100644 index 0000000000..b0deab5bcf --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/basic-html-and-html5/use-html5-to-require-a-field.arabic.md @@ -0,0 +1,71 @@ +--- +id: bad87fee1348bd9aedc08830 +title: Use HTML5 to Require a Field +challengeType: 0 +videoUrl: '' +localeTitle: استخدم HTML5 لطلب حقل +--- + +## Description +
يمكنك طلب حقول نموذج محددة بحيث لا يتمكن المستخدم من إرسال النموذج الخاص بك حتى يقوم بملئها. على سبيل المثال ، إذا أردت إنشاء حقل إدخال نص مطلوب ، فيمكنك فقط إضافة السمة required داخل عنصر input ، مثل: <input type="text" required>
+ +## Instructions +
اجعل input النص الخاص بك حقلًا required ، بحيث لا يمكن للمستخدم إرسال النموذج بدون إكمال هذا الحقل. ثم حاول إرسال النموذج دون إدخال أي نص. انظر كيف يعلمك نموذج HTML5 أن هذا الحقل مطلوب؟
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يحتوي عنصر input النص على السمة required . + testString: 'assert($("input").prop("required"), "Your text input element should have the required attribute.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +

Things cats love:

+
    +
  • cat nip
  • +
  • laser pointers
  • +
  • lasagna
  • +
+

Top 3 things cats hate:

+
    +
  1. flea treatment
  2. +
  3. thunder
  4. +
  5. other cats
  6. +
+
+ + +
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/add-flex-superpowers-to-the-tweet-embed.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/add-flex-superpowers-to-the-tweet-embed.arabic.md new file mode 100644 index 0000000000..e701368810 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/add-flex-superpowers-to-the-tweet-embed.arabic.md @@ -0,0 +1,149 @@ +--- +id: 587d78ab367417b2b2512af1 +title: Add Flex Superpowers to the Tweet Embed +challengeType: 0 +videoUrl: '' +localeTitle: أضف Flex Flexpowers إلى Tweet تضمين +--- + +## Description +
إلى اليمين يتم تضمين التغريد الذي سيتم استخدامه كمثال عملي. بعض العناصر تبدو أفضل مع تخطيط مختلف. أظهر التحدي الأخير display: flex . هنا سوف تقوم بإضافته إلى العديد من المكونات في tweet embed لبدء ضبط موضعها.
+ +## Instructions +
إضافة display: flex خاصية CSS display: flex لكل العناصر التالية - لاحظ أن المحددات قد تم إعدادها بالفعل في CSS: header ، رأس الملف .profile-name ، رأس الصفحة. .follow-btn ، h3 و h4 في الرأس ، footer ، .stats .
+ +## Tests +
+ +```yml +tests: + - text: لديك header ينبغي أن يكون display الممتلكات المحددة لثني. + testString: 'assert($("header").css("display") == "flex", "Your header should have a display property set to flex.");' + - text: '' + testString: 'assert($("footer").css("display") == "flex", "Your footer should have a display property set to flex.");' + - text: يجب أن يكون لديك h3 خاصية display مضبوطة. + testString: 'assert($("h3").css("display") == "flex", "Your h3 should have a display property set to flex.");' + - text: '' + testString: 'assert($("h4").css("display") == "flex", "Your h4 should have a display property set to flex.");' + - text: يجب أن يحتوي .profile-name ملفك الشخصي على خاصية display مضبوطة على flex. + testString: 'assert($(".profile-name").css("display") == "flex", "Your .profile-name should have a display property set to flex.");' + - text: '' + testString: 'assert($(".follow-btn").css("display") == "flex", "Your .follow-btn should have a display property set to flex.");' + - text: يجب أن يكون لدى .stats خاصية display مضبوطة على flex. + testString: 'assert($(".stats").css("display") == "flex", "Your .stats should have a display property set to flex.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+ Quincy Larson's profile picture +
+

Quincy Larson

+

@ossia

+
+ +
+
+

I meet so many people who are in search of that one trick that will help them work smart. Even if you work smart, you still have to work hard.

+ 1:32 PM - 12 Jan 2018 +
+
+ + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/align-elements-using-the-align-items-property.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/align-elements-using-the-align-items-property.arabic.md new file mode 100644 index 0000000000..fd1a4619e0 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/align-elements-using-the-align-items-property.arabic.md @@ -0,0 +1,72 @@ +--- +id: 587d78ad367417b2b2512af8 +title: Align Elements Using the align-items Property +challengeType: 0 +videoUrl: '' +localeTitle: محاذاة العناصر باستخدام خاصية عناصر المحاذاة +--- + +## Description +
يشبه الخاصية align-items justify-content . تذكر أن الخاصية justify-content بمحاذاة عناصر مرنة على طول المحور الرئيسي. بالنسبة للصفوف ، فإن المحور الرئيسي هو خط أفقي ، وبالنسبة للأعمدة فهو خط عمودي. تحتوي الحاويات المرنة أيضًا على محور متقاطع وهو عكس المحور الرئيسي. ﺑﺎﻟﻧﺳﺑﺔ ﻟﻟﺻﻔوف ، ﯾﮐون اﻟﻣﺣور اﻟﻣﺗﻘﺎطﻊ رأﺳﯾًﺎ وﻟﻸﻋﻣدة ، ﯾﮐون اﻟﻣﺣور اﻟﻣﺗﻘﺎطﻊ أﻓﻘﻲ. تقدم CSS على align-items الملكية لمحاذاة العناصر المرنة على طول المحور العرضي. بالنسبة إلى الصف ، تُعلم CSS كيفية دفع العناصر في الصف بأكمله لأعلى أو لأسفل داخل الحاوية. وللعمود ، كيفية دفع جميع العناصر إلى اليسار أو اليمين داخل الحاوية. تتضمن القيم المختلفة المتاحة align-items ما يلي:
+ +## Instructions +
مثال يساعد على إظهار هذه الخاصية في العمل. أضف align-items الخاصية CSS إلى عنصر #box-container ، وأعطها قيمة المركز. علاوة
جرّب الخيارات الأخرى align-items في محرر الشفرات لمعرفة اختلافاتهم. لكن لاحظ أن قيمة المركز هي الوحيدة التي ستجتاز هذا التحدي.
+ +## Tests +
+ +```yml +tests: + - text: 'يجب أن #box-container عنصر #box-container خاصية align-items ضبطها على قيمة المركز.' + testString: 'assert($("#box-container").css("align-items") == "center", "The #box-container element should have an align-items property set to a value of center.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+

Hello

+

Goodbye

+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/align-elements-using-the-justify-content-property.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/align-elements-using-the-justify-content-property.arabic.md new file mode 100644 index 0000000000..9c20c2cf9b --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/align-elements-using-the-justify-content-property.arabic.md @@ -0,0 +1,72 @@ +--- +id: 587d78ac367417b2b2512af6 +title: Align Elements Using the justify-content Property +challengeType: 0 +videoUrl: '' +localeTitle: محاذاة العناصر باستخدام خاصية justify-content +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert($("#box-container").css("justify-content") == "center", "The #box-container element should have a justify-content property set to a value of center.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
+
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/apply-the-flex-direction-property-to-create-a-column-in-the-tweet-embed.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/apply-the-flex-direction-property-to-create-a-column-in-the-tweet-embed.arabic.md new file mode 100644 index 0000000000..af62ddda9e --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/apply-the-flex-direction-property-to-create-a-column-in-the-tweet-embed.arabic.md @@ -0,0 +1,136 @@ +--- +id: 587d78ac367417b2b2512af5 +title: Apply the flex-direction Property to Create a Column in the Tweet Embed +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: يجب أن يكون لعنصر .profile-name خاصية flex-direction مضبوطة على العمود. + testString: 'assert($(".profile-name").css("flex-direction") == "column", "The .profile-name element should have a flex-direction property set to column.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+ Quincy Larson's profile picture +
+

Quincy Larson

+

@ossia

+
+ +
+
+

I meet so many people who are in search of that one trick that will help them work smart. Even if you work smart, you still have to work hard.

+ 1:32 PM - 12 Jan 2018 +
+
+ + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/apply-the-flex-direction-property-to-create-rows-in-the-tweet-embed.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/apply-the-flex-direction-property-to-create-rows-in-the-tweet-embed.arabic.md new file mode 100644 index 0000000000..60848931df --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/apply-the-flex-direction-property-to-create-rows-in-the-tweet-embed.arabic.md @@ -0,0 +1,141 @@ +--- +id: 587d78ab367417b2b2512af3 +title: Apply the flex-direction Property to Create Rows in the Tweet Embed +challengeType: 0 +videoUrl: '' +localeTitle: قم بتطبيق الخاصية ذات الاتجاه المرن لإنشاء صفوف في تطبيق Tweet Tweet +--- + +## Description +
يشتمل header footer في مثال التضمين على عناصر فرعية يمكن ترتيبها كصفوف باستخدام خاصية flex-direction . هذا يخبر CSS لمحاذاة الأطفال أفقيًا.
+ +## Instructions +
أضف flex-direction CSS للمجموعة إلى كل من header footer واضبط القيمة على الصف.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون header عبارة flex-direction خاصية flex-direction مضبوط على الصف. + testString: 'assert(code.match(/header\s*?{[^}]*?flex-direction:\s*?row;/g), "The header should have a flex-direction property set to row.");' + - text: '' + testString: 'assert(code.match(/footer\s*?{[^}]*?flex-direction:\s*?row;/g), "The footer should have a flex-direction property set to row.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+ Quincy Larson's profile picture +
+

Quincy Larson

+

@ossia

+
+ +
+
+

I meet so many people who are in search of that one trick that will help them work smart. Even if you work smart, you still have to work hard.

+ 1:32 PM - 12 Jan 2018 +
+
+ + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-display-flex-to-position-two-boxes.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-display-flex-to-position-two-boxes.arabic.md new file mode 100644 index 0000000000..49ff5df4ba --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-display-flex-to-position-two-boxes.arabic.md @@ -0,0 +1,72 @@ +--- +id: 587d78ab367417b2b2512af0 +title: 'Use display: flex to Position Two Boxes' +challengeType: 0 +videoUrl: '' +localeTitle: 'استخدام العرض: فليكس لوضع صناديق اثنين' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert($("#box-container").css("display") == "flex", "#box-container should have the display property set to a value of flex.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+
+
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-align-items-property-in-the-tweet-embed.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-align-items-property-in-the-tweet-embed.arabic.md new file mode 100644 index 0000000000..6fa01a065a --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-align-items-property-in-the-tweet-embed.arabic.md @@ -0,0 +1,139 @@ +--- +id: 587d78ad367417b2b2512af9 +title: Use the align-items Property in the Tweet Embed +challengeType: 0 +videoUrl: '' +localeTitle: استخدم الخاصية align-items في Tweet Tweet +--- + +## Description +
التحدي الأخير قدم خاصية align-items وأعطى مثالاً. يمكن تطبيق هذه الخاصية على عدد قليل من عناصر التضمين لمحاذاة العناصر المرنة بداخلها.
+ +## Instructions +
إضافة align-items الخاصية CSS .follow-btn . قم بتعيين القيمة إلى الوسط.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون لعنصر .follow-btn مجموعة خصائص align-items إلى قيمة المركز. + testString: 'assert($(".follow-btn").css("align-items") == "center", "The .follow-btn element should have the align-items property set to a value of center.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+ Quincy Larson's profile picture +
+

Quincy Larson

+

@ossia

+
+ +
+
+

I meet so many people who are in search of that one trick that will help them work smart. Even if you work smart, you still have to work hard.

+ 1:32 PM - 12 Jan 2018 +
+
+ + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-align-self-property.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-align-self-property.arabic.md new file mode 100644 index 0000000000..0250f5e69f --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-align-self-property.arabic.md @@ -0,0 +1,74 @@ +--- +id: 587d78af367417b2b2512b00 +title: Use the align-self Property +challengeType: 0 +videoUrl: '' +localeTitle: استخدم خاصية self-align +--- + +## Description +
الخاصية النهائية للعناصر المرنة هي align-self . تتيح لك هذه الخاصية ضبط محاذاة كل عنصر على حدة ، بدلاً من ضبطها كلها مرة واحدة. وهذا مفيد لأن تقنيات التعديل الشائعة الأخرى التي تستخدم خصائص CSS float و clear و vertical-align لا تعمل على العناصر المرنة. align-self يقبل نفس القيم كعناصر align-items وسيتجاوز أي قيمة تم تعيينها بواسطة الخاصية align-items .
+ +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: 'يجب أن يحتوي عنصر #box-1 على خاصية align-self set to a value of center.' + testString: 'assert($("#box-1").css("align-self") == "center", "The #box-1 element should have the align-self property set to a value of center.");' + - text: 'يجب أن يحتوي عنصر #box-2 على الخاصية align-self set to a value of flex-end.' + testString: 'assert($("#box-2").css("align-self") == "flex-end", "The #box-2 element should have the align-self property set to a value of flex-end.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
+
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-flex-basis-property-to-set-the-initial-size-of-an-item.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-flex-basis-property-to-set-the-initial-size-of-an-item.arabic.md new file mode 100644 index 0000000000..d8067b0363 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-flex-basis-property-to-set-the-initial-size-of-an-item.arabic.md @@ -0,0 +1,77 @@ +--- +id: 587d78ae367417b2b2512afd +title: Use the flex-basis Property to Set the Initial Size of an Item +challengeType: 0 +videoUrl: '' +localeTitle: استخدم الخاصية الأساسية المرنة لتعيين الحجم الأولي لعنصر +--- + +## Description +
تحدد الخاصية flex-basis الحجم الأولي للعنصر قبل أن تقوم CSS بإجراء عمليات ضبط باستخدام flex-shrink أو flex-grow . الوحدات المستخدمة بواسطة الخاصية flex-basis هي نفس خصائص الحجم الأخرى ( px ، em ، % ، إلخ). عناصر قيمة الأحجام auto استنادًا إلى المحتوى.
+ +## Instructions +
اضبط الحجم الأولي للمربعات باستخدام flex-basis . أضف flex-basis إلى #box-1 و #box-2 . Give #box-1 a value of 10em and #box-2 a value of 20em .
+ +## Tests +
+ +```yml +tests: + - text: 'يجب أن يحتوي عنصر #box-1 على خاصية flex-basis .' + testString: 'assert($("#box-1").css("flex-basis") != "auto", "The #box-1 element should have a flex-basis property.");' + - text: 'يجب أن يحتوي عنصر #box-1 على قيمة flex-basis 10em .' + testString: 'assert(code.match(/#box-1\s*?{\s*?.*?\s*?.*?\s*?flex-basis:\s*?10em;/g), "The #box-1 element should have a flex-basis value of 10em.");' + - text: 'يجب أن يكون عنصر #box-2 الخاصية flex-basis .' + testString: 'assert($("#box-2").css("flex-basis") != "auto", "The #box-2 element should have the flex-basis property.");' + - text: 'يجب أن يحتوي عنصر #box-2 على قيمة flex-basis 20em .' + testString: 'assert(code.match(/#box-2\s*?{\s*?.*?\s*?.*?\s*?flex-basis:\s*?20em;/g), "The #box-2 element should have a flex-basis value of 20em.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
+
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-flex-direction-property-to-make-a-column.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-flex-direction-property-to-make-a-column.arabic.md new file mode 100644 index 0000000000..4162be36b8 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-flex-direction-property-to-make-a-column.arabic.md @@ -0,0 +1,71 @@ +--- +id: 587d78ac367417b2b2512af4 +title: Use the flex-direction Property to Make a Column +challengeType: 0 +videoUrl: '' +localeTitle: استخدم خاصية الاتجاه المرن لعمل عمود +--- + +## Description +
استخدم آخر تحديين خاصية flex-direction المضبوطة في الصف. يمكن لهذه الخاصية أيضًا إنشاء عمود عن طريق تكديس أطفال حاوية مرنة رأسيًا.
+ +## Instructions +
أضف خاصية flex-direction لعنصر #box-container ، واعطها قيمة للعمود.
+ +## Tests +
+ +```yml +tests: + - text: 'يجب أن #box-container عنصر #box-container خاصية flex-direction مضبوطة على العمود.' + testString: 'assert($("#box-container").css("flex-direction") == "column", "The #box-container element should have a flex-direction property set to column.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
+
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-flex-direction-property-to-make-a-row.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-flex-direction-property-to-make-a-row.arabic.md new file mode 100644 index 0000000000..f9d51b4487 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-flex-direction-property-to-make-a-row.arabic.md @@ -0,0 +1,71 @@ +--- +id: 587d78ab367417b2b2512af2 +title: Use the flex-direction Property to Make a Row +challengeType: 0 +videoUrl: '' +localeTitle: استخدم خاصية الاتجاه المرن لإجراء صف +--- + +## Description +
إضافة display: flex لعنصر يحولها إلى حاوية مرنة. هذا يجعل من الممكن محاذاة أي أطفال من هذا العنصر إلى صفوف أو أعمدة. يمكنك القيام بذلك عن طريق إضافة الخاصية flex-direction إلى العنصر الأصل وتعيينه إلى الصف أو العمود. يؤدي إنشاء صف إلى محاذاة الأطفال أفقيًا ، وسيؤدي إنشاء عمود إلى محاذاة الأطفال رأسيًا. الخيارات الأخرى flex-direction هي عكس الصفوف وعكس الأعمدة. ملحوظة
القيمة الافتراضية لخاصية flex-direction هي صف.
+ +## Instructions +
أضف خاصية flex-direction لعنصر #box-container ، وأعطها قيمة عكس صف.
+ +## Tests +
+ +```yml +tests: + - text: 'يجب أن #box-container عنصر #box-container خاصية flex-direction مضبوطة على عكس الصف.' + testString: 'assert($("#box-container").css("flex-direction") == "row-reverse", "The #box-container element should have a flex-direction property set to row-reverse.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
+
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-flex-grow-property-to-expand-items.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-flex-grow-property-to-expand-items.arabic.md new file mode 100644 index 0000000000..731855cad6 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-flex-grow-property-to-expand-items.arabic.md @@ -0,0 +1,73 @@ +--- +id: 587d78ae367417b2b2512afc +title: Use the flex-grow Property to Expand Items +challengeType: 0 +videoUrl: '' +localeTitle: استخدم خاصية Flex-grow لتوسيع العناصر +--- + +## Description +
عكس flex-shrink هو خاصية flex-grow . أذكر أن flex-shrink في حجم العناصر عندما تنكمش الحاوية. تتحكم الخاصية flex-grow حجم العناصر عندما يتم توسيع الحاوية الأصل. باستخدام مثال مماثل من التحدي الأخير ، إذا كان أحد العناصر يحتوي على قيمة flex-grow من 1 ، والآخر له قيمة flex-grow 3 ، فإن القيمة ذات القيمة 3 ستنمو بثلاثة أضعاف.
+ +## Instructions +
قم بإضافة الخاصية CSS flex-grow إلى كلا #box-1 و #box-2 . Give #box-1 a value of 1 and #box-2 a value of 2.
+ +## Tests +
+ +```yml +tests: + - text: 'يجب أن يحتوي عنصر #box-1 على الخاصية flex-grow set إلى قيمة 1.' + testString: 'assert($("#box-1").css("flex-grow") == "1", "The #box-1 element should have the flex-grow property set to a value of 1.");' + - text: 'يجب أن يحتوي عنصر #box-2 على الخاصية flex-grow set to a value of 2.' + testString: 'assert($("#box-2").css("flex-grow") == "2", "The #box-2 element should have the flex-grow property set to a value of 2.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
+
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-flex-shorthand-property.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-flex-shorthand-property.arabic.md new file mode 100644 index 0000000000..d3fdc0bbd7 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-flex-shorthand-property.arabic.md @@ -0,0 +1,74 @@ +--- +id: 587d78ae367417b2b2512afe +title: Use the flex Shorthand Property +challengeType: 0 +videoUrl: '' +localeTitle: استخدم خاصية الاختزال المرن +--- + +## Description +
هناك اختصار متاح لضبط عدة خصائص المرن دفعة واحدة. يمكن تعيين الخصائص flex-grow و flex-shrink و flex-basis معاً باستخدام الخاصية flex . على سبيل المثال ، flex: 1 0 10px; سيحدد العنصر إلى flex-grow: 1; ، flex-shrink: 0; ، و flex-basis: 10px; . إعدادات الخاصية الافتراضية هي flex: 0 1 auto; .
+ +## Instructions +
إضافة flex إلى #box-1 و #box-2 . قم بإعطاء #box-1 القيم بحيث يكون نموها flex-grow 2 ، حيث يكون flex-shrink 2 ، ويكون أساسه flex-basis 150 بكسل. أعط #box-2 القيم بحيث يكون flex-grow flex-shrink هو 1 ، و هو flex-shrink هو 1 ، و أساسه flex-basis هو 150 بكسل. ستؤدي هذه القيم إلى زيادة #box-1 لملء المساحة الزائدة بمعدل ضعف #box-2 عندما تكون الحاوية أكبر من 300 بكسل وتتقلص بمعدل ضعف #box-2 عندما تكون الحاوية أقل من 300 بكسل. يمثل 300 بكسل الحجم المجمع لقيم flex-basis .
+ +## Tests +
+ +```yml +tests: + - text: 'يجب أن يحتوي عنصر #box-1 على مجموعة خصائص flex بقيمة 2 2 150 بكسل.' + testString: 'assert($("#box-1").css("flex-grow") == "2" && $("#box-1").css("flex-shrink") == "2" && $("#box-1").css("flex-basis") == "150px", "The #box-1 element should have the flex property set to a value of 2 2 150px.");' + - text: 'يجب أن يحتوي عنصر #box-2 على مجموعة خصائص flex بقيمة 1 1 150 بكسل.' + testString: 'assert($("#box-2").css("flex-grow") == "1" && $("#box-2").css("flex-shrink") == "1" && $("#box-2").css("flex-basis") == "150px", "The #box-2 element should have the flex property set to a value of 1 1 150px.");' + - text: 'يجب أن تستخدم الشفرة الخاصة بك الخاصية flex لـ #box-1 و #box-2 .' + testString: 'assert(code.match(/flex:\s*?\d\s+?\d\s+?150px;/g).length == 2, "Your code should use the flex property for #box-1 and #box-2.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
+
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-flex-shrink-property-to-shrink-items.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-flex-shrink-property-to-shrink-items.arabic.md new file mode 100644 index 0000000000..10b35753be --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-flex-shrink-property-to-shrink-items.arabic.md @@ -0,0 +1,74 @@ +--- +id: 587d78ad367417b2b2512afb +title: Use the flex-shrink Property to Shrink Items +challengeType: 0 +videoUrl: '' +localeTitle: استخدم خاصية الانكماش المرن لتقليص العناصر +--- + +## Description +
حتى الآن ، تنطبق جميع الخصائص في التحديات على الحاوية المرنة (أصل العناصر المرنة). ومع ذلك ، هناك العديد من الخصائص المفيدة للعناصر المرنة. الأول هو خاصية flex-shrink . عندما يتم استخدامه ، فإنه يسمح بتقليص عنصر إذا كانت الحاوية المرن صغيرة جدًا. تنكمش العناصر عندما يكون عرض الحاوية الأصل أصغر من عرض جميع العناصر المرن الموجودة بها. تأخذ خاصية flex-shrink الأعداد كقيم. كلما زاد العدد ، كلما تنكمش أكثر مقارنة بالعناصر الأخرى في الحاوية. على سبيل المثال ، إذا كان عنصر واحد يحتوي على قيمة flex-shrink 1 والآخر يحتوي على قيمة flex-shrink 3 ، فإن القيمة التي تحتوي على 3 سوف تتقلص ثلاثة أضعاف نفس الأخرى.
+ +## Instructions +
أضف خاصية CSS flex-shrink إلى كل من #box-1 و #box-2 . Give #box-1 a value of 1 and #box-2 a value of 2.
+ +## Tests +
+ +```yml +tests: + - text: 'يجب أن يحتوي عنصر #box-1 على خاصية flex-shrink تعيينها إلى قيمة 1.' + testString: 'assert($("#box-1").css("flex-shrink") == "1", "The #box-1 element should have the flex-shrink property set to a value of 1.");' + - text: 'يجب أن يحتوي عنصر #box-2 على الخاصية flex-shrink تعيينها إلى قيمة 2.' + testString: 'assert($("#box-2").css("flex-shrink") == "2", "The #box-2 element should have the flex-shrink property set to a value of 2.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
+
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-flex-wrap-property-to-wrap-a-row-or-column.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-flex-wrap-property-to-wrap-a-row-or-column.arabic.md new file mode 100644 index 0000000000..0bbee82906 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-flex-wrap-property-to-wrap-a-row-or-column.arabic.md @@ -0,0 +1,96 @@ +--- +id: 587d78ad367417b2b2512afa +title: Use the flex-wrap Property to Wrap a Row or Column +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +
يحتوي CSS flexbox على ميزة لتقسيم عنصر مرن إلى صفوف متعددة (أو أعمدة). بشكل افتراضي ، ستلائم حاوية مرنة جميع العناصر المرنة معًا. على سبيل المثال ، سيكون كل صف على سطر واحد. ومع ذلك ، باستخدام خاصية flex-wrap ، فإنه يخبر CSS التفاف العناصر. هذا يعني أن العناصر الإضافية تنتقل إلى صف أو عمود جديد. تتوقف نقطة توقف المكان الذي يحدث فيه الالتفاف على حجم العناصر وحجم الحاوية. يحتوي CSS أيضًا على خيارات لاتجاه الالتفاف:
+ +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: 'يجب أن #box-container عنصر #box-container الخاصية flex-wrap لتعيين قيمة التفاف.' + testString: 'assert($("#box-container").css("flex-wrap") == "wrap", "The #box-container element should have the flex-wrap property set to a value of wrap.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
+
+
+
+
+
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-justify-content-property-in-the-tweet-embed.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-justify-content-property-in-the-tweet-embed.arabic.md new file mode 100644 index 0000000000..8143b3f164 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-justify-content-property-in-the-tweet-embed.arabic.md @@ -0,0 +1,137 @@ +--- +id: 587d78ac367417b2b2512af7 +title: Use the justify-content Property in the Tweet Embed +challengeType: 0 +videoUrl: '' +localeTitle: استخدم خاصية theify-content في تطبيق Tweet Tweet +--- + +## Description +
أظهر التحدي الأخير مثالاً على خاصية justify-content . لتضمين tweet ، يمكن تطبيق هذه الخاصية لمحاذاة العناصر في عنصر .profile-name ملف .profile-name .
+ +## Instructions +
قم بإضافة خاصية CSS justify-content إلى عنوان اسم ملف .profile-name وتعيين القيمة إلى أي من الخيارات من التحدي الأخير.
+ +## Tests +
+ +```yml +tests: + - text: 'يجب أن يكون لعنصر .profile-name خاصية ضبط justify-content المضبوطة على أي من هذه القيم: مركز ، أو بداية مرنة ، أو نهاية مرنة ، أو مسافة بينية ، أو مسافة.' + testString: 'assert(code.match(/header\s.profile-name\s*{\s*?.*?\s*?.*?\s*?\s*?.*?\s*?justify-content\s*:\s*(center|flex-start|flex-end|space-between|space-around)\s*;/g), "The .profile-name element should have the justify-content property set to any of these values: center, flex-start, flex-end, space-between, or space-around.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+ Quincy Larson's profile picture +
+

Quincy Larson

+

@ossia

+
+ +
+
+

I meet so many people who are in search of that one trick that will help them work smart. Even if you work smart, you still have to work hard.

+ 1:32 PM - 12 Jan 2018 +
+
+ + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-order-property-to-rearrange-items.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-order-property-to-rearrange-items.arabic.md new file mode 100644 index 0000000000..0794dc1e04 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-flexbox/use-the-order-property-to-rearrange-items.arabic.md @@ -0,0 +1,74 @@ +--- +id: 587d78ae367417b2b2512aff +title: Use the order Property to Rearrange Items +challengeType: 0 +videoUrl: '' +localeTitle: استخدم خاصية الطلب لإعادة ترتيب العناصر +--- + +## Description +
يتم استخدام خاصية order لإخبار CSS بترتيب ظهور العناصر المرنة في الحاوية المرنة. بشكل افتراضي ، ستظهر العناصر بنفس الترتيب الوارد في مصدر HTML. يأخذ الخاصية الأرقام كقيم ، ويمكن استخدام الأرقام السالبة.
+ +## Instructions +
قم بإضافة order الخاصية CSS إلى كل من #box-1 و #box-2 . أعط #box-1 قيمة 2 وأعطي #box-2 قيمة 1.
+ +## Tests +
+ +```yml +tests: + - text: 'يجب أن يحتوي عنصر #box-1 على خاصية order تعيينها على قيمة 2.' + testString: 'assert($("#box-1").css("order") == "2", "The #box-1 element should have the order property set to a value of 2.");' + - text: 'يجب أن يحتوي عنصر #box-2 على خاصية order تعيينها إلى قيمة 1.' + testString: 'assert($("#box-2").css("order") == "1", "The #box-2 element should have the order property set to a value of 1.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
+
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-grid/add-columns-with-grid-template-columns.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/add-columns-with-grid-template-columns.arabic.md new file mode 100644 index 0000000000..c2279644ea --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/add-columns-with-grid-template-columns.arabic.md @@ -0,0 +1,74 @@ +--- +id: 5a9036d038fddaf9a66b5d32 +title: Add Columns with grid-template-columns +challengeType: 0 +videoUrl: '' +localeTitle: إضافة أعمدة بأعمدة قالب الشبكة +--- + +## Description +
ببساطة إنشاء عنصر الشبكة لا يجعلك بعيدا جدا. تحتاج إلى تحديد هيكل الشبكة كذلك. لإضافة بعض الأعمدة إلى الشبكة ، استخدم الخاصية grid-template-columns الشبكة على حاوية شبكة كما هو موضح أدناه:
.حاوية {
عرض: الشبكة ؛
أعمدة قالب الشبكة: 50 بكسل 50 بكسل ؛
}
سيعطي هذا شبكتك عمودين بعرض 50 بكسل لكل منهما. يشير عدد المعلمات إلى خاصية grid-template-columns إلى عدد الأعمدة في الشبكة ، وتشير قيمة كل معلمة إلى عرض كل عمود.
+ +## Instructions +
امنح حاوية الشبكة ثلاثة أعمدة عرضها 100px لكل منها.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن container فئة container grid-template-columns خاصية grid-template-columns بثلاث وحدات 100px . + testString: 'assert(code.match(/.container\s*?{[\s\S]*grid-template-columns\s*?:\s*?100px\s*?100px\s*?100px\s*?;[\s\S]*}/gi), "container class should have a grid-template-columns property with three units of 100px.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
1
+
2
+
3
+
4
+
5
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-grid/add-gaps-faster-with-grid-gap.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/add-gaps-faster-with-grid-gap.arabic.md new file mode 100644 index 0000000000..22b9047ecf --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/add-gaps-faster-with-grid-gap.arabic.md @@ -0,0 +1,76 @@ +--- +id: 5a9036ee38fddaf9a66b5d37 +title: Add Gaps Faster with grid-gap +challengeType: 0 +videoUrl: '' +localeTitle: أضف فجوات أسرع مع الفجوة الشبكية +--- + +## Description +
grid-gap هي خاصية مختزلة grid-row-gap grid-column-gap ، grid-row-gap grid-column-gap من التحديين السابقتين الأكثر ملاءمة للاستخدام. إذا كانت قيمة grid-gap لها قيمة واحدة ، فسوف تنشئ فجوة بين جميع الصفوف والأعمدة. ومع ذلك ، إذا كان هناك قيمتين ، فسيستخدم الأول منها لتعيين الفجوة بين الصفوف والقيمة الثانية للأعمدة.
+ +## Instructions +
استخدم grid-gap لإدخال فجوة 10 10px بين الصفوف والفجوة 20 20px بين الأعمدة.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن container فئة container على خاصية grid-gap تقدم فجوة 10 10px بين الصفوف والفجوة 20 20px بين الأعمدة. + testString: 'assert(code.match(/.container\s*?{[\s\S]*grid-gap\s*?:\s*?10px\s+?20px\s*?;[\s\S]*}/gi), "container class should have a grid-gap property that introduces 10px gap between the rows and 20px gap between the columns.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+
1
+
2
+
3
+
4
+
5
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-grid/add-rows-with-grid-template-rows.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/add-rows-with-grid-template-rows.arabic.md new file mode 100644 index 0000000000..c558c15aa8 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/add-rows-with-grid-template-rows.arabic.md @@ -0,0 +1,75 @@ +--- +id: 5a9036e138fddaf9a66b5d33 +title: Add Rows with grid-template-rows +challengeType: 0 +videoUrl: '' +localeTitle: إضافة صفوف مع صفوف قالب الشبكة +--- + +## Description +
الشبكة التي أنشأتها في التحدي الأخير ستحدد عدد الصفوف تلقائيًا. لضبط الصفوف يدويًا ، استخدم خاصية grid-template-rows بنفس طريقة استخدام grid-template-columns في التحدي السابق.
+ +## Instructions +
أضف صفين إلى الشبكة التي يبلغ طول كل منها 50px .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن container فئة container grid-template-rows خاصية grid-template-rows 50px . + testString: 'assert(code.match(/.container\s*?{[\s\S]*grid-template-rows\s*?:\s*?50px\s*?50px\s*?;[\s\S]*}/gi), "container class should have a grid-template-rows property with two units of 50px.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
1
+
2
+
3
+
4
+
5
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-grid/align-all-items-horizontally-using-justify-items.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/align-all-items-horizontally-using-justify-items.arabic.md new file mode 100644 index 0000000000..01542a6a0b --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/align-all-items-horizontally-using-justify-items.arabic.md @@ -0,0 +1,78 @@ +--- +id: 5a90376038fddaf9a66b5d3c +title: Align All Items Horizontally using justify-items +challengeType: 0 +videoUrl: '' +localeTitle: محاذاة جميع العناصر أفقيا باستخدام تبرير البنود +--- + +## Description +
في بعض الأحيان تريد أن تشترك جميع العناصر في CSS الخاص بك في نفس المحاذاة. يمكنك استخدام الخصائص التي تم تعلُّمها مسبقًا ومحاذاؤها بشكل فردي ، أو يمكنك محاذاةها كلها مرة واحدة أفقيًا باستخدام justify-items ضبط في حاوية الشبكة. يمكن أن تقبل هذه الخاصية جميع القيم نفسها التي تعلمتها في التحديين السابقين ، والفرق بينهما هو أنه سينقل كل العناصر في شبكتنا إلى المحاذاة المطلوبة.
+ +## Instructions +
استخدم هذه الخاصية لتوسيط جميع العناصر أفقيا.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن container فئة container على خاصية justify-items لها قيمة center . + testString: 'assert(code.match(/.container\s*?{[\s\S]*justify-items\s*?:\s*?center\s*?;[\s\S]*}/gi), "container class should have a justify-items property that has the value of center.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
1
+
2
+
3
+
4
+
5
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-grid/align-all-items-vertically-using-align-items.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/align-all-items-vertically-using-align-items.arabic.md new file mode 100644 index 0000000000..8ca38e9928 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/align-all-items-vertically-using-align-items.arabic.md @@ -0,0 +1,78 @@ +--- +id: 5a94fdf869fb03452672e45b +title: Align All Items Vertically using align-items +challengeType: 0 +videoUrl: '' +localeTitle: محاذاة جميع العناصر رأسيًا باستخدام عناصر المحاذاة +--- + +## Description +
باستخدام الخاصية align-items على حاوية شبكة ، سيتم ضبط المحاذاة الرأسية لكافة العناصر في شبكتنا.
+ +## Instructions +
استخدمه الآن لنقل جميع العناصر إلى نهاية كل خلية.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن container فئة container على خاصية align-items تحتوي على قيمة end . + testString: 'assert(code.match(/.container\s*?{[\s\S]*align-items\s*?:\s*?end\s*?;[\s\S]*}/gi), "container class should have a align-items property that has the value of end.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
1
+
2
+
3
+
4
+
5
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-grid/align-an-item-horizontally-using-justify-self.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/align-an-item-horizontally-using-justify-self.arabic.md new file mode 100644 index 0000000000..14cbb8876a --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/align-an-item-horizontally-using-justify-self.arabic.md @@ -0,0 +1,82 @@ +--- +id: 5a90374338fddaf9a66b5d3a +title: Align an Item Horizontally using justify-self +challengeType: 0 +videoUrl: '' +localeTitle: قم بمحاذاة عنصر أفقيًا باستخدام ضبط self-self +--- + +## Description +
في CSS Grid ، يقع محتوى كل عنصر في مربع يُشار إليه بالخلية . يمكنك محاذاة موضع المحتوى داخل خليتها أفقياً باستخدام الخاصية justify-self على عنصر شبكة. بشكل افتراضي ، تحتوي هذه الخاصية على قيمة stretch ، والتي ستجعل المحتوى يملأ عرض الخلية بالكامل. تقبل خاصية CSS Grands هذه القيم الأخرى أيضًا: start : محاذاة المحتوى على يمين الخلية ، center : محاذاة المحتوى في وسط الخلية ، end : محاذاة المحتوى على يمين الخلية.
+ +## Instructions +
استخدم خاصية justify-self لتوسيط العنصر مع item2 .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون لفئة item2 خاصية justify-self لها قيمة center . + testString: 'assert(code.match(/.item2\s*?{[\s\S]*justify-self\s*?:\s*?center\s*?;[\s\S]*}/gi), "item2 class should have a justify-self property that has the value of center.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
1
+
2
+
3
+
4
+
5
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-grid/align-an-item-vertically-using-align-self.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/align-an-item-vertically-using-align-self.arabic.md new file mode 100644 index 0000000000..a9108365ca --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/align-an-item-vertically-using-align-self.arabic.md @@ -0,0 +1,82 @@ +--- +id: 5a90375238fddaf9a66b5d3b +title: Align an Item Vertically using align-self +challengeType: 0 +videoUrl: '' +localeTitle: محاذاة عنصر عموديًا باستخدام محاذاة ذاتية +--- + +## Description +
كما يمكنك محاذاة عنصر أفقيًا ، توجد طريقة لمحاذاة عنصر بشكل عمودي أيضًا. للقيام بذلك ، يمكنك استخدام الخاصية align-self على عنصر. تقبل هذه الخاصية جميع القيم نفسها مثل justify-self من التحدي الأخير.
+ +## Instructions +
قم بمحاذاة العنصر مع item item3 عمودي في end .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تحتوي فئة item3 على خاصية align-self لديها قيمة end . + testString: 'assert(code.match(/.item3\s*?{[\s\S]*align-self\s*?:\s*?end\s*?;[\s\S]*}/gi), "item3 class should have a align-self property that has the value of end.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
1
+
2
+
3
+
4
+
5
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-grid/create-a-column-gap-using-grid-column-gap.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/create-a-column-gap-using-grid-column-gap.arabic.md new file mode 100644 index 0000000000..3e30c181a5 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/create-a-column-gap-using-grid-column-gap.arabic.md @@ -0,0 +1,77 @@ +--- +id: 5a9036ee38fddaf9a66b5d35 +title: Create a Column Gap Using grid-column-gap +challengeType: 0 +videoUrl: '' +localeTitle: إنشاء فجوة عمود باستخدام الفجوة بين عمود الشبكة +--- + +## Description +
حتى الآن في الشبكات التي قمت بإنشائها ، كانت الأعمدة محصورة ضد بعضها البعض. في بعض الأحيان تريد فجوة بين الأعمدة. لإضافة فجوة بين الأعمدة ، استخدم خاصية grid-column-gap مثل هذا:
الفجوة بين الأعمدة الشبكية: 10 بكسل ؛
هذا يخلق 10px من المساحة الفارغة بين جميع أعمدةنا.
+ +## Instructions +
امنح الأعمدة في الشبكة فجوة 20 20px .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن container فئة container grid-column-gap خاصية grid-column-gap قيمة 20 20px . + testString: 'assert(code.match(/.container\s*?{[\s\S]*grid-column-gap\s*?:\s*?20px\s*?;[\s\S]*}/gi), "container class should have a grid-column-gap property that has the value of 20px.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
1
+
2
+
3
+
4
+
5
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-grid/create-a-row-gap-using-grid-row-gap.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/create-a-row-gap-using-grid-row-gap.arabic.md new file mode 100644 index 0000000000..fc1650a162 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/create-a-row-gap-using-grid-row-gap.arabic.md @@ -0,0 +1,77 @@ +--- +id: 5a9036ee38fddaf9a66b5d36 +title: Create a Row Gap using grid-row-gap +challengeType: 0 +videoUrl: '' +localeTitle: إنشاء فجوة صف باستخدام الفجوة بين الشبكة +--- + +## Description +
يمكنك إضافة الفجوة بين الصفوف من الشبكة باستخدام grid-row-gap في بنفس الطريقة التي قمت بإضافتها وجود فجوة بين الأعمدة في التحدي السابق.
+ +## Instructions +
أنشئ فجوة للصفوف التي يبلغ طولها 5 5px .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن container فئة container على خاصية grid-row-gap لها قيمة 5px . + testString: 'assert(code.match(/.container\s*?{[\s\S]*grid-row-gap\s*?:\s*?5px\s*?;[\s\S]*}/gi), "container class should have a grid-row-gap property that has the value of 5px.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
1
+
2
+
3
+
4
+
5
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-grid/create-flexible-layouts-using-auto-fill.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/create-flexible-layouts-using-auto-fill.arabic.md new file mode 100644 index 0000000000..c6b86d6975 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/create-flexible-layouts-using-auto-fill.arabic.md @@ -0,0 +1,95 @@ +--- +id: 5a94fe5469fb03452672e461 +title: Create Flexible Layouts Using auto-fill +challengeType: 0 +videoUrl: '' +localeTitle: إنشاء تنسيقات مرنة باستخدام الملء التلقائي +--- + +## Description +
تأتي وظيفة التكرار مع خيار يطلق عليه الملء التلقائي . يسمح لك هذا بإدراج عدد من الصفوف أو الأعمدة ذات الحجم المرغوب فيه تلقائيًا قدر الإمكان اعتمادًا على حجم الحاوية. يمكنك إنشاء تخطيطات مرنة عند الجمع بين auto-fill مع minmax . في المعاينة ، يتم ضبط grid-template-columns على
تكرار (الملء التلقائي ، minmax (60px ، 1fr)) ؛
عندما يتغير حجم الحاوية ، يستمر هذا الإعداد في إدخال أعمدة 60 بكسل ويطيلها حتى تتمكن من إدراج عمود آخر. ملحوظة
إذا لم تستطع الحاوية استيعاب جميع العناصر في صف واحد ، فسينقلها إلى آخر جديد.
+ +## Instructions +
في الشبكة الأولى ، استخدم auto-fill مع repeat لملء الشبكة بالأعمدة التي يبلغ عرضها 60px 1fr كحد أدنى والحد الأقصى 1fr . ثم قم بتغيير حجم المعاينة لتشاهد الملء التلقائي للعمل.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن container فئة container grid-template-columns خاصية grid-template-columns repeat auto-fill التي تملأ الشبكة بأعمدة ذات عرض 60px 1fr كحد أدنى والحد الأقصى 1fr . + testString: 'assert(code.match(/.container\s*?{[\s\S]*grid-template-columns\s*?:\s*?repeat\s*?\(\s*?auto-fill\s*?,\s*?minmax\s*?\(\s*?60px\s*?,\s*?1fr\s*?\)\s*?\)\s*?;[\s\S]*}/gi), "container class should have a grid-template-columns property with repeat and auto-fill that will fill the grid with columns that have a minimum width of 60px and maximum of 1fr.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + +
+
1
+
2
+
3
+
4
+
5
+
+
+
1
+
2
+
3
+
4
+
5
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-grid/create-flexible-layouts-using-auto-fit.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/create-flexible-layouts-using-auto-fit.arabic.md new file mode 100644 index 0000000000..1c11e1fe4a --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/create-flexible-layouts-using-auto-fit.arabic.md @@ -0,0 +1,96 @@ +--- +id: 5a94fe6269fb03452672e462 +title: Create Flexible Layouts Using auto-fit +challengeType: 0 +videoUrl: '' +localeTitle: إنشاء تصميمات مرنة باستخدام الملاءمة التلقائية +--- + +## Description +
تعمل auto-fit تقريبًا تمامًا auto-fill . والفرق الوحيد هو أنه عندما يتجاوز حجم الحاوية حجم جميع العناصر مجتمعة ، auto-fill تحافظ على إدخال صفوف أو أعمدة فارغة وتدفع عناصرك إلى الجانب ، بينما auto-fill auto-fit تصغير تلك الصفوف أو الأعمدة الفارغة وتمديد العناصر الخاصة بك إلى تناسب حجم الحاوية. ملحوظة
إذا لم تستطع الحاوية استيعاب جميع العناصر في صف واحد ، فسينقلها إلى آخر جديد.
+ +## Instructions +
في الشبكة الثانية ، استخدم auto-fit مع repeat لملء الشبكة بالأعمدة التي يبلغ عرضها 60px 1fr كحد أدنى والحد الأقصى 1fr . ثم قم بتغيير حجم المعاينة لمعرفة الفرق.
+ +## Tests +
+ +```yml +tests: + - text: container2 يجب أن يكون من الدرجة على grid-template-columns الملكية مع repeat و auto-fit من شأنها أن تملأ الشبكة مع الأعمدة التي لها الحد الأدنى من عرض 60px والحد الأقصى من 1fr . + testString: 'assert(code.match(/.container\s*?{[\s\S]*grid-template-columns\s*?:\s*?repeat\s*?\(\s*?auto-fit\s*?,\s*?minmax\s*?\(\s*?60px\s*?,\s*?1fr\s*?\)\s*?\)\s*?;[\s\S]*}/gi), "container2 class should have a grid-template-columns property with repeat and auto-fit that will fill the grid with columns that have a minimum width of 60px and maximum of 1fr.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
1
+
2
+
3
+
4
+
5
+
+
+
1
+
2
+
3
+
4
+
5
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-grid/create-grids-within-grids.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/create-grids-within-grids.arabic.md new file mode 100644 index 0000000000..820daae84c --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/create-grids-within-grids.arabic.md @@ -0,0 +1,108 @@ +--- +id: 5a94fe8569fb03452672e464 +title: Create Grids within Grids +challengeType: 0 +videoUrl: '' +localeTitle: إنشاء شبكات داخل شبكات +--- + +## Description +
تحويل عنصر إلى شبكة يؤثر فقط على سلوك أحفادها مباشرة. لذا من خلال تحويل سليل مباشر إلى شبكة ، يكون لديك شبكة داخل الشبكة. على سبيل المثال ، من خلال تعيين خصائص grid-template-columns display grid-template-columns للعنصر مع فئة item3 ، تقوم بإنشاء شبكة داخل الشبكة.
+ +## Instructions +
قم item3 العنصر مع فئة item3 إلى شبكة ذات عمودين مع عرض auto و 1fr باستخدام 1fr display grid-template-columns .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تحتوي فئة item3 grid-template-columns خاصية grid-template-columns مع auto و 1fr كقيم. + testString: 'assert(code.match(/.item3\s*?{[\s\S]*grid-template-columns\s*?:\s*?auto\s*?1fr\s*?;[\s\S]*}/gi), "item3 class should have a grid-template-columns property with auto and 1fr as values.");' + - text: يجب أن يكون فئة item3 خاصية display بقيمة grid . + testString: 'assert(code.match(/.item3\s*?{[\s\S]*display\s*?:\s*?grid\s*?;[\s\S]*}/gi), "item3 class should have a display property with the value of grid.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
header
+
advert
+
+
paragraph1
+
paragraph2
+
+
footer
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-grid/create-your-first-css-grid.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/create-your-first-css-grid.arabic.md new file mode 100644 index 0000000000..c9db78d1ea --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/create-your-first-css-grid.arabic.md @@ -0,0 +1,73 @@ +--- +id: 5a858944d96184f06fd60d61 +title: Create Your First CSS Grid +challengeType: 0 +videoUrl: '' +localeTitle: إنشاء أول شبكة CSS +--- + +## Description +
قم بتحويل أي عنصر HTML إلى حاوية شبكة عن طريق تعيين خاصية display الخاصة بها إلى grid . يمنحك ذلك القدرة على استخدام جميع الخصائص الأخرى المرتبطة بـ CSS Grid. ملحوظة
في CSS Grid ، تتم الإشارة إلى العنصر الرئيسي على أنه الحاوية ويطلق على أطفاله العناصر .
+ +## Instructions +
تغيير عرض div مع فئة container إلى grid .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون لفئة container خاصية display بقيمة grid . + testString: 'assert(code.match(/.container\s*?{[\s\S]*display\s*?:\s*?grid\s*?;[\s\S]*}/gi), "container class should have a display property with a value of grid.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
1
+
2
+
3
+
4
+
5
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-grid/divide-the-grid-into-an-area-template.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/divide-the-grid-into-an-area-template.arabic.md new file mode 100644 index 0000000000..9966345fc6 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/divide-the-grid-into-an-area-template.arabic.md @@ -0,0 +1,81 @@ +--- +id: 5a94fe0569fb03452672e45c +title: Divide the Grid Into an Area Template +challengeType: 0 +videoUrl: '' +localeTitle: تقسيم الشبكة في قالب المنطقة +--- + +## Description +
يمكنك تجميع خلايا الشبكة الخاصة بك معًا في منطقة وإعطاء المنطقة اسمًا مخصصًا. القيام بذلك عن طريق استخدام grid-template-areas على الحاوية مثل هذا:
شبكة قالب والمناطق:
"رأس الصفحة الرأسية"
"advert content content"
"footer footer footer" ؛
يدمج الرمز أعلاه الخلايا الثلاث العليا معًا في منطقة مسماة header ، والخلايا الثلاثة السفلية في منطقة footer ، ويجعل منطقتين في الصف الأوسط ؛ advert content . ملحوظة
تمثل كل كلمة في التعليمة البرمجية خلية ويمثل كل زوج من علامات الاقتباس صفًا. بالإضافة إلى التصنيفات المخصصة ، يمكنك استخدام نقطة ( . ) لتعيين خلية فارغة في الشبكة.
+ +## Instructions +
ضع قالب المنطقة بحيث تصبح الخلية المسمى advert عبارة عن خلية فارغة.
+ +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(code.match(/.container\s*?{[\s\S]*grid-template-areas\s*?:\s*?"\s*?header\s*?header\s*?header\s*?"\s*?"\s*?.\s*?content\s*?content\s*?"\s*?"\s*?footer\s*?footer\s*?footer\s*?"\s*?;[\s\S]*}/gi), "container class should have a grid-template-areas propertiy similar to the preview but has . instead of the advert area.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
1
+
2
+
3
+
4
+
5
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-grid/limit-item-size-using-the-minmax-function.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/limit-item-size-using-the-minmax-function.arabic.md new file mode 100644 index 0000000000..d8bc6712f5 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/limit-item-size-using-the-minmax-function.arabic.md @@ -0,0 +1,78 @@ +--- +id: 5a94fe4469fb03452672e460 +title: Limit Item Size Using the minmax Function +challengeType: 0 +videoUrl: '' +localeTitle: الحد من حجم البند باستخدام وظيفة minmax +--- + +## Description +
هناك وظيفة أخرى مدمجة لاستخدامها مع grid-template-columns grid-template-rows تسمى minmax . يتم استخدامه لتقييد حجم العناصر عند تغيير حجم حاوية الشبكة. للقيام بذلك ، تحتاج إلى تحديد نطاق الحجم المقبول لعنصرك. هنا مثال:
أعمدة قوالب الشبكة: minmax 100 بكسل (50 بكسل ، 200 بكسل) ؛
في التعليمات البرمجية أعلاه ، يتم تعيين grid-template-columns لإنشاء عمودين ؛ الأول بعرض 100 بكسل ، والثاني يحتوي على الحد الأدنى للعرض 50 بكسل والحد الأقصى للعرض 200 بكسل.
+ +## Instructions +
باستخدام minmax وظيفة، استبدل 1fr في repeat وظيفة مع حجم العمود الذي يحتوي الحد الأدنى للعرض 90px والحد الأقصى للعرض 1fr ، وتغيير حجم لوحة المعاينة لمعرفة التأثير.
+ +## Tests +
+ +```yml +tests: + - text: container يجب أن يكون من الدرجة على grid-template-columns الممتلكات التي تم تعيينها لتكرار 3 أعمدة مع الحد الأدنى لعرض 90px وأقصى عرض لها 1fr . + testString: 'assert(code.match(/.container\s*?{[\s\S]*grid-template-columns\s*?:\s*?repeat\s*?\(\s*?3\s*?,\s*?minmax\s*?\(\s*?90px\s*?,\s*?1fr\s*?\)\s*?\)\s*?;[\s\S]*}/gi), "container class should have a grid-template-columns property that is set to repeat 3 columns with the minimum width of 90px and maximum width of 1fr.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
1
+
2
+
3
+
4
+
5
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-grid/place-items-in-grid-areas-using-the-grid-area-property.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/place-items-in-grid-areas-using-the-grid-area-property.arabic.md new file mode 100644 index 0000000000..d3d52ff600 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/place-items-in-grid-areas-using-the-grid-area-property.arabic.md @@ -0,0 +1,85 @@ +--- +id: 5a94fe1369fb03452672e45d +title: Place Items in Grid Areas Using the grid-area Property +challengeType: 0 +videoUrl: '' +localeTitle: ضع العناصر في مناطق الشبكة باستخدام الخاصية area-area +--- + +## Description +
بعد إنشاء قالب المناطق لحاوية الشبكة الخاصة بك ، كما هو موضح في التحدي السابق ، يمكنك وضع عنصر في منطقة مخصصة من خلال الرجوع إلى الاسم الذي قدمته. للقيام بذلك ، يمكنك استخدام الخاصية grid-area على عنصر مثل هذا:
.item1 {grid-area: header؛ }
هذا يتيح الشبكة معرفة أنك تريد الفئة item1 للانتقال في المنطقة المسمى header . في هذه الحالة ، سيستخدم العنصر الصف العلوي بأكمله لأن هذا الصف بأكمله يدعى منطقة الرأس.
+ +## Instructions +
ضع عنصرًا مع فئة item5 في منطقة footer باستخدام خاصية grid-area .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون فئة item5 خاصية grid-area له قيمة footer . + testString: 'assert(code.match(/.item5\s*?{[\s\S]*grid-area\s*?:\s*?footer\s*?;[\s\S]*}/gi), "item5 class should have a grid-area property that has the value of footer.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
1
+
2
+
3
+
4
+
5
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-grid/reduce-repetition-using-the-repeat-function.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/reduce-repetition-using-the-repeat-function.arabic.md new file mode 100644 index 0000000000..bf83c0c6e4 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/reduce-repetition-using-the-repeat-function.arabic.md @@ -0,0 +1,78 @@ +--- +id: 5a94fe3669fb03452672e45f +title: Reduce Repetition Using the repeat Function +challengeType: 0 +videoUrl: '' +localeTitle: تقليل التكرار باستخدام تكرار الوظيفة +--- + +## Description +
عند استخدام grid-template-columns grid-template-rows و grid-template-rows لتعريف بنية الشبكة ، فإنك تقوم بإدخال قيمة لكل صف أو عمود قمت بإنشائه. لنفترض أنك تريد شبكة ذات 100 صف من نفس الارتفاع. ليس عمليًا إدراج قيم 100 بشكل فردي. لحسن الحظ ، هناك طريقة أفضل - باستخدام وظيفة repeat لتحديد عدد المرات التي تريد تكرار عمودك أو صفك ، متبوعة بفاصلة والقيمة التي تريد تكرارها. في ما يلي مثال على ذلك من شأنه إنشاء شبكة الصف 100 ، كل صف بطول 50 بكسل.
صفوف قالب الشبكة: كرر (100 ، 50 بكسل) ؛
يمكنك أيضًا تكرار عدة قيم باستخدام وظيفة التكرار ، وإدراج الدالة بين القيم الأخرى عند تعريف بنية الشبكة. إليك ما أعنيه:
أعمدة قالب الشبكة: كرر (2 ، 1fr 50px) 20 بكسل ؛
هذا يترجم إلى:
أعمدة قالب الشبكة: 1fr 50px 1fr 50px 20px؛
ملحوظة
1fr 50px يتكرر مرتين يليه 1fr 50px .
+ +## Instructions +
استخدم repeat لإزالة التكرار من خاصية grid-template-columns .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن container فئة container grid-template-columns خاصية grid-template-columns التي تم تعيينها لتكرار 3 أعمدة بعرض 1fr . + testString: 'assert(code.match(/.container\s*?{[\s\S]*grid-template-columns\s*?:\s*?repeat\s*?\(\s*?3\s*?,\s*?1fr\s*?\)\s*?;[\s\S]*}/gi), "container class should have a grid-template-columns property that is set to repeat 3 columns with the width of 1fr.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
1
+
2
+
3
+
4
+
5
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-grid/use-css-grid-units-to-change-the-size-of-columns-and-rows.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/use-css-grid-units-to-change-the-size-of-columns-and-rows.arabic.md new file mode 100644 index 0000000000..7b941f0ece --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/use-css-grid-units-to-change-the-size-of-columns-and-rows.arabic.md @@ -0,0 +1,76 @@ +--- +id: 5a9036ee38fddaf9a66b5d34 +title: Use CSS Grid units to Change the Size of Columns and Rows +challengeType: 0 +videoUrl: '' +localeTitle: استخدم وحدات CSS الشبكة لتغيير حجم الأعمدة والصفوف +--- + +## Description +undefined + +## Instructions +
أنشئ شبكة بثلاثة أعمدة بعرضها كالتالي: 1fr و 100px و 2fr.
+ +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(code.match(/.container\s*?{[\s\S]*grid-template-columns\s*?:\s*?1fr\s*?100px\s*?2fr\s*?;[\s\S]*}/gi), "container class should have a grid-template-columns property that has three columns with the following widths: 1fr, 100px, and 2fr.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
1
+
2
+
3
+
4
+
5
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-grid/use-grid-area-without-creating-an-areas-template.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/use-grid-area-without-creating-an-areas-template.arabic.md new file mode 100644 index 0000000000..d875f682a7 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/use-grid-area-without-creating-an-areas-template.arabic.md @@ -0,0 +1,81 @@ +--- +id: 5a94fe2669fb03452672e45e +title: Use grid-area Without Creating an Areas Template +challengeType: 0 +videoUrl: '' +localeTitle: استخدم مساحة الشبكة بدون إنشاء قالب مناطق +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(code.match(/.item5\s*?{[\s\S]*grid-area\s*?:\s*?3\s*?\/\s*?1\s*?\/\s*?4\s*?\/\s*?4\s*?;[\s\S]*}/gi), "item5 class should have a grid-area property that has the value of 3/1/4/4.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
1
+
2
+
3
+
4
+
5
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-grid/use-grid-column-to-control-spacing.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/use-grid-column-to-control-spacing.arabic.md new file mode 100644 index 0000000000..b0463177c9 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/use-grid-column-to-control-spacing.arabic.md @@ -0,0 +1,81 @@ +--- +id: 5a90372638fddaf9a66b5d38 +title: Use grid-column to Control Spacing +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +
حتى هذه النقطة ، جميع الخصائص التي تمت مناقشتها هي لحاويات الشبكة. الخاصية grid-column هي أول واحد للاستخدام على عناصر الشبكة نفسها. ويشار إلى الخطوط الأفقية والرأسية الافتراضية التي تنشئ الشبكة باسم الخطوط . يتم ترقيم هذه الأسطر بدءًا من 1 في أعلى الزاوية اليسرى للشبكة وتتحرك لليمين للأعمدة وأسفل الصفوف ، مع العد لأعلى. هذا ما تبدو عليه الخطوط لشبكة 3x3:

خطوط العمود

1

2

3

4

خطوط الصف

1

2

3

4

للتحكم في كمية الأعمدة التي سيستهلكها عنصر ما ، يمكنك استخدام خاصية grid-column بالاقتران مع أرقام الأسطر التي تريد أن يبدأ العنصر بها ويوقفها. إليك مثال على ذلك:
عمود الشبكة: 1/3 ؛
سيؤدي هذا إلى بدء العنصر عند أول خط رأسي من الشبكة على اليسار والامتداد إلى السطر الثالث للشبكة ، ويستهلك عمودين.
+ +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(code.match(/.item5\s*?{[\s\S]*grid-column\s*?:\s*?2\s*?\/\s*?4\s*?;[\s\S]*}/gi), "item5 class should have a grid-column property that has the value of 2 / 4.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
1
+
2
+
3
+
4
+
5
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-grid/use-grid-row-to-control-spacing.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/use-grid-row-to-control-spacing.arabic.md new file mode 100644 index 0000000000..5680cabcdf --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/use-grid-row-to-control-spacing.arabic.md @@ -0,0 +1,82 @@ +--- +id: 5a90373638fddaf9a66b5d39 +title: Use grid-row to Control Spacing +challengeType: 0 +videoUrl: '' +localeTitle: استخدم grid-row إلى Control Spacing +--- + +## Description +
بالطبع ، يمكنك جعل العناصر تستهلك صفوفًا متعددة تمامًا كما تفعل مع الأعمدة. يمكنك تحديد الأسطر الأفقية التي تريد أن يبدأ عنصرها ثم يتوقف عند استخدام خاصية grid-row على عنصر شبكة.
+ +## Instructions +
جعل العنصر مع فئة item5 تستهلك الصفوف الأخيرة.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تحتوي فئة item5 على خاصية grid-row لها قيمة 2 / 4 . + testString: 'assert(code.match(/.item5\s*?{[\s\S]*grid-row\s*?:\s*?2\s*?\/\s*?4\s*?;[\s\S]*}/gi), "item5 class should have a grid-row property that has the value of 2 / 4.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
1
+
2
+
3
+
4
+
5
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/css-grid/use-media-queries-to-create-responsive-layouts.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/use-media-queries-to-create-responsive-layouts.arabic.md new file mode 100644 index 0000000000..0ad002785e --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/css-grid/use-media-queries-to-create-responsive-layouts.arabic.md @@ -0,0 +1,116 @@ +--- +id: 5a94fe7769fb03452672e463 +title: Use Media Queries to Create Responsive Layouts +challengeType: 0 +videoUrl: '' +localeTitle: استخدم استعلامات الوسائط لإنشاء تخطيطات متجاوبة +--- + +## Description +
يمكن أن تكون CSS Grid طريقة سهلة لجعل موقعك أكثر استجابة من خلال استخدام استعلامات الوسائط لإعادة ترتيب مناطق الشبكة وتغيير أبعاد الشبكة وإعادة ترتيب موضع العناصر. في المعاينة ، عندما يكون عرض إطار العرض 300 بكسل أو أكثر ، يتغير عدد الأعمدة من 1 إلى 2. ثم تحتل مساحة الإعلان العمود الأيسر تمامًا.
+ +## Instructions +
عندما يكون عرض إطار العرض 400px أو أكثر ، اجعل منطقة الرأس تشغل الصف العلوي تمامًا وتحتل منطقة التذييل الصف السفلي تمامًا.
+ +## Tests +
+ +```yml +tests: + - text: عندما يكون منفذ العرض 400px أو أكثر ، يجب أن container فئة container على خاصية grid-template-areas التي تشغل فيها مناطق التذييل والرأس الصفوف العلوية والسفلية على التوالي ، ويشغل الإعلان والمحتوى العمودين الأيمن والأيسر للصف الأوسط. + testString: 'assert(code.match(/@media\s*?\(\s*?min-width\s*?:\s*?400px\s*?\)[\s\S]*.container\s*?{[\s\S]*grid-template-areas\s*?:\s*?"\s*?header\s*?header\s*?"\s*?"\s*?advert\s*?content\s*?"\s*?"\s*?footer\s*?footer\s*?"\s*?;[\s\S]*}/gi), "When the viewport is 400px or more, container class should have a grid-template-areas property in which the footer and header areas occupy the top and bottom rows respectively and advert and content occupy the left and right columns of the middle row.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +
+
header
+
advert
+
content
+
footer
+
+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/responsive-web-design-principles/create-a-media-query.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/responsive-web-design-principles/create-a-media-query.arabic.md new file mode 100644 index 0000000000..57b8c3baed --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/responsive-web-design-principles/create-a-media-query.arabic.md @@ -0,0 +1,60 @@ +--- +id: 587d78b0367417b2b2512b08 +title: Create a Media Query +challengeType: 0 +videoUrl: '' +localeTitle: قم بإنشاء استعلام وسائط +--- + +## Description +
استعلامات الوسائط هي تقنية جديدة تم تقديمها في CSS3 لتغيير عرض المحتوى استنادًا إلى أحجام مختلفة لإطار العرض. إطار العرض هو منطقة مرئية للمستخدم لصفحة ويب ، ويختلف باختلاف الجهاز المستخدم للدخول إلى الموقع. تتكون استعلامات الوسائط من نوع وسائط ، وإذا كان نوع الوسائط هذا يطابق نوع الجهاز الذي يتم عرض المستند عليه ، يتم تطبيق الأنماط. يمكنك الحصول على العديد من المحددات والأنماط داخل استعلام الوسائط الخاص بك كما تريد. في ما يلي مثال لاستعلام وسائط يُرجع المحتوى عندما يكون عرض الجهاز أقل من أو يساوي 100 بكسل: @media (max-width: 100px) { /* CSS Rules */ } ويعيد استعلام الوسائط التالي المحتوى عند يبلغ ارتفاع الجهاز أكثر من أو يساوي 350 بكسل:media @media (min-height: 350px) { /* CSS Rules */ } تذكر ، لا يتم تطبيق CSS داخل استعلام الوسائط إلا إذا كان نوع الوسائط يتطابق مع الجهاز المستخدم.
+ +## Instructions +
أضف استعلام وسائط ، بحيث يكون للعلامة p font-size يبلغ 10 بكسل عندما يكون ارتفاع الجهاز أقل من أو يساوي 800 بكسل.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون عنصر p لديك font-size height بكسل عندما يكون height الجهاز أقل من 800 بكسل أو يساويه. + testString: 'assert($("p").css("font-size") == "10px", "Your p element should have the font-size of 10px when the device height is less than or equal to 800px.");' + - text: قم بتعريف استعلام @media لأجهزة ذات height أقل من أو يساوي 800 بكسل. + testString: 'assert(code.match(/@media\s*?\(\s*?max-height\s*?:\s*?800px\s*?\)/g), "Declare a @media query for devices with a height less than or equal to 800px.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus quis tempus massa. Aenean erat nisl, gravida vel vestibulum cursus, interdum sit amet lectus. Sed sit amet quam nibh. Suspendisse quis tincidunt nulla. In hac habitasse platea dictumst. Ut sit amet pretium nisl. Vivamus vel mi sem. Aenean sit amet consectetur sem. Suspendisse pretium, purus et gravida consequat, nunc ligula ultricies diam, at aliquet velit libero a dui.

+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/responsive-web-design-principles/make-an-image-responsive.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/responsive-web-design-principles/make-an-image-responsive.arabic.md new file mode 100644 index 0000000000..ec293585d9 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/responsive-web-design-principles/make-an-image-responsive.arabic.md @@ -0,0 +1,57 @@ +--- +id: 587d78b1367417b2b2512b09 +title: Make an Image Responsive +challengeType: 0 +videoUrl: '' +localeTitle: جعل صورة مستجيبة +--- + +## Description +
جعل الصور متجاوبة مع CSS بسيط للغاية. بدلاً من تطبيق عرض مطلق لعنصر: img { width: 720px; } يمكنك استخدام:
img {
أقصى عرض: 100 ٪.
العرض محجوب؛
الارتفاع: auto؛
}
تحدد الخاصية max-width ٪ 100 الصورة لتناسب عرض الحاوية الخاصة بها ، ولكن الصورة لن تمتد على نطاق أوسع من عرضها الأصلي. يؤدي تعيين خاصية display لحظر التغييرات على الصورة من عنصر مضمّن (الافتراضي الخاص بها) إلى عنصر كتلة على السطر الخاص بها. تحافظ خاصية height تلقائي على نسبة العرض إلى الارتفاع الأصلية للصورة.
+ +## Instructions +
أضف قواعد النمط لعلامة img لجعلها تستجيب لحجم الحاوية الخاصة بها. يجب أن يتم عرضه كعنصر على مستوى الكتلة ، يجب أن يلائم العرض الكامل للحاوية دون تمديد ، ويجب أن يحتفظ بنسبة العرض إلى الارتفاع الأصلية.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون لعلامة img الخاصة بك مجموعة max-width لتصل إلى 100٪. + testString: 'assert(code.match(/max-width:\s*?100%;/g), "Your img tag should have a max-width set to 100%.");' + - text: يجب أن يكون لديك علامة img مجموعة display للحظر. + testString: 'assert($("img").css("display") == "block", "Your img tag should have a display set to block.");' + - text: يجب أن يكون لعلامة img الخاصة بك مجموعة من height إلى تلقائي. + testString: 'assert(code.match(/height:\s*?auto;/g), "Your img tag should have a height set to auto.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +freeCodeCamp stickers set + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/responsive-web-design-principles/make-typography-responsive.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/responsive-web-design-principles/make-typography-responsive.arabic.md new file mode 100644 index 0000000000..86b86251a1 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/responsive-web-design-principles/make-typography-responsive.arabic.md @@ -0,0 +1,56 @@ +--- +id: 587d78b1367417b2b2512b0c +title: Make Typography Responsive +challengeType: 0 +videoUrl: '' +localeTitle: جعل الطباعة مستجيبة +--- + +## Description +
بدلاً من استخدام النص em أو px to size ، يمكنك استخدام وحدات viewport للطباعة المتجاوبة. وحدات Viewport ، مثل النسب المئوية ، وحدات نسبية ، ولكنها تستند إلى عناصر مختلفة. وترتبط وحدات Viewport بأبعاد إطار العرض (العرض أو الارتفاع) للجهاز ، والنسب المئوية مرتبطة بحجم عنصر الحاوية الأصل. وحدات العرض المختلفة الأربعة هي:
+ +## Instructions +
عيّن width علامة h2 إلى 80٪ من عرض إطار العرض width الفقرة كـ 75٪ من البُعد الأصغر في إطار العرض.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون width العلامة h2 width 80vw. + testString: 'assert(code.match(/h2\s*?{\s*?width:\s*?80vw;\s*?}/g), "Your h2 tag should have a width of 80vw.");' + - text: يجب أن يكون width علامة p width 75vmin. + testString: 'assert(code.match(/p\s*?{\s*?width:\s*?75vmin;\s*?}/g), "Your p tag should have a width of 75vmin.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +

Importantus Ipsum

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus quis tempus massa. Aenean erat nisl, gravida vel vestibulum cursus, interdum sit amet lectus. Sed sit amet quam nibh. Suspendisse quis tincidunt nulla. In hac habitasse platea dictumst. Ut sit amet pretium nisl. Vivamus vel mi sem. Aenean sit amet consectetur sem. Suspendisse pretium, purus et gravida consequat, nunc ligula ultricies diam, at aliquet velit libero a dui.

+ +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/responsive-web-design-principles/use-a-retina-image-for-higher-resolution-displays.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/responsive-web-design-principles/use-a-retina-image-for-higher-resolution-displays.arabic.md new file mode 100644 index 0000000000..e1f30e475f --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/responsive-web-design-principles/use-a-retina-image-for-higher-resolution-displays.arabic.md @@ -0,0 +1,55 @@ +--- +id: 587d78b1367417b2b2512b0a +title: Use a Retina Image for Higher Resolution Displays +challengeType: 0 +videoUrl: '' +localeTitle: استخدم صورة شبكية العين لعرض أعلى دقة +--- + +## Description +
إن أبسط طريقة لجعل صورك تظهر "شبكية العين" (وتحسينها لشاشات عرض الشبكية) هي تحديد قيم width height بها كنصف ما هو الملف الأصلي فقط. في ما يلي مثال على صورة تستخدم فقط نصف الطول والعرض الأصليين:
<نمط>
img {height: 250px؛ العرض: 250 بكسل ؛ }
</ النمط>
<img src = "coolPic500x500" alt = "صورة ممتازة للغاية">
+ +## Instructions +
اضبط width height علامة img على نصف قيمها الأصلية. في هذه الحالة ، height كل من height الأصلي width الأصلي 200 بكسل.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون width العلامة img 100 بكسل. + testString: 'assert($("img").css("width") == "100px", "Your img tag should have a width of 100 pixels.");' + - text: يجب أن height العلامة img 100 بكسل. + testString: 'assert($("img").css("height") == "100px", "Your img tag should have a height of 100 pixels.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```html + + +freeCodeCamp sticker that says 'Because CamperBot Cares' + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/responsive-web-design-projects/build-a-personal-portfolio-webpage.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/responsive-web-design-projects/build-a-personal-portfolio-webpage.arabic.md new file mode 100644 index 0000000000..3ab923a418 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/responsive-web-design-projects/build-a-personal-portfolio-webpage.arabic.md @@ -0,0 +1,38 @@ +--- +id: bd7158d8c242eddfaeb5bd13 +title: Build a Personal Portfolio Webpage +isRequired: true +challengeType: 3 +videoUrl: '' +localeTitle: قم ببناء صفحة الويب الشخصية للحافظة +--- + +## Description +
الهدف: إنشاء تطبيق CodePen.io تشبه وظيفيًا هذا: https://codepen.io/freeCodeCamp/full/zNBOYG . تحقق من قصص المستخدمين أدناه واجتاز جميع الاختبارات. اعطها اسلوبك الشخصي. يمكنك استخدام HTML و JavaScript و CSS لإكمال هذا المشروع. يوصى باستخدام CSS العادي لأن هذا هو ما غطته الدروس حتى الآن ، ويجب أن تحصل على بعض التمرين باستخدام CSS عادي. يمكنك استخدام Bootstrap أو SASS إذا اخترت. لا يوصى باستخدام هذا النوع من التقنيات الإضافية (على سبيل المثال jQuery أو React أو Angular أو Vue) ، ويكون استخدامها على مسؤوليتك الخاصة. سوف تعطيك مشاريع أخرى فرصة للعمل مع مكدسات التكنولوجيا المختلفة مثل React. سنقبل ونحاول إصلاح جميع تقارير المشكلات التي تستخدم مجموعة التكنولوجيا المقترحة لهذا المشروع. الترميز سعيدة! قصة المستخدم رقم 1: يجب أن يكون لحقيدي قسم ترحيبي به معرف welcome-section . قصة المستخدم رقم 2: يجب أن يحتوي قسم الترحيب على عنصر h1 يحتوي على نص. قصة المستخدم رقم 3: يجب أن يكون لحافظة أعمالي قسمًا للمشروعات يحتوي على معرف projects . قصة المستخدم رقم 4: يجب أن يحتوي قسم المشاريع على عنصر واحد على الأقل يحتوي على فئة من project-tile المشروع لعقد مشروع. قصة المستخدم رقم 5: يجب أن يحتوي قسم المشروعات على رابط واحد على الأقل لمشروع. قصة المستخدم رقم 6: يجب أن تحتوي حافظتي على شريط تنقل به معرف navbar . قصة المستخدم رقم 7: يجب أن يحتوي شريط التنقل على رابط واحد على الأقل يمكنني النقر عليه للانتقال إلى أقسام مختلفة من الصفحة. قصة المستخدم رقم 8: يجب أن تحتوي محفظتي على رابط بمعرّف profile-link ، الذي يفتح ملفي الشخصي على GitHub أو FCC في علامة تبويب جديدة. قصة المستخدم رقم 9: يجب أن تحتوي حافظتي على استعلام وسائط واحد على الأقل. قصة المستخدم رقم 10: يجب أن يساوي ارتفاع قسم الترحيب ارتفاع إطار العرض. قصة المستخدم رقم 11: يجب أن يكون شريط التنقل دائمًا في أعلى منفذ العرض. يمكنك بناء مشروعك عن طريق تسجيل قلم CodePen هذا . أو يمكنك استخدام رابط CDN هذا لتشغيل الاختبارات في أي بيئة تفضلها: https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js بمجرد الانتهاء ، أرسل عنوان URL إلى عملك مشروع مع كل اختباراتها تمر. تذكر استخدام طريقة Read-Search-Ask إذا واجهتك مشكلة.
+ +## Instructions +
+
+ +## Tests +
+ +```yml +tests: [] + +``` + +
+ +## Challenge Seed +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/responsive-web-design-projects/build-a-product-landing-page.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/responsive-web-design-projects/build-a-product-landing-page.arabic.md new file mode 100644 index 0000000000..4cd7ed581b --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/responsive-web-design-projects/build-a-product-landing-page.arabic.md @@ -0,0 +1,38 @@ +--- +id: 587d78af367417b2b2512b04 +title: Build a Product Landing Page +isRequired: true +challengeType: 3 +videoUrl: '' +localeTitle: بناء صفحة هبوط منتج +--- + +## Description +
الهدف: إنشاء تطبيق CodePen.io تشبه وظيفيًا هذا: https://codepen.io/freeCodeCamp/full/RKRbwL . تحقق من قصص المستخدمين أدناه واجتاز جميع الاختبارات. اعطها اسلوبك الشخصي. يمكنك استخدام HTML و JavaScript و CSS لإكمال هذا المشروع. يوصى باستخدام CSS العادي لأن هذا هو ما غطته الدروس حتى الآن ، ويجب أن تحصل على بعض التمرين باستخدام CSS عادي. يمكنك استخدام Bootstrap أو SASS إذا اخترت. لا يوصى باستخدام هذا النوع من التقنيات الإضافية (على سبيل المثال jQuery أو React أو Angular أو Vue) ، ويكون استخدامها على مسؤوليتك الخاصة. سوف تعطيك مشاريع أخرى فرصة للعمل مع مكدسات التكنولوجيا المختلفة مثل React. سنقبل ونحاول إصلاح جميع تقارير المشكلات التي تستخدم مجموعة التكنولوجيا المقترحة لهذا المشروع. الترميز سعيدة! قصة المستخدم # 1: الصفحة المقصودة المنتجات بلدي يجب أن يكون header عنصر المقابلة مع id="header" . قصة المستخدم رقم 2: يمكنني رؤية صورة داخل عنصر header باستخدام id="header-img" مناظر id="header-img" . شعار الشركة سيجعل صورة جيدة هنا. قصة المستخدم رقم 3: داخل عنصر #header أستطيع أن أرى عنصر nav باستخدام id="nav-bar" . قصة المستخدم رقم 4: يمكنني مشاهدة ثلاثة عناصر قابلة للنقر على الأقل داخل عنصر nav ، كل منها يحتوي على nav-link للفئة. قصة المستخدم رقم 5: عندما أنقر على زر .nav-link في عنصر nav ، يتم نقلي إلى القسم المقابل من الصفحة المقصودة. قصة المستخدم رقم 6: يمكنني مشاهدة فيديو منتج مضمّن باستخدام id="video" . قصة المستخدم رقم 7: تحتوي صفحتي المقصودة على عنصر form له id="form" مناظر id="form" . قصة المستخدم رقم 8: داخل النموذج ، هناك حقل input به id="email" حيث يمكنني إدخال عنوان بريد إلكتروني. قصة المستخدم رقم 9: يجب أن يحتوي حقل إدخال #email # على نص #email للسماح للمستخدم بمعرفة ما هو الحقل. قصة المستخدم # 10: #email حقل إدخال يستخدم التحقق من صحة HTML5 للتأكد من أن النص الذي تم إدخاله هو عنوان البريد الإلكتروني. قصة المستخدم رقم 11: في النموذج ، هناك input إرسال مع id="submit" المقابلة id="submit" . قصة المستخدم رقم 12: عندما أنقر على عنصر " #submit ، يتم إرسال الرسالة الإلكترونية إلى صفحة ثابتة (استخدم هذا العنوان #submit : https://www.freecodecamp.com/email-submit ) الذي يؤكد إدخال عنوان البريد الإلكتروني و نشرت بنجاح. قصة المستخدم رقم 13: يجب أن يكون شريط التنقل دائمًا في أعلى منفذ العرض. قصة المستخدم رقم 14: يجب أن تحتوي صفحتي المقصودة للمنتج على استعلام وسائط واحد على الأقل. قصة المستخدم رقم 15: يجب أن تستخدم الصفحة المقصودة للمنتج My CSS flexbox مرة واحدة على الأقل. يمكنك بناء مشروعك عن طريق تسجيل قلم CodePen هذا . أو يمكنك استخدام رابط CDN هذا لتشغيل الاختبارات في أي بيئة تفضلها: https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js بمجرد الانتهاء ، أرسل عنوان URL إلى عملك مشروع مع كل اختباراتها تمر. تذكر استخدام طريقة Read-Search-Ask إذا واجهتك مشكلة.
+ +## Instructions +
+
+ +## Tests +
+ +```yml +tests: [] + +``` + +
+ +## Challenge Seed +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/responsive-web-design-projects/build-a-survey-form.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/responsive-web-design-projects/build-a-survey-form.arabic.md new file mode 100644 index 0000000000..98041bfbb7 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/responsive-web-design-projects/build-a-survey-form.arabic.md @@ -0,0 +1,38 @@ +--- +id: 587d78af367417b2b2512b03 +title: Build a Survey Form +isRequired: true +challengeType: 3 +videoUrl: '' +localeTitle: بناء نموذج المسح +--- + +## Description +
الهدف: إنشاء تطبيق CodePen.io يشبه وظيفيًا هذا: https://codepen.io/freeCodeCamp/full/VPaoNP . تحقق من قصص المستخدمين أدناه واجتاز جميع الاختبارات. اعطها اسلوبك الشخصي. يمكنك استخدام HTML و JavaScript و CSS لإكمال هذا المشروع. يوصى باستخدام CSS العادي لأن هذا هو ما غطته الدروس حتى الآن ، ويجب أن تحصل على بعض التمرين باستخدام CSS عادي. يمكنك استخدام Bootstrap أو SASS إذا اخترت. لا يوصى باستخدام هذا النوع من التقنيات الإضافية (على سبيل المثال jQuery أو React أو Angular أو Vue) ، ويكون استخدامها على مسؤوليتك الخاصة. سوف تعطيك مشاريع أخرى فرصة للعمل مع مكدسات التكنولوجيا المختلفة مثل React. سنقبل ونحاول إصلاح جميع تقارير المشكلات التي تستخدم مجموعة التكنولوجيا المقترحة لهذا المشروع. الترميز سعيدة! قصة المستخدم رقم 1: يمكنني رؤية عنوان له id="title" في نص بحجم H1. قصة المستخدم رقم 2: يمكنني رؤية شرح مختصر مع id="description" في نص P الحجم. قصة المستخدم رقم 3: يمكنني رؤية form مع id="survey-form" . قصة المستخدم رقم 4: داخل عنصر النموذج ، يُطلب مني إدخال اسمي في حقل به id="name" . قصة المستخدم رقم 5: داخل عنصر النموذج ، يُطلب مني إدخال بريد إلكتروني في حقل به id="email" . قصة المستخدم رقم 6: إذا قمت بإدخال بريد إلكتروني لم يتم تنسيقه بشكل صحيح ، فسوف أرى خطأ في التحقق من صحة HTML5. قصة المستخدم رقم 7: داخل النموذج ، يمكنني إدخال رقم في حقل به id="number" . قصة المستخدم رقم 8: إذا قمت بإدخال أرقام غير أرقام في إدخال الرقم ، فسوف أرى خطأ التحقق من صحة HTML5. قصة المستخدم رقم 9: إذا كان إدخال أرقام خارج نطاق إدخال رقم، التي تم تعريفها من قبل min و max الصفات، وسوف ترى خطأ التحقق من صحة HTML5. قصة المستخدم رقم 10: بالنسبة إلى الاسم ، والبريد الإلكتروني ، وحقول إدخال الرقم داخل النموذج ، يمكنني مشاهدة تصنيفات مقابلة تصف الغرض من كل حقل بالمعرفات التالية: id="name-label" ، id="email-label" و id="number-label" . قصة المستخدم رقم 11: بالنسبة إلى الاسم ، والبريد الإلكتروني ، وحقول إدخال الرقم ، يمكنني رؤية نص العنصر النائب الذي يعطيني وصفًا أو إرشادات لكل حقل. قصة المستخدم رقم 12: داخل عنصر النموذج ، يمكنني تحديد خيار من قائمة منسدلة تحتوي على id="dropdown" مناظر id="dropdown" . قصة المستخدم رقم 13: داخل عنصر النموذج ، يمكنني تحديد حقل من مجموعة واحدة أو أكثر من أزرار الاختيار. يجب تجميع كل مجموعة باستخدام سمة name . قصة المستخدم رقم 14: داخل عنصر النموذج ، يمكنني تحديد عدة حقول من سلسلة من مربعات الاختيار ، التي يجب أن يكون لكل منها سمة value . قصة المستخدم رقم 15: داخل عنصر النموذج ، يتم textarea مع نص في النهاية للحصول على تعليقات إضافية. قصة المستخدم رقم 16: داخل عنصر النموذج ، يتم تقديم الزر مع id="submit" لإرسال كل مدخلاتي. يمكنك بناء مشروعك عن طريق تسجيل قلم CodePen هذا . أو يمكنك استخدام رابط CDN هذا لتشغيل الاختبارات في أي بيئة تفضلها: https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js بمجرد الانتهاء ، أرسل عنوان URL إلى عملك مشروع مع كل اختباراتها تمر. تذكر استخدام طريقة Read-Search-Ask إذا واجهتك مشكلة.
+ +## Instructions +
+
+ +## Tests +
+ +```yml +tests: [] + +``` + +
+ +## Challenge Seed +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/responsive-web-design-projects/build-a-technical-documentation-page.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/responsive-web-design-projects/build-a-technical-documentation-page.arabic.md new file mode 100644 index 0000000000..2cf9f68009 --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/responsive-web-design-projects/build-a-technical-documentation-page.arabic.md @@ -0,0 +1,38 @@ +--- +id: 587d78b0367417b2b2512b05 +title: Build a Technical Documentation Page +isRequired: true +challengeType: 3 +videoUrl: '' +localeTitle: بناء صفحة التوثيق الفني +--- + +## Description +
الهدف: إنشاء تطبيق CodePen.io تشبه وظيفيًا هذا: https://codepen.io/freeCodeCamp/full/NdrKKL . تحقق من قصص المستخدمين أدناه واجتاز جميع الاختبارات. اعطها اسلوبك الشخصي. يمكنك استخدام HTML و JavaScript و CSS لإكمال هذا المشروع. يوصى باستخدام CSS العادي لأن هذا هو ما غطته الدروس حتى الآن ، ويجب أن تحصل على بعض التمرين باستخدام CSS عادي. يمكنك استخدام Bootstrap أو SASS إذا اخترت. لا يوصى باستخدام هذا النوع من التقنيات الإضافية (على سبيل المثال jQuery أو React أو Angular أو Vue) ، ويكون استخدامها على مسؤوليتك الخاصة. سوف تعطيك مشاريع أخرى فرصة للعمل مع مكدسات التكنولوجيا المختلفة مثل React. سنقبل ونحاول إصلاح جميع تقارير المشكلات التي تستخدم مجموعة التكنولوجيا المقترحة لهذا المشروع. الترميز سعيدة! قصة المستخدم رقم 1: يمكنني رؤية عنصر main يحتوي على id="main-doc" مناظر id="main-doc" ، والذي يحتوي على المحتوى الرئيسي للصفحة (الوثائق الفنية). قصة المستخدم رقم 2: داخل عنصر #main-doc ، يمكنني مشاهدة عدة عناصر من section ، لكل منها فئة من main-section . يجب أن يكون هناك حد أدنى من 5. قصة المستخدم رقم 3: يجب أن يكون العنصر الأول في كل عنصر .main-section عنصر header يحتوي على نص يصف موضوع ذلك القسم. قصة المستخدم رقم 4: يجب أن يكون لكل عنصر section مع فئة main-section أيضًا معرّف يتطابق مع نص كل header موجود داخلها. يجب استبدال أي مسافات بشرط تسطير سفلي (على سبيل المثال ، يجب أن يحتوي section الذي يحتوي على الرأس "Javascript و Java" على id="Javascript_and_Java" مناظر id="Javascript_and_Java" ). قصة المستخدم رقم 5: يجب أن تحتوي عناصر .main-section على ما لا يقل عن 10 عناصر لعناصر p (وليس كل). قصة المستخدم رقم 6: يجب أن تحتوي عناصر .main-section على ما لا يقل عن 5 عناصر من code (وليس كل). قصة المستخدم # 7: .main-section ينبغي أن يتضمن عناصر لا يقل عن 5 li البنود الكاملة (وليس كل). قصة المستخدم رقم 8: يمكنني رؤية عنصر nav مع id="navbar" المقابلة id="navbar" . قصة المستخدم رقم 9: يجب أن يحتوي عنصر شريط التنقل على عنصر header يحتوي على نص يصف موضوع الوثائق الفنية. قصة المستخدم رقم 10: بالإضافة إلى ذلك ، يجب أن يحتوي a nav-link على رابط ( a ) عناصر بفئة nav-link . يجب أن يكون هناك واحد لكل عنصر مع main-section للفصل. قصة المستخدم رقم 11: يجب أن يأتي عنصر header في شريط التنقل قبل أي رابط ( a ) عناصر في a التنقل. قصة المستخدم رقم 12: يجب أن يحتوي كل عنصر مع فئة nav-link على نص يتطابق مع نص header داخل كل section (على سبيل المثال ، إذا كان لديك عنوان / عنوان "مرحباً بالعالم" ، يجب أن يحتوي nav-link الخاص بك على عنصر يحتوي على النص "مرحبا بالعالم"). قصة المستخدم رقم 13: عندما أنقر على عنصر شريط التنقل ، يجب أن تنتقل الصفحة إلى القسم المقابل من عنصر main-doc (على سبيل المثال ، إذا قمت بالنقر فوق عنصر nav-link يحتوي على النص "Hello world" ، فإن الصفحة تتنقل إلى section العنصر الذي لديه تلك الهوية ويحتوي على المقابلة header قصة المستخدم رقم 14: على الأجهزة الحجم العادية (أجهزة الكمبيوتر المحمولة والمكتبية)، وعنصر مع id="navbar" يجب أن تظهر على الجانب الأيسر من الشاشة، وينبغي دائما قصة المستخدم رقم 15: يجب أن تستخدم صفحة "المستندات التقنية" استعلام وسائط واحد على الأقل. يمكنك إنشاء مشروعك من خلال تسجيل قلم CodePen هذا ، أو يمكنك استخدام رابط CDN هذا لتشغيل الاختبارات في أي بيئة تفضلها : https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js بمجرد الانتهاء من ذلك ، أرسل عنوان URL إلى مشروع عملك مع جميع اختباراته ، تذكر استخدام Read-Search-Ask طريقة إذا واجهتك مشكلة.
+ +## Instructions +
+
+ +## Tests +
+ +```yml +tests: [] + +``` + +
+ +## Challenge Seed +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/01-responsive-web-design/responsive-web-design-projects/build-a-tribute-page.arabic.md b/curriculum/challenges/arabic/01-responsive-web-design/responsive-web-design-projects/build-a-tribute-page.arabic.md new file mode 100644 index 0000000000..2616d2454d --- /dev/null +++ b/curriculum/challenges/arabic/01-responsive-web-design/responsive-web-design-projects/build-a-tribute-page.arabic.md @@ -0,0 +1,38 @@ +--- +id: bd7158d8c442eddfaeb5bd18 +title: Build a Tribute Page +isRequired: true +challengeType: 3 +videoUrl: '' +localeTitle: بناء صفحة تحية +--- + +## Description +
الهدف: إنشاء تطبيق CodePen.io تشبه وظيفيًا هذا: https://codepen.io/freeCodeCamp/full/zNqgVx . تحقق من قصص المستخدمين أدناه واجتاز جميع الاختبارات. اعطها اسلوبك الشخصي. يمكنك استخدام HTML و JavaScript و CSS لإكمال هذا المشروع. يوصى باستخدام CSS العادي لأن هذا هو ما غطته الدروس حتى الآن ، ويجب أن تحصل على بعض التمرين باستخدام CSS عادي. يمكنك استخدام Bootstrap أو SASS إذا اخترت. لا يوصى باستخدام هذا النوع من التقنيات الإضافية (على سبيل المثال jQuery أو React أو Angular أو Vue) ، ويكون استخدامها على مسؤوليتك الخاصة. سوف تعطيك مشاريع أخرى فرصة للعمل مع مكدسات التكنولوجيا المختلفة مثل React. سنقبل ونحاول إصلاح جميع تقارير المشكلات التي تستخدم مجموعة التكنولوجيا المقترحة لهذا المشروع. الترميز سعيدة! قصة المستخدم رقم 1: يجب أن تحتوي صفحة الجزية على عنصر له رقم id="main" ، والذي يحتوي على جميع العناصر الأخرى. قصة المستخدم رقم 2: يجب أن أرى عنصرًا به id="title" ، والذي يحتوي على سلسلة (أي نص) تصف موضوع صفحة الجزية (على سبيل المثال "Dr. Norman Borlaug"). قصة المستخدم رقم 3: من المفترض أن أرى عنصر div يحتوي على id="img-div" مناظر id="img-div" . قصة المستخدم رقم 4: في عنصر img-div ، ينبغي أن أرى عنصر img id="image" مناظر id="image" . قصة المستخدم رقم 5: في عنصر img-div ، يجب أن أرى عنصرًا به id="img-caption" المقابل الذي يحتوي على محتوى نصي يصف الصورة المعروضة في img-div . قصة المستخدم رقم 6: ينبغي أن أرى عنصرًا يحمل id="tribute-info" مقابلاً id="tribute-info" ، يحتوي على محتوى نصي يصف موضوع صفحة الجزية. قصة المستخدم رقم 7: يجب أن تشهد a عنصر المقابلة مع id="tribute-link" ، الذي يربط إلى موقع خارجي يحتوي على معلومات إضافية حول موضوع الصفحة الجزية. تلميح: يجب أن تمنح عنصرك سمة target _blank على _blank حتى يفتح الرابط الخاص بك في علامة تبويب جديدة (مثل target="_blank" ). قصة المستخدم رقم 8: يجب تغيير عنصر img سريعة ، بالنسبة إلى عرض العنصر الرئيسي ، دون تجاوز الحجم الأصلي. قصة المستخدم رقم 9: يجب توسيط عنصر img داخل العنصر الرئيسي. يمكنك بناء مشروعك عن طريق تسجيل قلم CodePen هذا . أو يمكنك استخدام رابط CDN هذا لتشغيل الاختبارات في أي بيئة تفضلها: https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js . بمجرد الانتهاء ، أرسل عنوان URL إلى مشروع عملك مع كل اختباراته تمر. تذكر استخدام طريقة Read-Search-Ask إذا واجهتك مشكلة.
+ +## Instructions +
+
+ +## Tests +
+ +```yml +tests: [] + +``` + +
+ +## Challenge Seed +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/boo-who.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/boo-who.arabic.md new file mode 100644 index 0000000000..9bd2d8057e --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/boo-who.arabic.md @@ -0,0 +1,74 @@ +--- +id: a77dbc43c33f39daa4429b4f +title: Boo who +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: بو من +--- + +## Description +
تحقق مما إذا كانت القيمة مصنفة على أنها بدائية منطقية. إرجاع صح أو خطأ. الأجناس البولية هي صحيحة وكاذبة. تذكر استخدام Read-Search-Ask إذا واجهتك مشكلة. حاول إقران البرنامج. اكتب الكود الخاص بك.
+ +## Instructions +
+
+ +## Tests +
+ +```yml +tests: + - text: booWho(true) يجب أن booWho(true) true. + testString: 'assert.strictEqual(booWho(true), true, "booWho(true) should return true.");' + - text: booWho(false) يجب أن يعود صحيحًا. + testString: 'assert.strictEqual(booWho(false), true, "booWho(false) should return true.");' + - text: 'booWho([1, 2, 3]) يجب أن تعود خاطئة.' + testString: 'assert.strictEqual(booWho([1, 2, 3]), false, "booWho([1, 2, 3]) should return false.");' + - text: 'يجب أن تعود booWho([].slice) كاذبة.' + testString: 'assert.strictEqual(booWho([].slice), false, "booWho([].slice) should return false.");' + - text: '' + testString: 'assert.strictEqual(booWho({ "a": 1 }), false, "booWho({ "a": 1 }) should return false.");' + - text: يجب أن يقوم booWho(1) بإرجاع false. + testString: 'assert.strictEqual(booWho(1), false, "booWho(1) should return false.");' + - text: يجب أن تعود booWho(NaN) كاذبة. + testString: 'assert.strictEqual(booWho(NaN), false, "booWho(NaN) should return false.");' + - text: booWho("a") بإرجاع false. + testString: 'assert.strictEqual(booWho("a"), false, "booWho("a") should return false.");' + - text: booWho("true") بإرجاع false. + testString: 'assert.strictEqual(booWho("true"), false, "booWho("true") should return false.");' + - text: booWho("false") بإرجاع false. + testString: 'assert.strictEqual(booWho("false"), false, "booWho("false") should return false.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function booWho(bool) { + // What is the new fad diet for ghost developers? The Boolean. + return bool; +} + +booWho(null); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/chunky-monkey.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/chunky-monkey.arabic.md new file mode 100644 index 0000000000..c79a8656af --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/chunky-monkey.arabic.md @@ -0,0 +1,68 @@ +--- +id: a9bd25c716030ec90084d8a1 +title: Chunky Monkey +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: قرد مكتنز +--- + +## Description +
اكتب دالة تقسم صفيف (أول وسيطة) إلى مجموعات طول size (وسيطة ثانية) وتقوم بإرجاعها كمصفوفة ثنائية الأبعاد. تذكر استخدام Read-Search-Ask إذا واجهتك مشكلة. اكتب الكود الخاص بك.
+ +## Instructions +
+
+ +## Tests +
+ +```yml +tests: + - text: 'chunkArrayInGroups(["a", "b", "c", "d"], 2) يجب أن ترجع [["a", "b"], ["c", "d"]] .' + testString: 'assert.deepEqual(chunkArrayInGroups(["a", "b", "c", "d"], 2), [["a", "b"], ["c", "d"]], "chunkArrayInGroups(["a", "b", "c", "d"], 2) should return [["a", "b"], ["c", "d"]].");' + - text: 'chunkArrayInGroups([0, 1, 2, 3, 4, 5], 3) يجب أن تعود [[0, 1, 2], [3, 4, 5]] .' + testString: 'assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5], 3), [[0, 1, 2], [3, 4, 5]], "chunkArrayInGroups([0, 1, 2, 3, 4, 5], 3) should return [[0, 1, 2], [3, 4, 5]].");' + - text: 'chunkArrayInGroups([0, 1, 2, 3, 4, 5], 2) يجب أن ترجع [[0, 1], [2, 3], [4, 5]] .' + testString: 'assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5], 2), [[0, 1], [2, 3], [4, 5]], "chunkArrayInGroups([0, 1, 2, 3, 4, 5], 2) should return [[0, 1], [2, 3], [4, 5]].");' + - text: 'chunkArrayInGroups([0, 1, 2, 3, 4, 5], 4) return [[0, 1, 2, 3], [4, 5]] .' + testString: 'assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5], 4), [[0, 1, 2, 3], [4, 5]], "chunkArrayInGroups([0, 1, 2, 3, 4, 5], 4) should return [[0, 1, 2, 3], [4, 5]].");' + - text: 'chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6], 3) يجب أن تعود [[0, 1, 2], [3, 4, 5], [6]] .' + testString: 'assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6], 3), [[0, 1, 2], [3, 4, 5], [6]], "chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6], 3) should return [[0, 1, 2], [3, 4, 5], [6]].");' + - text: 'chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 4) يجب أن تعود [[0, 1, 2, 3], [4, 5, 6, 7], [8]] .' + testString: 'assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 4), [[0, 1, 2, 3], [4, 5, 6, 7], [8]], "chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 4) should return [[0, 1, 2, 3], [4, 5, 6, 7], [8]].");' + - text: 'chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 2) يجب أن تعود [[0, 1], [2, 3], [4, 5], [6, 7], [8]] .' + testString: 'assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 2), [[0, 1], [2, 3], [4, 5], [6, 7], [8]], "chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 2) should return [[0, 1], [2, 3], [4, 5], [6, 7], [8]].");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function chunkArrayInGroups(arr, size) { + // Break it up. + return arr; +} + +chunkArrayInGroups(["a", "b", "c", "d"], 2); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/confirm-the-ending.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/confirm-the-ending.arabic.md new file mode 100644 index 0000000000..b5e099ced2 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/confirm-the-ending.arabic.md @@ -0,0 +1,77 @@ +--- +id: acda2fb1324d9b0fa741e6b5 +title: Confirm the Ending +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: تأكيد الانتهاء +--- + +## Description +
تحقق مما إذا كانت سلسلة (الوسيطة الأولى ، str ) تنتهي بسلسلة الهدف المحددة (الوسيطة الثانية ، target ). يمكن حل هذا التحدي باستخدام طريقة .endsWith() ، التي تم تقديمها في ES2015. ولكن لغرض هذا التحدي ، نود منك استخدام إحدى طرق السلسلة الفرعية JavaScript بدلاً من ذلك. تذكر استخدام Read-Search-Ask إذا واجهتك مشكلة. اكتب الكود الخاص بك.
+ +## Instructions +
+
+ +## Tests +
+ +```yml +tests: + - text: 'confirmEnding("Bastian", "n") يجب أن ترجع true.' + testString: 'assert(confirmEnding("Bastian", "n") === true, "confirmEnding("Bastian", "n") should return true.");' + - text: 'confirmEnding("Congratulation", "on") يجب أن تعود إلى true.' + testString: 'assert(confirmEnding("Congratulation", "on") === true, "confirmEnding("Congratulation", "on") should return true.");' + - text: 'confirmEnding("Connor", "n") يجب أن ترجع false.' + testString: 'assert(confirmEnding("Connor", "n") === false, "confirmEnding("Connor", "n") should return false.");' + - text: 'confirmEnding("Walking on water and developing software from a specification are easy if both are frozen", "specification") يجب أن تعود خاطئة.' + testString: 'assert(confirmEnding("Walking on water and developing software from a specification are easy if both are frozen", "specification") === false, "confirmEnding("Walking on water and developing software from a specification are easy if both are frozen", "specification") should return false.");' + - text: 'confirmEnding("He has to give me a new name", "name") يجب أن confirmEnding("He has to give me a new name", "name") .' + testString: 'assert(confirmEnding("He has to give me a new name", "name") === true, "confirmEnding("He has to give me a new name", "name") should return true.");' + - text: 'confirmEnding("Open sesame", "same") يجب أن ترجع true.' + testString: 'assert(confirmEnding("Open sesame", "same") === true, "confirmEnding("Open sesame", "same") should return true.");' + - text: 'confirmEnding("Open sesame", "pen") يجب أن يقوم بإرجاع false.' + testString: 'assert(confirmEnding("Open sesame", "pen") === false, "confirmEnding("Open sesame", "pen") should return false.");' + - text: 'confirmEnding("Open sesame", "game") يجب أن ترجع false.' + testString: 'assert(confirmEnding("Open sesame", "game") === false, "confirmEnding("Open sesame", "game") should return false.");' + - text: 'confirmEnding("If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing", "mountain") يجب أن تعود كاذبة.' + testString: 'assert(confirmEnding("If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing", "mountain") === false, "confirmEnding("If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing", "mountain") should return false.");' + - text: 'confirmEnding("Abstraction", "action") يجب أن confirmEnding("Abstraction", "action") true.' + testString: 'assert(confirmEnding("Abstraction", "action") === true, "confirmEnding("Abstraction", "action") should return true.");' + - text: لا تستخدم الأسلوب .endsWith() لحل التحدي. + testString: 'assert(!(/\.endsWith\(.*?\)\s*?;?/.test(code)) && !(/\["endsWith"\]/.test(code)), "Do not use the built-in method .endsWith() to solve the challenge.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function confirmEnding(str, target) { + // "Never give up and good luck will find you." + // -- Falcor + return str; +} + +confirmEnding("Bastian", "n"); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/convert-celsius-to-fahrenheit.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/convert-celsius-to-fahrenheit.arabic.md new file mode 100644 index 0000000000..415ffb7cb8 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/convert-celsius-to-fahrenheit.arabic.md @@ -0,0 +1,66 @@ +--- +id: 56533eb9ac21ba0edf2244b3 +title: Convert Celsius to Fahrenheit +challengeType: 1 +isRequired: true +videoUrl: '' +localeTitle: تحويل مئوية إلى فهرنهايت +--- + +## Description +
الخوارزمية للتحويل من درجة مئوية إلى فهرنهايت هي درجة الحرارة في المرات المئوي 9/5 ، زائد 32 . يتم منحك درجة celsius متغيرة تمثل درجة الحرارة بالدرجة المئوية. استخدم المتغير fahrenheit تم تحديده بالفعل وقم بتعيينه درجة حرارة فهرنهايت مكافئة لدرجة حرارة مئوية معينة. استخدم الخوارزمية المذكورة أعلاه للمساعدة في تحويل درجة الحرارة مئوية إلى فهرنهايت. لا تقلق كثيراً بشأن بيانات الوظيفة والعودة حيث سيتم تغطيتها في التحديات المستقبلية. في الوقت الحالي ، استخدم فقط المشغلين الذين تعلموهم بالفعل.
+ +## Instructions +
+
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يقوم convertToF(0) بإرجاع رقم + testString: 'assert(typeof convertToF(0) === "number", "convertToF(0) should return a number");' + - text: يجب أن تقوم convertToF(-30) بإرجاع قيمة -22 + testString: 'assert(convertToF(-30) === -22, "convertToF(-30) should return a value of -22");' + - text: يجب أن تقوم convertToF(-10) بإرجاع قيمة 14 + testString: 'assert(convertToF(-10) === 14, "convertToF(-10) should return a value of 14");' + - text: يجب أن تقوم convertToF(0) بإرجاع قيمة 32 + testString: 'assert(convertToF(0) === 32, "convertToF(0) should return a value of 32");' + - text: يجب أن تقوم convertToF(20) بإرجاع قيمة 68 + testString: 'assert(convertToF(20) === 68, "convertToF(20) should return a value of 68");' + - text: يجب أن تقوم convertToF(30) بإرجاع قيمة 86 + testString: 'assert(convertToF(30) === 86, "convertToF(30) should return a value of 86");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function convertToF(celsius) { + let fahrenheit; + return fahrenheit; +} + +convertToF(30); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/factorialize-a-number.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/factorialize-a-number.arabic.md new file mode 100644 index 0000000000..0bd6652a38 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/factorialize-a-number.arabic.md @@ -0,0 +1,63 @@ +--- +id: a302f7aae1aa3152a5b413bc +title: Factorialize a Number +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: Factorialize عدد +--- + +## Description +
عودة المضروب من عدد صحيح المقدمة. إذا تم تمثيل العدد الصحيح بالحرف n ، فإن العامل الحاسوبي هو نتاج جميع الأعداد الصحيحة الموجبة أقل من أو يساوي n. غالبًا ما يتم تمثيل العوامل بعبارة الاختزال n! على سبيل المثال: 5! = 1 * 2 * 3 * 4 * 5 = 120 فقط تزويد الأعداد الصحيحة التي تزيد عن أو تساوي الصفر بالوظيفة. تذكر استخدام Read-Search-Ask إذا واجهتك مشكلة. اكتب الكود الخاص بك.
+ +## Instructions +
+
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يعيد factorialize(5) رقمًا. + testString: 'assert(typeof factorialize(5) === "number", "factorialize(5) should return a number.");' + - text: يجب أن يعيد factorialize(5) 120. + testString: 'assert(factorialize(5) === 120, "factorialize(5) should return 120.");' + - text: يجب أن يعيد التجهيز factorialize(10) 3628800. + testString: 'assert(factorialize(10) === 3628800, "factorialize(10) should return 3628800.");' + - text: يجب أن تعيد إنتاجية factorialize(20) 2432902008176640000. + testString: 'assert(factorialize(20) === 2432902008176640000, "factorialize(20) should return 2432902008176640000.");' + - text: يجب أن يعيد factorialize(0) 1. + testString: 'assert(factorialize(0) === 1, "factorialize(0) should return 1.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function factorialize(num) { + return num; +} + +factorialize(5); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/falsy-bouncer.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/falsy-bouncer.arabic.md new file mode 100644 index 0000000000..e2eba6ccf8 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/falsy-bouncer.arabic.md @@ -0,0 +1,62 @@ +--- +id: adf08ec01beb4f99fc7a68f2 +title: Falsy Bouncer +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: فلسى الحارس +--- + +## Description +
قم بإزالة كافة قيم الفالسة من صفيف. تكون قيم Falsy في JavaScript false و null و 0 و "" و undefined و NaN . تلميح: حاول تحويل كل قيمة إلى قيمة منطقية. تذكر استخدام Read-Search-Ask إذا واجهتك مشكلة. اكتب الكود الخاص بك.
+ +## Instructions +
+
+ +## Tests +
+ +```yml +tests: + - text: 'bouncer([7, "ate", "", false, 9]) يجب أن يعود [7, "ate", 9] .' + testString: 'assert.deepEqual(bouncer([7, "ate", "", false, 9]), [7, "ate", 9], "bouncer([7, "ate", "", false, 9]) should return [7, "ate", 9].");' + - text: 'يجب أن تعود bouncer(["a", "b", "c"]) ["a", "b", "c"] .' + testString: 'assert.deepEqual(bouncer(["a", "b", "c"]), ["a", "b", "c"], "bouncer(["a", "b", "c"]) should return ["a", "b", "c"].");' + - text: 'bouncer([false, null, 0, NaN, undefined, ""]) يجب أن يرجع [] .' + testString: 'assert.deepEqual(bouncer([false, null, 0, NaN, undefined, ""]), [], "bouncer([false, null, 0, NaN, undefined, ""]) should return [].");' + - text: 'bouncer([1, null, NaN, 2, undefined]) يجب أن يرجع [1, 2] .' + testString: 'assert.deepEqual(bouncer([1, null, NaN, 2, undefined]), [1, 2], "bouncer([1, null, NaN, 2, undefined]) should return [1, 2].");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function bouncer(arr) { + // Don't show a false ID to this bouncer. + return arr; +} + +bouncer([7, "ate", "", false, 9]); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/find-the-longest-word-in-a-string.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/find-the-longest-word-in-a-string.arabic.md new file mode 100644 index 0000000000..a01b11cc48 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/find-the-longest-word-in-a-string.arabic.md @@ -0,0 +1,65 @@ +--- +id: a26cbbe9ad8655a977e1ceb5 +title: Find the Longest Word in a String +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: ابحث عن أطول كلمة في سلسلة +--- + +## Description +
إرجاع طول الكلمة الأطول في الجملة المتوفرة. يجب أن يكون ردك رقمًا. تذكر استخدام Read-Search-Ask إذا واجهتك مشكلة. اكتب الكود الخاص بك.
+ +## Instructions +
+
+ +## Tests +
+ +```yml +tests: + - text: findLongestWordLength("The quick brown fox jumped over the lazy dog") يجب إرجاع رقم. + testString: 'assert(typeof findLongestWordLength("The quick brown fox jumped over the lazy dog") === "number", "findLongestWordLength("The quick brown fox jumped over the lazy dog") should return a number.");' + - text: findLongestWordLength("The quick brown fox jumped over the lazy dog") يجب أن يعود 6. + testString: 'assert(findLongestWordLength("The quick brown fox jumped over the lazy dog") === 6, "findLongestWordLength("The quick brown fox jumped over the lazy dog") should return 6.");' + - text: findLongestWordLength("May the force be with you") 5. + testString: 'assert(findLongestWordLength("May the force be with you") === 5, "findLongestWordLength("May the force be with you") should return 5.");' + - text: findLongestWordLength("Google do a barrel roll") 6. + testString: 'assert(findLongestWordLength("Google do a barrel roll") === 6, "findLongestWordLength("Google do a barrel roll") should return 6.");' + - text: findLongestWordLength("What is the average airspeed velocity of an unladen swallow") 8. + testString: 'assert(findLongestWordLength("What is the average airspeed velocity of an unladen swallow") === 8, "findLongestWordLength("What is the average airspeed velocity of an unladen swallow") should return 8.");' + - text: findLongestWordLength("What if we try a super-long word such as otorhinolaryngology") يجب أن ترجع 19. + testString: 'assert(findLongestWordLength("What if we try a super-long word such as otorhinolaryngology") === 19, "findLongestWordLength("What if we try a super-long word such as otorhinolaryngology") should return 19.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function findLongestWordLength(str) { + return str.length; +} + +findLongestWordLength("The quick brown fox jumped over the lazy dog"); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/finders-keepers.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/finders-keepers.arabic.md new file mode 100644 index 0000000000..907bd799aa --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/finders-keepers.arabic.md @@ -0,0 +1,58 @@ +--- +id: a6e40f1041b06c996f7b2406 +title: Finders Keepers +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: من يجد شيئا يحتفظ به +--- + +## Description +
إنشاء دالة تبحث خلال صفيف (الوسيطة الأولى) وإرجاع العنصر الأول في الصفيف الذي يمرر اختبار الحقيقة (الوسيطة الثانية). إذا لم يجتاز أي عنصر الاختبار ، فارجع غير معروف. تذكر استخدام Read-Search-Ask إذا واجهتك مشكلة. حاول إقران البرنامج. اكتب الكود الخاص بك.
+ +## Instructions +
+
+ +## Tests +
+ +```yml +tests: + - text: 'findElement([1, 3, 5, 8, 9, 10], function(num) { return num % 2 === 0; }) يجب أن ترجع 8.' + testString: 'assert.strictEqual(findElement([1, 3, 5, 8, 9, 10], function(num) { return num % 2 === 0; }), 8, "findElement([1, 3, 5, 8, 9, 10], function(num) { return num % 2 === 0; }) should return 8.");' + - text: 'findElement([1, 3, 5, 9], function(num) { return num % 2 === 0; }) يجب أن تُرجع غير معرفة.' + testString: 'assert.strictEqual(findElement([1, 3, 5, 9], function(num) { return num % 2 === 0; }), undefined, "findElement([1, 3, 5, 9], function(num) { return num % 2 === 0; }) should return undefined.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function findElement(arr, func) { + let num = 0; + return num; +} + +findElement([1, 2, 3, 4], num => num % 2 === 0); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/mutations.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/mutations.arabic.md new file mode 100644 index 0000000000..1acacf0fb6 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/mutations.arabic.md @@ -0,0 +1,71 @@ +--- +id: af2170cad53daa0770fabdea +title: Mutations +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: الطفرات +--- + +## Description +
إرجاع true إذا احتوت السلسلة في العنصر الأول من المصفوفة على كافة أحرف السلسلة في العنصر الثاني من الصفيف. على سبيل المثال ، يجب أن تعود ["hello", "Hello"] ، true لأن كافة الأحرف الموجودة في السلسلة الثانية موجودة في الحالة الأولى ، مع تجاهل الحالة. يجب أن ترجع الوسيطة ["hello", "hey"] false لأن السلسلة "hello" لا تحتوي على "y". وأخيرًا ، يجب أن تعود ["Alien", "line"] ، إلى true لأن جميع الأحرف في "line" موجودة في "Alien". تذكر استخدام Read-Search-Ask إذا واجهتك مشكلة. اكتب الكود الخاص بك.
+ +## Instructions +
+
+ +## Tests +
+ +```yml +tests: + - text: 'يجب أن تعود mutation(["hello", "hey"]) false.' + testString: 'assert(mutation(["hello", "hey"]) === false, "mutation(["hello", "hey"]) should return false.");' + - text: 'يجب أن تعود mutation(["hello", "Hello"]) true.' + testString: 'assert(mutation(["hello", "Hello"]) === true, "mutation(["hello", "Hello"]) should return true.");' + - text: 'يجب أن ترجع mutation(["zyxwvutsrqponmlkjihgfedcba", "qrstu"]) صحيح.' + testString: 'assert(mutation(["zyxwvutsrqponmlkjihgfedcba", "qrstu"]) === true, "mutation(["zyxwvutsrqponmlkjihgfedcba", "qrstu"]) should return true.");' + - text: 'يجب أن تعود mutation(["Mary", "Army"]) الحقيقة.' + testString: 'assert(mutation(["Mary", "Army"]) === true, "mutation(["Mary", "Army"]) should return true.");' + - text: 'يجب أن تعود mutation(["Mary", "Aarmy"]) true.' + testString: 'assert(mutation(["Mary", "Aarmy"]) === true, "mutation(["Mary", "Aarmy"]) should return true.");' + - text: 'يجب أن تعود mutation(["Alien", "line"]) true.' + testString: 'assert(mutation(["Alien", "line"]) === true, "mutation(["Alien", "line"]) should return true.");' + - text: 'يجب أن تعود mutation(["floor", "for"]) true.' + testString: 'assert(mutation(["floor", "for"]) === true, "mutation(["floor", "for"]) should return true.");' + - text: 'يجب أن تعود mutation(["hello", "neo"]) false.' + testString: 'assert(mutation(["hello", "neo"]) === false, "mutation(["hello", "neo"]) should return false.");' + - text: 'يجب أن تعود mutation(["voodoo", "no"]) كاذبة.' + testString: 'assert(mutation(["voodoo", "no"]) === false, "mutation(["voodoo", "no"]) should return false.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function mutation(arr) { + return arr; +} + +mutation(["hello", "hey"]); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/repeat-a-string-repeat-a-string.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/repeat-a-string-repeat-a-string.arabic.md new file mode 100644 index 0000000000..fdf6ba7bdc --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/repeat-a-string-repeat-a-string.arabic.md @@ -0,0 +1,68 @@ +--- +id: afcc8d540bea9ea2669306b6 +title: Repeat a String Repeat a String +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: كرر سلسلة يكرر سلسلة +--- + +## Description +
كرر str سلسلة معينة (الوسيطة الأولى) لـ num times (الوسيطة الثانية). إرجاع سلسلة فارغة إذا لم تكن num رقم موجب. تذكر استخدام Read-Search-Ask إذا واجهتك مشكلة. اكتب الكود الخاص بك.
+ +## Instructions +
+
+ +## Tests +
+ +```yml +tests: + - text: 'يجب أن ترجع repeatStringNumTimes("*", 3) "***" .' + testString: 'assert(repeatStringNumTimes("*", 3) === "***", "repeatStringNumTimes("*", 3) should return "***".");' + - text: 'يجب أن ترجع repeatStringNumTimes("abc", 3) "abcabcabc" .' + testString: 'assert(repeatStringNumTimes("abc", 3) === "abcabcabc", "repeatStringNumTimes("abc", 3) should return "abcabcabc".");' + - text: 'يجب أن ترجع repeatStringNumTimes("abc", 4) "abcabcabcabc" .' + testString: 'assert(repeatStringNumTimes("abc", 4) === "abcabcabcabc", "repeatStringNumTimes("abc", 4) should return "abcabcabcabc".");' + - text: 'يجب أن ترجع repeatStringNumTimes("abc", 1) "abc" .' + testString: 'assert(repeatStringNumTimes("abc", 1) === "abc", "repeatStringNumTimes("abc", 1) should return "abc".");' + - text: 'يجب أن ترجع repeatStringNumTimes("*", 8) "********" .' + testString: 'assert(repeatStringNumTimes("*", 8) === "********", "repeatStringNumTimes("*", 8) should return "********".");' + - text: 'يجب أن ترجع repeatStringNumTimes("abc", -2) "" .' + testString: 'assert(repeatStringNumTimes("abc", -2) === "", "repeatStringNumTimes("abc", -2) should return "".");' + - text: لا يجب استخدام repeat() المدمج repeat() -method + testString: 'assert(!/\.repeat/g.test(code), "The built-in repeat()-method should not be used");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function repeatStringNumTimes(str, num) { + // repeat after me + return str; +} + +repeatStringNumTimes("abc", 3); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/return-largest-numbers-in-arrays.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/return-largest-numbers-in-arrays.arabic.md new file mode 100644 index 0000000000..ac1fdff065 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/return-largest-numbers-in-arrays.arabic.md @@ -0,0 +1,62 @@ +--- +id: a789b3483989747d63b0e427 +title: Return Largest Numbers in Arrays +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: أكبر عدد من المصفوفات في المصفوفة +--- + +## Description +
قم بإرجاع صفيف يتكون من أكبر رقم من كل صفيف فرعي. بالنسبة إلى البساطة ، سيحتوي الصفيف الذي تم توفيره على 4 صفيف فرعي تمامًا. تذكر ، يمكنك التكرار من خلال صفيف مع حلقة بسيطة ، والوصول إلى كل عضو مع arr[i] جملة arr[i] . تذكر استخدام Read-Search-Ask إذا واجهتك مشكلة. اكتب الكود الخاص بك.
+ +## Instructions +
+
+ +## Tests +
+ +```yml +tests: + - text: 'largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]) بإرجاع صفيف.' + testString: 'assert(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]).constructor === Array, "largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]) should return an array.");' + - text: 'largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]]) يجب أن تعود [27, 5, 39, 1001] .' + testString: 'assert.deepEqual(largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]]), [27, 5, 39, 1001], "largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]]) should return [27, 5, 39, 1001].");' + - text: 'largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]) يجب أن تعود [9, 35, 97, 1000000] .' + testString: 'assert.deepEqual(largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]), [9, 35, 97, 1000000], "largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]) should return [9, 35, 97, 1000000].");' + - text: 'largestOfFour([[17, 23, 25, 12], [25, 7, 34, 48], [4, -10, 18, 21], [-72, -3, -17, -10]]) should should return [25, 48, 21, -3] .' + testString: 'assert.deepEqual(largestOfFour([[17, 23, 25, 12], [25, 7, 34, 48], [4, -10, 18, 21], [-72, -3, -17, -10]]), [25, 48, 21, -3], "largestOfFour([[17, 23, 25, 12], [25, 7, 34, 48], [4, -10, 18, 21], [-72, -3, -17, -10]]) should return [25, 48, 21, -3].");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function largestOfFour(arr) { + // You can do this! + return arr; +} + +largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/reverse-a-string.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/reverse-a-string.arabic.md new file mode 100644 index 0000000000..4c14f4414d --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/reverse-a-string.arabic.md @@ -0,0 +1,61 @@ +--- +id: a202eed8fc186c8434cb6d61 +title: Reverse a String +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: عكس سلسلة +--- + +## Description +
عكس السلسلة المقدمة. قد تحتاج إلى تحويل السلسلة إلى مصفوفة قبل أن تتمكن من عكسها. يجب أن تكون النتيجة الخاصة بك سلسلة. تذكر استخدام Read-Search-Ask إذا واجهتك مشكلة. اكتب الكود الخاص بك.
+ +## Instructions +
+
+ +## Tests +
+ +```yml +tests: + - text: reverseString("hello") يجب إرجاع سلسلة. + testString: 'assert(typeof reverseString("hello") === "string", "reverseString("hello") should return a string.");' + - text: يجب أن تصبح reverseString("hello") "olleh" . + testString: 'assert(reverseString("hello") === "olleh", "reverseString("hello") should become "olleh".");' + - text: يجب أن تصبح reverseString("Howdy") "ydwoH" . + testString: 'assert(reverseString("Howdy") === "ydwoH", "reverseString("Howdy") should become "ydwoH".");' + - text: يجب أن ترجع reverseString("Greetings from Earth") "htraE morf sgniteerG" . + testString: 'assert(reverseString("Greetings from Earth") === "htraE morf sgniteerG", "reverseString("Greetings from Earth") should return "htraE morf sgniteerG".");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function reverseString(str) { + return str; +} + +reverseString("hello"); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/slice-and-splice.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/slice-and-splice.arabic.md new file mode 100644 index 0000000000..8acba3fcc2 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/slice-and-splice.arabic.md @@ -0,0 +1,75 @@ +--- +id: 579e2a2c335b9d72dd32e05c +title: Slice and Splice +isRequired: true +isBeta: true +challengeType: 5 +videoUrl: '' +localeTitle: شريحة و لصق +--- + +## Description +
يتم منحك صفيفين ومؤشر. استخدم slice الطرق splice لنسخ كل عنصر من المصفوفة الأولى في المصفوفة الثانية ، بالترتيب. ابدأ بإدخال عناصر في الفهرس n للمصفوفة الثانية. إرجاع الصفيف الناتج. يجب أن تظل صفائف الإدخال كما هي بعد تشغيل الدالة. تذكر استخدام Read-Search-Ask إذا واجهتك مشكلة. اكتب الكود الخاص بك.
+ +## Instructions +
+
+ +## Tests +
+ +```yml +tests: + - text: 'frankenSplice([1, 2, 3], [4, 5], 1) يجب أن ترجع [4, 1, 2, 3, 5] .' + testString: 'assert.deepEqual(frankenSplice([1, 2, 3], [4, 5], 1), [4, 1, 2, 3, 5], "frankenSplice([1, 2, 3], [4, 5], 1) should return [4, 1, 2, 3, 5].");' + - text: 'frankenSplice([1, 2], ["a", "b"], 1) يجب أن ترجع ["a", 1, 2, "b"] .' + testString: 'assert.deepEqual(frankenSplice(testArr1, testArr2, 1), ["a", 1, 2, "b"], "frankenSplice([1, 2], ["a", "b"], 1) should return ["a", 1, 2, "b"].");' + - text: 'frankenSplice(["claw", "tentacle"], ["head", "shoulders", "knees", "toes"], 2) يجب أن تعود ["head", "shoulders", "claw", "tentacle", "knees", "toes"] .' + testString: 'assert.deepEqual(frankenSplice(["claw", "tentacle"], ["head", "shoulders", "knees", "toes"], 2), ["head", "shoulders", "claw", "tentacle", "knees", "toes"], "frankenSplice(["claw", "tentacle"], ["head", "shoulders", "knees", "toes"], 2) should return ["head", "shoulders", "claw", "tentacle", "knees", "toes"].");' + - text: يجب إضافة جميع العناصر من الصفيف الأول إلى المصفوفة الثانية بترتيبها الأصلي. + testString: 'assert.deepEqual(frankenSplice([1, 2, 3, 4], [], 0), [1, 2, 3, 4], "All elements from the first array should be added to the second array in their original order.");' + - text: يجب أن يظل الصفيف الأول كما هو بعد تشغيل الدالة. + testString: 'assert(testArr1[0] === 1 && testArr1[1] === 2, "The first array should remain the same after the function runs.");' + - text: يجب أن يظل الصفيف الثاني كما هو بعد تشغيل الدالة. + testString: 'assert(testArr2[0] === "a" && testArr2[1] === "b", "The second array should remain the same after the function runs.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function frankenSplice(arr1, arr2, n) { + // It's alive. It's alive! + return arr2; +} + +frankenSplice([1, 2, 3], [4, 5, 6], 1); + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/title-case-a-sentence.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/title-case-a-sentence.arabic.md new file mode 100644 index 0000000000..37806af7f9 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/title-case-a-sentence.arabic.md @@ -0,0 +1,61 @@ +--- +id: ab6137d4e35944e21037b769 +title: Title Case a Sentence +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: العنوان حالة الجملة +--- + +## Description +
قم بإرجاع السلسلة المتوفرة بالحرف الأول من كل كلمة بالأحرف الكبيرة. تأكد من أن بقية الكلمة في حالة الأحرف الصغيرة. لأغراض هذا التمرين ، يجب أيضًا تكبير الحروف الموصولة مثل "the" و "of". تذكر استخدام Read-Search-Ask إذا واجهتك مشكلة. اكتب الكود الخاص بك.
+ +## Instructions +
+
+ +## Tests +
+ +```yml +tests: + - text: 'titleCase("I'm a little tea pot") سلسلة.' + testString: 'assert(typeof titleCase("I"m a little tea pot") === "string", "titleCase("I'm a little tea pot") should return a string.");' + - text: 'titleCase("I'm a little tea pot") يجب أن أعود I'm A Little Tea Pot .' + testString: 'assert(titleCase("I"m a little tea pot") === "I"m A Little Tea Pot", "titleCase("I'm a little tea pot") should return I'm A Little Tea Pot.");' + - text: يجب أن ترجع titleCase("sHoRt AnD sToUt") Short And Stout . + testString: 'assert(titleCase("sHoRt AnD sToUt") === "Short And Stout", "titleCase("sHoRt AnD sToUt") should return Short And Stout.");' + - text: titleCase("HERE IS MY HANDLE HERE IS MY SPOUT") Here Is My Handle Here Is My Spout titleCase("HERE IS MY HANDLE HERE IS MY SPOUT") يجب أن يعود Here Is My Handle Here Is My Spout . + testString: 'assert(titleCase("HERE IS MY HANDLE HERE IS MY SPOUT") === "Here Is My Handle Here Is My Spout", "titleCase("HERE IS MY HANDLE HERE IS MY SPOUT") should return Here Is My Handle Here Is My Spout.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function titleCase(str) { + return str; +} + +titleCase("I'm a little tea pot"); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/truncate-a-string.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/truncate-a-string.arabic.md new file mode 100644 index 0000000000..5a266e39fd --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/truncate-a-string.arabic.md @@ -0,0 +1,66 @@ +--- +id: ac6993d51946422351508a41 +title: Truncate a String +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: اقتطاع سلسلة +--- + +## Description +
اقتطاع سلسلة (الوسيطة الأولى) إذا كانت أطول من طول السلسلة الأقصى المحدد (الوسيطة الثانية). إرجاع السلسلة المقتطعة مع ... إنهاء. تذكر استخدام Read-Search-Ask إذا واجهتك مشكلة. اكتب الكود الخاص بك.
+ +## Instructions +
+
+ +## Tests +
+ +```yml +tests: + - text: 'truncateString("A-tisket a-tasket A green and yellow basket", 8) يجب أن ترجع "A-tisket ...".' + testString: 'assert(truncateString("A-tisket a-tasket A green and yellow basket", 8) === "A-tisket...", "truncateString("A-tisket a-tasket A green and yellow basket", 8) should return "A-tisket...".");' + - text: 'truncateString("Peter Piper picked a peck of pickled peppers", 11) يجب أن ترجع "بيتر بايبر ...".' + testString: 'assert(truncateString("Peter Piper picked a peck of pickled peppers", 11) === "Peter Piper...", "truncateString("Peter Piper picked a peck of pickled peppers", 11) should return "Peter Piper...".");' + - text: 'truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length) يجب أن تعود truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length) "A-tisket a-tasket سلة خضراء وصفراء".' + testString: 'assert(truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length) === "A-tisket a-tasket A green and yellow basket", "truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length) should return "A-tisket a-tasket A green and yellow basket".");' + - text: 'truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length + 2) يجب أن تعود truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length + 2) "A-tisket a-tasket سلة خضراء وصفراء".' + testString: 'assert(truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length + 2) === "A-tisket a-tasket A green and yellow basket", "truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length + 2) should return "A-tisket a-tasket A green and yellow basket".");' + - text: 'يجب أن ترجع truncateString("A-", 1) "A ...".' + testString: 'assert(truncateString("A-", 1) === "A...", "truncateString("A-", 1) should return "A...".");' + - text: 'يجب أن ترجع truncateString("Absolutely Longer", 2) "Ab ...".' + testString: 'assert(truncateString("Absolutely Longer", 2) === "Ab...", "truncateString("Absolutely Longer", 2) should return "Ab...".");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function truncateString(str, num) { + // Clear out that junk in your trunk + return str; +} + +truncateString("A-tisket a-tasket A green and yellow basket", 8); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/where-do-i-belong.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/where-do-i-belong.arabic.md new file mode 100644 index 0000000000..ddd7665f8c --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/where-do-i-belong.arabic.md @@ -0,0 +1,86 @@ +--- +id: a24c1a4622e3c05097f71d67 +title: Where do I Belong +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: إلى أين أنتمي +--- + +## Description +
قم بإرجاع أدنى مؤشر يتم فيه إدراج قيمة (وسيطة ثانية) في صفيف (وسيطة أولى) بمجرد فرزها. يجب أن تكون القيمة التي تم إرجاعها رقمًا. على سبيل المثال ، يجب أن تقوم getIndexToIns([1,2,3,4], 1.5) بإرجاع 1 لأنه أكبر من 1 (index 0) ، ولكن أقل من 2 (index 1). وبالمثل ، يجب أن تعود getIndexToIns([20,3,5], 19) 2 لأنه بمجرد فرز المصفوفة ستبدو مثل [3,5,20] و 19 أقل من 20 (مؤشر 2) وأكبر من 5 ( مؤشر 1). تذكر استخدام Read-Search-Ask إذا واجهتك مشكلة. اكتب الكود الخاص بك.
+ +## Instructions +
+
+ +## Tests +
+ +```yml +tests: + - text: 'getIndexToIns([10, 20, 30, 40, 50], 35) 3 .' + testString: 'assert(getIndexToIns([10, 20, 30, 40, 50], 35) === 3, "getIndexToIns([10, 20, 30, 40, 50], 35) should return 3.");' + - text: 'getIndexToIns([10, 20, 30, 40, 50], 35) بإرجاع رقم.' + testString: 'assert(typeof(getIndexToIns([10, 20, 30, 40, 50], 35)) === "number", "getIndexToIns([10, 20, 30, 40, 50], 35) should return a number.");' + - text: 'getIndexToIns([10, 20, 30, 40, 50], 30) 2 .' + testString: 'assert(getIndexToIns([10, 20, 30, 40, 50], 30) === 2, "getIndexToIns([10, 20, 30, 40, 50], 30) should return 2.");' + - text: 'getIndexToIns([10, 20, 30, 40, 50], 30) بإرجاع رقم.' + testString: 'assert(typeof(getIndexToIns([10, 20, 30, 40, 50], 30)) === "number", "getIndexToIns([10, 20, 30, 40, 50], 30) should return a number.");' + - text: 'يجب أن تعود getIndexToIns([40, 60], 50) 1 .' + testString: 'assert(getIndexToIns([40, 60], 50) === 1, "getIndexToIns([40, 60], 50) should return 1.");' + - text: 'getIndexToIns([40, 60], 50) بإرجاع رقم.' + testString: 'assert(typeof(getIndexToIns([40, 60], 50)) === "number", "getIndexToIns([40, 60], 50) should return a number.");' + - text: 'getIndexToIns([3, 10, 5], 3) 0 .' + testString: 'assert(getIndexToIns([3, 10, 5], 3) === 0, "getIndexToIns([3, 10, 5], 3) should return 0.");' + - text: 'getIndexToIns([3, 10, 5], 3) بإرجاع رقم.' + testString: 'assert(typeof(getIndexToIns([3, 10, 5], 3)) === "number", "getIndexToIns([3, 10, 5], 3) should return a number.");' + - text: 'getIndexToIns([5, 3, 20, 3], 5) 2 .' + testString: 'assert(getIndexToIns([5, 3, 20, 3], 5) === 2, "getIndexToIns([5, 3, 20, 3], 5) should return 2.");' + - text: 'getIndexToIns([5, 3, 20, 3], 5) بإرجاع رقم.' + testString: 'assert(typeof(getIndexToIns([5, 3, 20, 3], 5)) === "number", "getIndexToIns([5, 3, 20, 3], 5) should return a number.");' + - text: 'getIndexToIns([2, 20, 10], 19) 2 .' + testString: 'assert(getIndexToIns([2, 20, 10], 19) === 2, "getIndexToIns([2, 20, 10], 19) should return 2.");' + - text: 'getIndexToIns([2, 20, 10], 19) بإرجاع رقم.' + testString: 'assert(typeof(getIndexToIns([2, 20, 10], 19)) === "number", "getIndexToIns([2, 20, 10], 19) should return a number.");' + - text: 'getIndexToIns([2, 5, 10], 15) 3 .' + testString: 'assert(getIndexToIns([2, 5, 10], 15) === 3, "getIndexToIns([2, 5, 10], 15) should return 3.");' + - text: 'getIndexToIns([2, 5, 10], 15) بإرجاع رقم.' + testString: 'assert(typeof(getIndexToIns([2, 5, 10], 15)) === "number", "getIndexToIns([2, 5, 10], 15) should return a number.");' + - text: 'يجب أن ترجع getIndexToIns([], 1) 0 .' + testString: 'assert(getIndexToIns([], 1) === 0, "getIndexToIns([], 1) should return 0.");' + - text: 'getIndexToIns([], 1) بإرجاع رقم.' + testString: 'assert(typeof(getIndexToIns([], 1)) === "number", "getIndexToIns([], 1) should return a number.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function getIndexToIns(arr, num) { + // Find my place in this sorted array. + return num; +} + +getIndexToIns([40, 60], 50); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/-iterate-through-the-keys-of-an-object-with-a-for...in-statement.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/-iterate-through-the-keys-of-an-object-with-a-for...in-statement.arabic.md new file mode 100644 index 0000000000..cf4c6ecdc3 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/-iterate-through-the-keys-of-an-object-with-a-for...in-statement.arabic.md @@ -0,0 +1,76 @@ +--- +id: 587d7b7d367417b2b2512b1d +title: ' Iterate Through the Keys of an Object with a for...in Statement' +challengeType: 1 +videoUrl: '' +localeTitle: يتكرر عبر مفاتيح كائن مع لـ ... في بيان +--- + +## Description +
في بعض الأحيان قد تحتاج إلى التكرار من خلال جميع المفاتيح داخل كائن. يتطلب هذا بناء جملة محددًا في JavaScript يسمى for ... في العبارة. بالنسبة users ، قد يبدو هذا:
لـ (السماح للمستخدم بالمستخدمين) {
console.log (المستخدم)؛


// سجلات:
آلان
جيف
ساره
ريان
في هذا البيان ، قمنا بتعريف user متغير ، وكما ترى ، تمت إعادة تعيين هذا المتغير أثناء كل عملية تكرار لكل مفتاح من مفاتيح الكائن كالتعبير المتكرر من خلال الكائن ، مما أدى إلى طباعة اسم كل مستخدم إلى وحدة التحكم. ملحوظة:
لا تحتفظ الكائنات بأمر على المفاتيح المخزنة مثل المصفوفات؛ وبالتالي ، يكون موضع المفاتيح في كائن ما ، أو الترتيب النسبي الذي يظهر فيه ، غير ذي صلة عند الإشارة إلى هذا المفتاح أو الوصول إليه.
+ +## Instructions +
لقد قمنا بتعريف وظيفة ، countOnline ؛ استخدم عبارة for ... في العبارة داخل هذه الوظيفة للتكرار بين المستخدمين في كائن users وإرجاع عدد المستخدمين الذين تم تعيين الخاصية الخاصة بهم online إلى true .
+ +## Tests +
+ +```yml +tests: + - text: يحتوي كائن users على المستخدمين Jeff Ryan مع تعيين online على true والمستخدمين Alan Sarah مع تعيين online إلى false + testString: 'assert(users.Alan.online === false && users.Jeff.online === true && users.Sarah.online === false && users.Ryan.online === true, "The users object contains users Jeff and Ryan with online set to true and users Alan and Sarah with online set to false");' + - text: ترجع الدالة countOnline عدد المستخدمين الذين تم تعيين الخاصية online إلى true + testString: 'assert((function() { users.Harry = {online: true}; users.Sam = {online: true}; users.Carl = {online: true}; return countOnline(users) })() === 5, "The function countOnline returns the number of users with the online property set to true");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +let users = { + Alan: { + age: 27, + online: false + }, + Jeff: { + age: 32, + online: true + }, + Sarah: { + age: 48, + online: false + }, + Ryan: { + age: 19, + online: true + } +}; + +function countOnline(obj) { + // change code below this line + + // change code above this line +} + +console.log(countOnline(users)); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/access-an-arrays-contents-using-bracket-notation.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/access-an-arrays-contents-using-bracket-notation.arabic.md new file mode 100644 index 0000000000..a9d42a6eae --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/access-an-arrays-contents-using-bracket-notation.arabic.md @@ -0,0 +1,59 @@ +--- +id: 5a661e0f1068aca922b3ef17 +title: Access an Array's Contents Using Bracket Notation +challengeType: 1 +videoUrl: '' +localeTitle: الوصول إلى محتويات صفيف باستخدام تدرج قوس +--- + +## Description +
إن الميزة الأساسية لأي بنية بيانات هي ، بالطبع ، القدرة على تخزين البيانات فحسب ، بل أيضًا القدرة على استرداد البيانات الموجودة في الأمر. والآن ، بعد أن تعلمنا كيفية إنشاء مصفوفة ، فلنبدأ في التفكير في كيفية الوصول إلى معلومات هذا الصفيف. عندما نحدد صفيفًا بسيطًا كما هو موضح أدناه ، يوجد 3 عناصر فيه:
let ourArray = ["a"، "b"، "c"]؛
في صفيف ، يحتوي كل عنصر صفيف على فهرس . يتضاعف هذا المؤشر كموضع لهذا العنصر في الصفيف ، وكيف يمكنك الرجوع إليه. ومع ذلك، فمن المهم أن نلاحظ، أن صفائف جافا سكريبت صفر-فهرستها، وهذا يعني أن العنصر الأول من مجموعة هو في الواقع في موقف الصفري، وليس الأول. من أجل استرداد عنصر من صفيف ، يمكننا وضع فهرس بين قوسين وإلحاقه بنهاية مصفوفة ، أو بشكل أكثر شيوعًا ، إلى متغير يشير إلى كائن مصفوفة. هذا هو المعروف باسم تدوين قوس . على سبيل المثال ، إذا أردنا استرداد "a" من ourArray وتعيينه إلى متغير ، فيمكننا القيام بذلك باستخدام الكود التالي:
دع ourVariable = ourArray [0]؛
// our المتغير يساوي "a"
بالإضافة إلى الوصول إلى القيمة المرتبطة بفهرس ، يمكنك أيضًا تعيين فهرس لقيمة باستخدام نفس الترميز:
ourArray [1] = "not b anymore"؛
// ourArray الآن تساوي ["a"، "not b anymore"، "c"]؛
باستخدام تدوين قوس ، قمنا الآن بإعادة تعيين العنصر في الفهرس 1 من "b" إلى "not b anymore" .
+ +## Instructions +
لإكمال هذا التحدي ، قم بتعيين الموضع الثاني (الرقم 1 ) من myArray إلى أي شيء تريده ، إلى جانب "b" .
+ +## Tests +
+ +```yml +tests: + - text: 'myArray[0] يساوي "a"' + testString: 'assert.strictEqual(myArray[0], "a", "myArray[0] is equal to "a"");' + - text: 'لم يعد myArray[1] مضبوطًا على "b"' + testString: 'assert.notStrictEqual(myArray[1], "b", "myArray[1] is no longer set to "b"");' + - text: 'myArray[2] يساوي "c"' + testString: 'assert.strictEqual(myArray[2], "c", "myArray[2] is equal to "c"");' + - text: 'myArray[3] يساوي "d"' + testString: 'assert.strictEqual(myArray[3], "d", "myArray[3] is equal to "d"");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +let myArray = ["a", "b", "c", "d"]; +// change code below this line + +//change code above this line +console.log(myArray); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/access-property-names-with-bracket-notation.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/access-property-names-with-bracket-notation.arabic.md new file mode 100644 index 0000000000..ce3f0009aa --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/access-property-names-with-bracket-notation.arabic.md @@ -0,0 +1,73 @@ +--- +id: 587d7b7c367417b2b2512b1a +title: Access Property Names with Bracket Notation +challengeType: 1 +videoUrl: '' +localeTitle: الوصول إلى خاصية الأسماء مع تدرج قوس +--- + +## Description +
في التحدي الكائن الأول ذكرنا استخدام تدوين قوس كطريقة للوصول إلى قيم الممتلكات باستخدام تقييم متغير. على سبيل المثال ، تخيل أن foods يتم استخدامها في برنامج لسجل النقدية في السوبر ماركت. لدينا بعض الوظائف التي تحدد foods selectedFood ونريد أن نتحقق من أن foods كائن لوجود ذلك الطعام. قد يبدو هذا كالتالي:
السماح selectFood = getCurrentFood (scannedItem)؛
السماح للمخزون = الأطعمة [selectFood] ؛
سيقوم هذا الكود بتقييم القيمة المخزنة في المتغير selectedFood والصادر وإعادة قيمة هذا المفتاح في كائن foods ، أو يتم undefined إذا لم تكن موجودة. يعتبر تدرج قوس مفيد جدًا لأن أحيانًا لا تكون خصائص الكائن معروفة قبل وقت التشغيل أو نحتاج إلى الوصول إليها بطريقة أكثر ديناميكية.
+ +## Instructions +
لقد قمنا بتعريف وظيفة ، checkInventory ، الذي يتلقى عنصرًا تم مسحه ضوئيًا كوسيطة. قم scannedItem القيمة الحالية لمفتاح scannedItem في كائن foods . يمكنك افتراض أنه سيتم توفير المفاتيح الصالحة فقط كوسيطة checkInventory .
+ +## Tests +
+ +```yml +tests: + - text: checkInventory هي وظيفة + testString: 'assert.strictEqual(typeof checkInventory, "function", "checkInventory is a function");' + - text: 'يجب أن يحتوي جسم foods على أزواج القيمة الرئيسية التالية: apples: 25 ، oranges: 32 ، plums: 28 ، bananas: 13 ، grapes: 35 ، strawberries: 27' + testString: 'assert.deepEqual(foods, {apples: 25, oranges: 32, plums: 28, bananas: 13, grapes: 35, strawberries: 27}, "The foods object should have only the following key-value pairs: apples: 25, oranges: 32, plums: 28, bananas: 13, grapes: 35, strawberries: 27");' + - text: checkInventory("apples") 25 + testString: 'assert.strictEqual(checkInventory("apples"), 25, "checkInventory("apples") should return 25");' + - text: checkInventory("bananas") 13 + testString: 'assert.strictEqual(checkInventory("bananas"), 13, "checkInventory("bananas") should return 13");' + - text: checkInventory("strawberries") 27 + testString: 'assert.strictEqual(checkInventory("strawberries"), 27, "checkInventory("strawberries") should return 27");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +let foods = { + apples: 25, + oranges: 32, + plums: 28, + bananas: 13, + grapes: 35, + strawberries: 27 +}; +// do not change code above this line + +function checkInventory(scannedItem) { + // change code below this line + +} + +// change code below this line to test different cases: +console.log(checkInventory("apples")); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/add-items-to-an-array-with-push-and-unshift.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/add-items-to-an-array-with-push-and-unshift.arabic.md new file mode 100644 index 0000000000..f55d9c8402 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/add-items-to-an-array-with-push-and-unshift.arabic.md @@ -0,0 +1,61 @@ +--- +id: 587d78b2367417b2b2512b0e +title: Add Items to an Array with push() and unshift() +challengeType: 1 +videoUrl: '' +localeTitle: إضافة عناصر إلى مصفوفة بدفع () و unshift () +--- + +## Description +
لم يتم إصلاح طول الصفيف ، مثل أنواع البيانات التي يمكن أن تحتويها. يمكن تعريف المصفوفات بطول أي عدد من العناصر ، ويمكن إضافة العناصر أو إزالتها بمرور الوقت ؛ بمعنى آخر ، المصفوفات قابلة للتغيير . في هذا التحدي ، سننظر في طريقتين يمكننا من Array.push() تعديل صفيف Array.push() : Array.push() و Array.unshift() . تأخذ كلتا الطريقتين عنصرًا واحدًا أو أكثر كمعلمات وإضافة هذه العناصر إلى الصفيف الذي يتم استدعاء الأسلوب عليه؛ تضيف طريقة push() عناصر إلى نهاية صفيف ، unshift() عناصر إلى البداية. خذ بعين الاعتبار ما يلي:
واسمحوا twentyThree = 'الثالث والعشرون' ؛
let romanNumerals = ['XXI'، 'XXII']؛

romanNumerals.unshift ('XIX'، 'XX')؛
// الآن تساوي ['XIX' ، 'XX' ، 'XXI' ، 'XXII']

romanNumerals.push (twentyThree)؛
// الآن تساوي ['XIX'، 'XX'، 'XXI'، 'XXII'، 'XXIII'] لاحظ أنه يمكننا أيضًا تمرير المتغيرات ، مما يتيح لنا مرونة أكبر في تعديل بيانات المصفوفة ديناميكيًا.
+ +## Instructions +
لقد حددنا وظيفة ، mixedNumbers ، والتي نحن نمرر مصفوفة كحجة. قم بتعديل الوظيفة باستخدام push() و unshift() لإضافة 'I', 2, 'three' إلى بداية الصفيف و 7, 'VIII', 9 إلى النهاية بحيث يحتوي الصفيف الذي تم إرجاعه على تمثيلات للأرقام 1-9 بالترتيب.
+ +## Tests +
+ +```yml +tests: + - text: 'mixedNumbers(["IV", 5, "six"]) يجب أن تعود الآن ["I", 2, "three", "IV", 5, "six", 7, "VIII", 9]' + testString: 'assert.deepEqual(mixedNumbers(["IV", 5, "six"]), ["I", 2, "three", "IV", 5, "six", 7, "VIII", 9], "mixedNumbers(["IV", 5, "six"]) should now return ["I", 2, "three", "IV", 5, "six", 7, "VIII", 9]");' + - text: يجب استخدام الدالة mixedNumbers الأسلوب push() + testString: 'assert.notStrictEqual(mixedNumbers.toString().search(/\.push\(/), -1, "The mixedNumbers function should utilize the push() method");' + - text: و mixedNumbers وظيفة يجب الاستفادة من unshift() طريقة + testString: 'assert.notStrictEqual(mixedNumbers.toString().search(/\.unshift\(/), -1, "The mixedNumbers function should utilize the unshift() method");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function mixedNumbers(arr) { + // change code below this line + + // change code above this line + return arr; +} + +// do not change code below this line +console.log(mixedNumbers(['IV', 5, 'six'])); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/add-items-using-splice.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/add-items-using-splice.arabic.md new file mode 100644 index 0000000000..ad7fc6f176 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/add-items-using-splice.arabic.md @@ -0,0 +1,63 @@ +--- +id: 587d78b3367417b2b2512b11 +title: Add Items Using splice() +challengeType: 1 +videoUrl: '' +localeTitle: إضافة عناصر باستخدام لصق () +--- + +## Description +
تذكر في التحدي الأخير ذكرنا أن splice() يمكن أن يستغرق ما يصل إلى ثلاثة معلمات؟ حسنا ، يمكننا أن نذهب خطوة أخرى مع splice() - بالإضافة إلى إزالة العناصر ، يمكننا استخدام هذه المعلمة الثالثة ، والتي تمثل واحد أو أكثر من العناصر ، لإضافتها كذلك. يمكن أن يكون هذا مفيدًا بشكل لا يصدق للتبديل السريع لعنصر أو مجموعة من العناصر ، لعنصر آخر. على سبيل المثال ، لنفترض أنك تخزن نظام ألوان لمجموعة من عناصر DOM في مصفوفة ، وتريد تغيير لون بشكل ديناميكي بناءً على إجراء ما:
function colorChange (arr، index، newColor) {
arr.splice (index، 1، newColor)؛
عودة arr؛
}

let colorScheme = ['# 878787'، '# a08794'، '# bb7e8c'، '# c9b6be'، '# d1becf']؛

colorScheme = colorChange (colorScheme، 2، '# 332327')؛
// أزلنا '# bb7e8c' وأضفنا '# 332327' في مكانها
// colorScheme now equalals '' # 878787 '،' # a08794 '،' # 332327 '،' # c9b6be '،' # d1becf ']
تأخذ هذه الدالة صفيفًا من القيم السداسية ، وهو فهرس يتم عنده إزالة عنصر ، واللون الجديد لاستبدال العنصر المُزال به. قيمة الإرجاع هي صفيف يحتوي على نظام ألوان تم تعديله حديثًا! في حين أن هذا المثال مفرط في التبسيط ، يمكننا أن نرى القيمة التي يمكن أن تستخدم بها splice() إلى أقصى إمكاناتها.
+ +## Instructions +
لقد حددنا وظيفة ، htmlColorNames ، والتي تأخذ مصفوفة من ألوان HTML كوسيطة. قم بتعديل الوظيفة باستخدام splice() لإزالة العنصرين الأولين من الصفيف وأضف 'DarkSalmon' و 'BlanchedAlmond' في 'DarkSalmon' الخاصة.
+ +## Tests +
+ +```yml +tests: + - text: 'يجب أن htmlColorNames ["DarkSalmon", "BlanchedAlmond", "LavenderBlush", "PaleTurqoise", "FireBrick"]' + testString: 'assert.deepEqual(htmlColorNames(["DarkGoldenRod", "WhiteSmoke", "LavenderBlush", "PaleTurqoise", "FireBrick"]), ["DarkSalmon", "BlanchedAlmond", "LavenderBlush", "PaleTurqoise", "FireBrick"], "htmlColorNames should return ["DarkSalmon", "BlanchedAlmond", "LavenderBlush", "PaleTurqoise", "FireBrick"]");' + - text: يجب أن تستخدم الدالة htmlColorNames الأسلوب splice() + testString: 'assert(/.splice/.test(code), "The htmlColorNames function should utilize the splice() method");' + - text: يجب عدم استخدام shift() أو unshift() . + testString: 'assert(!/shift|unshift/.test(code), "You should not use shift() or unshift().");' + - text: يجب عدم استخدام تدوين قوس الصفيف. + testString: 'assert(!/\[\d\]\s*=/.test(code), "You should not use array bracket notation.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function htmlColorNames(arr) { + // change code below this line + + // change code above this line + return arr; +} + +// do not change code below this line +console.log(htmlColorNames(['DarkGoldenRod', 'WhiteSmoke', 'LavenderBlush', 'PaleTurqoise', 'FireBrick'])); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/add-key-value-pairs-to-javascript-objects.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/add-key-value-pairs-to-javascript-objects.arabic.md new file mode 100644 index 0000000000..5dcc6d5fed --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/add-key-value-pairs-to-javascript-objects.arabic.md @@ -0,0 +1,67 @@ +--- +id: 587d7b7c367417b2b2512b18 +title: Add Key-Value Pairs to JavaScript Objects +challengeType: 1 +videoUrl: '' +localeTitle: إضافة أزواج Key-Value إلى كائنات JavaScript +--- + +## Description +
في أبسط صورها ، تكون الكائنات مجرد مجموعات من أزواج القيمة الرئيسية ، أو بعبارة أخرى ، أجزاء من البيانات تم تعيينها لمعرفات فريدة نسميها خصائص أو مفاتيح . دعونا نلقي نظرة على مثال بسيط جدا:
اترك FCC_User = {
اسم المستخدم: "awesome_coder" ،
المتابعون: 572 ،
النقاط: 1741 ،
completedProjects: 15
يعرّف الرمز أعلاه كائن يسمى FCC_User يحتوي على أربعة خصائص ، كل منها تعيين إلى قيمة محددة. إذا أردنا معرفة عدد followers FCC_User ، فيمكننا الوصول إلى ذلك الموقع بكتابة:
السماح userData = FCC_User.followers؛
// userData يساوي 572
هذا ما يسمى dot notation . بدلاً من ذلك ، يمكننا أيضًا الوصول إلى مكان الإقامة باستخدام الأقواس ، مثل:
السماح لـ userData = FCC_User ['المتابعين']
// userData يساوي 572
لاحظ أنه مع تدوين قوس ، أرفقنا followers في علامات اقتباس. هذا لأن الأقواس تسمح لنا بالفعل بتمرير متغير ليتم تقييمه كاسم خاصية (تلميح: ضع ذلك في الاعتبار لاحقًا!). لو مررنا followers بدون علامات الاقتباس ، كان محرك جافا سكريبت قد حاول تقييمه كمتغير ، وكان من ReferenceError: followers is not defined .
+ +## Instructions +
باستخدام نفس الصيغة ، يمكننا أيضًا إضافة أزواج قيمة رئيسية جديدة إلى الكائنات. لقد أنشأنا كائن foods مع ثلاثة مداخل. أضف ثلاثة إدخالات إضافية: bananas بقيمة 13 ، grapes بقيمة 35 ، strawberries بقيمة 27 .
+ +## Tests +
+ +```yml +tests: + - text: foods هي كائن + testString: 'assert(typeof foods === "object", "foods is an object");' + - text: يحتوي جسم foods على "bananas" رئيسي بقيمة 13 + testString: 'assert(foods.bananas === 13, "The foods object has a key "bananas" with a value of 13");' + - text: يحتوي جسم foods على "grapes" الرئيسي بقيمة 35 + testString: 'assert(foods.grapes === 35, "The foods object has a key "grapes" with a value of 35");' + - text: يحتوي جسم foods على "strawberries" الرئيسية بقيمة 27 + testString: 'assert(foods.strawberries === 27, "The foods object has a key "strawberries" with a value of 27");' + - text: يجب تعيين أزواج القيم الأساسية باستخدام تدوين النقطة أو القوس + testString: 'assert(code.search(/bananas:/) === -1 && code.search(/grapes:/) === -1 && code.search(/strawberries:/) === -1, "The key-value pairs should be set using dot or bracket notation");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +let foods = { + apples: 25, + oranges: 32, + plums: 28 +}; + +// change code below this line + +// change code above this line + +console.log(foods); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/check-for-the-presence-of-an-element-with-indexof.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/check-for-the-presence-of-an-element-with-indexof.arabic.md new file mode 100644 index 0000000000..1c3410d9d1 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/check-for-the-presence-of-an-element-with-indexof.arabic.md @@ -0,0 +1,64 @@ +--- +id: 587d7b7b367417b2b2512b14 +title: Check For The Presence of an Element With indexOf() +challengeType: 1 +videoUrl: '' +localeTitle: التحقق من وجود عنصر مع indexOf () +--- + +## Description +
بما أن الصفائف يمكن تغييرها أو تحورها في أي وقت ، فلا يوجد ضمان حول مكان وجود بيانات معينة في صفيف معين ، أو حتى إذا كان هذا العنصر موجودًا حتى. لحسن الحظ ، توفر لنا جافا سكريبت طريقة أخرى مضمنة ، indexOf() ، تسمح لنا بالتحقق بسرعة وسهولة من وجود عنصر في صفيف. تأخذ indexOf() عنصرًا كمعلمة ، وعندما يتم استدعاؤها ، فإنها ترجع الموضع ، أو الفهرس ، لهذا العنصر ، أو -1 إذا كان العنصر غير موجود في الصفيف. فمثلا:
السماح للفواكه = [التفاح ، 'الكمثرى' ، 'البرتقال' ، 'الخوخ' ، 'الكمثرى'] ؛

fruits.indexOf ("التواريخ") // returns -1
fruit.indexOf ('oranges') // تُرجع 2
fruits.indexOf ('pears') // تُرجع 1 ، أول مؤشر موجود فيه العنصر
+ +## Instructions +
يمكن أن يكون indexOf() مفيدا بشكل لا يصدق للتحقق بسرعة من وجود عنصر في صفيف. لقد حددنا وظيفة ، quickCheck ، والتي تأخذ مصفوفة وعنصر quickCheck . تعديل الدالة باستخدام indexOf() بحيث تقوم بإرجاع true إذا كان العنصر الذي تم تمريره موجودًا على الصفيف ، و false إذا لم يكن موجودًا.
+ +## Tests +
+ +```yml +tests: + - text: 'quickCheck(["squash", "onions", "shallots"], "mushrooms") يجب أن تعود false' + testString: 'assert.strictEqual(quickCheck(["squash", "onions", "shallots"], "mushrooms"), false, "quickCheck(["squash", "onions", "shallots"], "mushrooms") should return false");' + - text: 'quickCheck(["squash", "onions", "shallots"], "onions") يجب أن تعود true' + testString: 'assert.strictEqual(quickCheck(["squash", "onions", "shallots"], "onions"), true, "quickCheck(["squash", "onions", "shallots"], "onions") should return true");' + - text: 'quickCheck([3, 5, 9, 125, 45, 2], 125) يجب أن quickCheck([3, 5, 9, 125, 45, 2], 125) true' + testString: 'assert.strictEqual(quickCheck([3, 5, 9, 125, 45, 2], 125), true, "quickCheck([3, 5, 9, 125, 45, 2], 125) should return true");' + - text: 'quickCheck([true, false, false], undefined) false' + testString: 'assert.strictEqual(quickCheck([true, false, false], undefined), false, "quickCheck([true, false, false], undefined) should return false");' + - text: يجب أن تستخدم الدالة quickCheck الأسلوب indexOf() + testString: 'assert.notStrictEqual(quickCheck.toString().search(/\.indexOf\(/), -1, "The quickCheck function should utilize the indexOf() method");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function quickCheck(arr, elem) { + // change code below this line + + // change code above this line +} + +// change code here to test different cases: +console.log(quickCheck(['squash', 'onions', 'shallots'], 'mushrooms')); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/check-if-an-object-has-a-property.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/check-if-an-object-has-a-property.arabic.md new file mode 100644 index 0000000000..463ab1f2bf --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/check-if-an-object-has-a-property.arabic.md @@ -0,0 +1,78 @@ +--- +id: 587d7b7d367417b2b2512b1c +title: Check if an Object has a Property +challengeType: 1 +videoUrl: '' +localeTitle: تحقق مما إذا كان الكائن يحتوي على خاصية +--- + +## Description +
الآن يمكننا إضافة وتعديل وإزالة المفاتيح من الكائنات. ولكن ماذا لو أردنا فقط معرفة ما إذا كان الكائن له خاصية معينة؟ تقدم لنا JavaScript طريقتين مختلفتين للقيام بذلك. واحد يستخدم hasOwnProperty() طريقة والآخر يستخدم in الكلمة. إذا كان لدينا users كائنات users خاصية Alan ، فيمكننا التحقق من وجودها بأي من الطرق التالية:
users.hasOwnProperty (علان ')؛
"آلان" في المستخدمين ؛
// كلاهما يعود صحيح
+ +## Instructions +
لقد أنشأنا كائنًا ، users ، ومع بعض المستخدمين فيه ، ووظيفة هي isEveryoneHere ، والتي isEveryoneHere users ككائن. الانتهاء من كتابة هذه الوظيفة بحيث تقوم بإرجاع true إلا إذا كان users يعترض يحتوي على جميع الأسماء الأربعة، Alan ، Jeff ، Sarah ، و Ryan ، ومفاتيح، و false خلاف ذلك.
+ +## Tests +
+ +```yml +tests: + - text: يحتوي كائن users فقط على مفاتيح Alan و Jeff و Sarah و Ryan + testString: 'assert("Alan" in users && "Jeff" in users && "Sarah" in users && "Ryan" in users && Object.keys(users).length === 4, "The users object only contains the keys Alan, Jeff, Sarah, and Ryan");' + - text: الدالة isEveryoneHere بإرجاع true إذا كان Alan و Jeff و Sarah و Ryan هي خصائص على كائن users + testString: 'assert(isEveryoneHere(users) === true, "The function isEveryoneHere returns true if Alan, Jeff, Sarah, and Ryan are properties on the users object");' + - text: الدالة isEveryoneHere بإرجاع false إذا كان Alan و Jeff و Sarah و Ryan ليست خصائص على كائن users + testString: 'assert((function() { delete users.Alan; delete users.Jeff; delete users.Sarah; delete users.Ryan; return isEveryoneHere(users) })() === false, "The function isEveryoneHere returns false if Alan, Jeff, Sarah, and Ryan are not properties on the users object");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +let users = { + Alan: { + age: 27, + online: true + }, + Jeff: { + age: 32, + online: true + }, + Sarah: { + age: 48, + online: true + }, + Ryan: { + age: 19, + online: true + } +}; + +function isEveryoneHere(obj) { + // change code below this line + + // change code above this line +} + +console.log(isEveryoneHere(users)); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/combine-arrays-with-the-spread-operator.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/combine-arrays-with-the-spread-operator.arabic.md new file mode 100644 index 0000000000..278e50cfcc --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/combine-arrays-with-the-spread-operator.arabic.md @@ -0,0 +1,58 @@ +--- +id: 587d7b7b367417b2b2512b17 +title: Combine Arrays with the Spread Operator +challengeType: 1 +videoUrl: '' +localeTitle: الجمع بين المصفوفات مع المشغل انتشار +--- + +## Description +
ميزة أخرى ضخمة لمشغل الانتشار ، هي القدرة على الجمع بين المصفوفات ، أو لإدراج جميع عناصر صفيف في آخر ، في أي مؤشر. باستخدام صيغ تركيبية أكثر تقليدية ، يمكننا تجميع صفائف ، لكن هذا يسمح لنا فقط بدمج المصفوفات في نهاية واحد ، وفي بداية أخرى. بناء الجملة Spread يجعل العملية التالية بسيطة للغاية:
دع هذا aarray = ['sage'، 'rosemary'، 'parsley'، 'thyme']؛

اترك ذلكالرائحة = ['basil' ، 'cilantro' ، ... thisArray ، 'الكزبرة'] ؛
/ / أن الآن يساوي [basil] ، 'cilantro' ، 'sage' ، 'rosemary' ، 'parsley' ، 'thyme' ، 'coriander']
باستخدام صيغة الانتشار ، حققنا للتو عملية من شأنها أن تكون أكثر تعقيدا وأكثر استعراضا لو استخدمنا الطرق التقليدية.
+ +## Instructions +
لقد قمنا بتعريف دالة spreadOut التي تقوم بارجاع sentence المتغيرة ، قم بتعديل الوظيفة باستخدام معامل الانتشار بحيث يقوم بإرجاع الصفيف ['learning', 'to', 'code', 'is', 'fun'] .
+ +## Tests +
+ +```yml +tests: + - text: 'spreadOut يجب أن تعود ["learning", "to", "code", "is", "fun"]' + testString: 'assert.deepEqual(spreadOut(), ["learning", "to", "code", "is", "fun"], "spreadOut should return ["learning", "to", "code", "is", "fun"]");' + - text: يجب أن تستخدم دالة spreadOut بنية الانتشار + testString: 'assert.notStrictEqual(spreadOut.toString().search(/[...]/), -1, "The spreadOut function should utilize spread syntax");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function spreadOut() { + let fragment = ['to', 'code']; + let sentence; // change this line + return sentence; +} + +// do not change code below this line +console.log(spreadOut()); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/copy-an-array-with-the-spread-operator.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/copy-an-array-with-the-spread-operator.arabic.md new file mode 100644 index 0000000000..076a67f638 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/copy-an-array-with-the-spread-operator.arabic.md @@ -0,0 +1,69 @@ +--- +id: 587d7b7b367417b2b2512b13 +title: Copy an Array with the Spread Operator +challengeType: 1 +videoUrl: '' +localeTitle: نسخ صفيف مع المشغل انتشار +--- + +## Description +
بينما تسمح لنا slice() بأن نكون انتقائيين حول عناصر المصفوفة المراد نسخها ، من بين العديد من المهام المفيدة الأخرى ، يتيح لنا مشغل التوزيع الجديد لـ ES6 نسخ جميع عناصر الصفيف بسهولة ، بالترتيب ، مع بناء بسيط وقابل للقراءة للغاية. تبدو صيغة الانتشار بهذا الشكل: ... الناحية العملية ، يمكننا استخدام عامل الانتشار لنسخ مصفوفة مثل:
السماح لهذاالصورة = [true، true، undefined، false، null]؛
السماح أن AArray = [... thisArray]؛
// thatArray يساوي [true ، true ، غير محدد ، false ، فارغ]
/ / هذا لا يزال يظل بدون تغيير ، وهو مطابق لذلك
+ +## Instructions +
قمنا بتعريف وظيفة ، copyMachine والتي تأخذ arr (صفيف) و num (a number) كوسيطة. من المفترض أن تقوم الدالة بإرجاع صفيف جديد يتكون من نسخ num من arr . لقد قمنا بمعظم العمل لك ، لكنه لا يعمل بشكل صحيح بعد. قم بتعديل الوظيفة باستخدام صيغة الانتشار بحيث تعمل بشكل صحيح (تلميح: قد تكون طريقة أخرى قمنا بتغطيتها بالفعل مفيدة هنا!).
+ +## Tests +
+ +```yml +tests: + - text: 'copyMachine([true, false, true], 2) [[true, false, true], [true, false, true]]' + testString: 'assert.deepEqual(copyMachine([true, false, true], 2), [[true, false, true], [true, false, true]], "copyMachine([true, false, true], 2) should return [[true, false, true], [true, false, true]]");' + - text: 'copyMachine([1, 2, 3], 5) [[1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3]]' + testString: 'assert.deepEqual(copyMachine([1, 2, 3], 5), [[1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3]], "copyMachine([1, 2, 3], 5) should return [[1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3]]");' + - text: 'copyMachine([true, true, null], 1) يجب أن يعيد [[true, true, null]]' + testString: 'assert.deepEqual(copyMachine([true, true, null], 1), [[true, true, null]], "copyMachine([true, true, null], 1) should return [[true, true, null]]");' + - text: 'copyMachine(["it works"], 3) [["it works"], ["it works"], ["it works"]]' + testString: 'assert.deepEqual(copyMachine(["it works"], 3), [["it works"], ["it works"], ["it works"]], "copyMachine(["it works"], 3) should return [["it works"], ["it works"], ["it works"]]");' + - text: و copyMachine وظيفة يجب الاستفادة من spread operator مع مجموعة arr + testString: 'assert.notStrictEqual(copyMachine.toString().indexOf(".concat(_toConsumableArray(arr))"), -1, "The copyMachine function should utilize the spread operator with array arr");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function copyMachine(arr, num) { + let newArr = []; + while (num >= 1) { + // change code below this line + + // change code above this line + num--; + } + return newArr; +} + +// change code here to test different cases: +console.log(copyMachine([true, false, true], 2)); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/copy-array-items-using-slice.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/copy-array-items-using-slice.arabic.md new file mode 100644 index 0000000000..4dbc15985a --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/copy-array-items-using-slice.arabic.md @@ -0,0 +1,58 @@ +--- +id: 587d7b7a367417b2b2512b12 +title: Copy Array Items Using slice() +challengeType: 1 +videoUrl: '' +localeTitle: نسخ صفيف العناصر باستخدام شريحة () +--- + +## Description +
الطريقة التالية التي سنقوم بتغطيتها هي slice() . slice() ، بدلاً من تعديل صفيف أو نسخ أو مقتطفات ، عدد معين من العناصر إلى صفيف جديد ، تاركاً المصفوفة يتم استدعاؤها دون مساس. تأخذ slice() معلمتين فقط - الأولى هي المؤشر الذي يبدأ عنده الاستخراج ، والثاني هو المؤشر الذي يتم عنده إيقاف الاستخراج (يحدث الاستخراج حتى ، ولكن ليس بما في ذلك العنصر في هذا المؤشر). النظر في هذا:
السماح للظروف الجوية = ['المطر' ، 'الثلج' ، 'المتجمدة' ، 'البرد' ، 'واضح'] ؛

السماح todaysWeather = weatherConditions.slice (1 ، 3) ؛
// todaysWeather يساوي ['snow'، 'sleet']؛
// weatherConditions لا يزال يساوي ['المطر' ، 'الثلج' ، 'المتجمدة' ، 'البرد' ، 'واضح']
في الواقع ، قمنا بإنشاء مصفوفة جديدة عن طريق استخراج عناصر من صفيف موجود.
+ +## Instructions +
لقد حددنا دالة ، forecast ، تأخذ صفيفًا كحجة. قم بتعديل الوظيفة باستخدام slice() لاستخراج المعلومات من صفيف الوسيطة وإرجاع صفيف جديد يحتوي على عناصر 'warm' و 'sunny' .
+ +## Tests +
+ +```yml +tests: + - text: 'يجب أن تعود forecast ["warm", "sunny"]' + testString: 'assert.deepEqual(forecast(["cold", "rainy", "warm", "sunny", "cool", "thunderstorms"]), ["warm", "sunny"], "forecast should return ["warm", "sunny"]");' + - text: يجب أن تستخدم وظيفة forecast طريقة slice() + testString: 'assert(/\.slice\(/.test(code), "The forecast function should utilize the slice() method");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function forecast(arr) { + // change code below this line + + return arr; +} + +// do not change code below this line +console.log(forecast(['cold', 'rainy', 'warm', 'sunny', 'cool', 'thunderstorms'])); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/create-complex-multi-dimensional-arrays.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/create-complex-multi-dimensional-arrays.arabic.md new file mode 100644 index 0000000000..d7897a278b --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/create-complex-multi-dimensional-arrays.arabic.md @@ -0,0 +1,65 @@ +--- +id: 587d7b7b367417b2b2512b16 +title: Create complex multi-dimensional arrays +challengeType: 1 +videoUrl: '' +localeTitle: إنشاء صفائف معقدة متعددة الأبعاد +--- + +## Description +
رائع! لقد تعلمت للتو عن طن عن المصفوفات! كانت هذه نظرة عامة على مستوى عالٍ إلى حدٍ ما ، وهناك الكثير الذي يجب معرفته حول العمل مع المصفوفات ، والتي سترى الكثير منها في الأقسام التالية. ولكن قبل الانتقال إلى النظر إلى الكائنات ، دعنا نلقي نظرة أخرى ، ونرى كيف يمكن أن تصبح المصفوفات أكثر تعقيدًا من ما رأيناه في التحديات السابقة. واحدة من أقوى الميزات عند التفكير في المصفوفات كهيكل البيانات ، هي أن المصفوفات يمكن أن تحتوي ، أو حتى تتكون بالكامل من صفائف أخرى. لقد رأينا صفائف تحتوي على مصفوفات في تحديات سابقة ، ولكنها بسيطة نوعًا ما. ومع ذلك ، يمكن أن تحتوي المصفوفات على عمق لا نهائي من المصفوفات التي يمكن أن تحتوي على صفائف أخرى ، كل منها بمستوياتها الاعتباطية الخاصة بها ، وهكذا. وبهذه الطريقة ، يمكن أن تصبح المصفوفة بسرعة كبيرة جدًا بنية بيانات معقدة ، تُعرف باسم مصفوفة متعددة الأبعاد أو متداخلة. خذ بعين الاعتبار المثال التالي:
اترك nestedArray = [// top، or first level - the external most array]
['عميق'] ، // مصفوفة داخل صفيف ، مستويين من العمق
[
['أعمق'] ، ['أعمق'] // / 2 صفيف متداخلة 3 مستويات عميقة

[
[
['أعمق'] ، [أعمق]] / / 2 صفيف متداخلة 4 مستويات عميقة

[
[
['deepest-est؟'] // مجموعة متداخلة 5 مستويات عميقة
]
]
]
].
على الرغم من أن هذا المثال قد يبدو معقدًا ، إلا أن هذا المستوى من التعقيد لم يسمع به ، أو حتى غير معتاد ، عند التعامل مع كميات كبيرة من البيانات. ومع ذلك ، لا يزال بإمكاننا الوصول بسهولة إلى أعمق مستويات صفيف هذا المركب مع تدوين قوس:
console.log (nestedArray [2] [1] [0] [0] [0])؛
// logs: deepest-est؟
والآن بعد أن علمنا بمكان هذه البيانات ، يمكننا إعادة تعيينها إذا كنا بحاجة إلى:
nestedArray [2] [1] [0] [0] [0] = 'deep still'؛

console.log (nestedArray [2] [1] [0] [0] [0])؛
// الآن سجلات: أعمق لا يزال
+ +## Instructions +
لقد حددنا متغيرًا ، myNestedArray ، متساوياً مع صفيف. تعديل myNestedArray ، وذلك باستخدام أي مجموعة من السلاسل والأرقام والقيم المنطقية لعناصر البيانات، بحيث انها بالضبط خمسة مستويات من العمق (تذكر، ومجموعة الخارجي، أكثر من غيره هو مستوى 1). في مكان ما في المستوى الثالث ، تتضمن السلسلة 'deep' ، في المستوى الرابع ، وتشمل السلسلة 'deeper' ، وعلى المستوى الخامس ، تتضمن السلسلة 'deepest' .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تحتوي myNestedArray على أرقام فقط ، وحدات منطقية ، وسلاسل مثل عناصر البيانات + testString: 'assert.strictEqual((function(arr) { let flattened = (function flatten(arr) { const flat = [].concat(...arr); return flat.some (Array.isArray) ? flatten(flat) : flat; })(arr); for (let i = 0; i < flattened.length; i++) { if ( typeof flattened[i] !== "number" && typeof flattened[i] !== "string" && typeof flattened[i] !== "boolean") { return false } } return true })(myNestedArray), true, "myNestedArray should contain only numbers, booleans, and strings as data elements");' + - text: يجب أن يكون myNestedArray 5 مستويات عمق + testString: 'assert.strictEqual((function(arr) {let depth = 0;function arrayDepth(array, i, d) { if (Array.isArray(array[i])) { arrayDepth(array[i], 0, d + 1);} else { depth = (d > depth) ? d : depth;}if (i < array.length) { arrayDepth(array, i + 1, d);} }arrayDepth(arr, 0, 0);return depth;})(myNestedArray), 4, "myNestedArray should have exactly 5 levels of depth");' + - text: يجب أن يحتوي myNestedArray على تكرار واحد لسلسلة "deep" على صفيف متداخلة من 3 مستويات + testString: 'assert((function howDeep(array, target, depth = 0) {return array.reduce((combined, current) => {if (Array.isArray(current)) { return combined.concat(howDeep(current, target, depth + 1));} else if (current === target) { return combined.concat(depth);} else { return combined;}}, []);})(myNestedArray, "deep").length === 1 && (function howDeep(array, target, depth = 0) {return array.reduce((combined, current) => {if (Array.isArray(current)) { return combined.concat(howDeep(current, target, depth + 1));} else if (current === target) { return combined.concat(depth);} else { return combined;}}, []);})(myNestedArray, "deep")[0] === 2, "myNestedArray should contain exactly one occurrence of the string "deep" on an array nested 3 levels deep");' + - text: يجب أن يحتوي myNestedArray على تكرار واحد فقط للسلسلة "deeper" على صفيف متداخلة 4 مستويات متداخلة + testString: 'assert((function howDeep(array, target, depth = 0) {return array.reduce((combined, current) => {if (Array.isArray(current)) { return combined.concat(howDeep(current, target, depth + 1));} else if (current === target) { return combined.concat(depth);} else { return combined;}}, []);})(myNestedArray, "deeper").length === 1 && (function howDeep(array, target, depth = 0) {return array.reduce((combined, current) => {if (Array.isArray(current)) { return combined.concat(howDeep(current, target, depth + 1));} else if (current === target) { return combined.concat(depth);} else { return combined;}}, []);})(myNestedArray, "deeper")[0] === 3, "myNestedArray should contain exactly one occurrence of the string "deeper" on an array nested 4 levels deep");' + - text: يجب أن يحتوي myNestedArray على تكرار واحد لسلسلة "deepest" على مجموعة متداخلة من 5 مستويات متداخلة + testString: 'assert((function howDeep(array, target, depth = 0) {return array.reduce((combined, current) => {if (Array.isArray(current)) { return combined.concat(howDeep(current, target, depth + 1));} else if (current === target) { return combined.concat(depth);} else { return combined;}}, []);})(myNestedArray, "deepest").length === 1 && (function howDeep(array, target, depth = 0) {return array.reduce((combined, current) => {if (Array.isArray(current)) { return combined.concat(howDeep(current, target, depth + 1));} else if (current === target) { return combined.concat(depth);} else { return combined;}}, []);})(myNestedArray, "deepest")[0] === 4, "myNestedArray should contain exactly one occurrence of the string "deepest" on an array nested 5 levels deep");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +let myNestedArray = [ + // change code below this line + ['unshift', false, 1, 2, 3, 'complex', 'nested'], + ['loop', 'shift', 6, 7, 1000, 'method'], + ['concat', false, true, 'spread', 'array'], + ['mutate', 1327.98, 'splice', 'slice', 'push'], + ['iterate', 1.3849, 7, '8.4876', 'arbitrary', 'depth'] + // change code above this line +]; + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/generate-an-array-of-all-object-keys-with-object.keys.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/generate-an-array-of-all-object-keys-with-object.keys.arabic.md new file mode 100644 index 0000000000..ce14696854 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/generate-an-array-of-all-object-keys-with-object.keys.arabic.md @@ -0,0 +1,76 @@ +--- +id: 587d7b7d367417b2b2512b1e +title: Generate an Array of All Object Keys with Object.keys() +challengeType: 1 +videoUrl: '' +localeTitle: إنشاء صفيف من كافة مفاتيح الكائنات مع Object.keys () +--- + +## Description +
يمكننا أيضًا إنشاء مصفوفة تحتوي على جميع المفاتيح المخزنة في كائن باستخدام طريقة Object.keys() وتمريرها في كائن كوسيطة. سيؤدي هذا إلى إرجاع صفيف يحتوي على سلاسل تمثل كل خاصية في الكائن. مرة أخرى ، لن يكون هناك طلب محدد للإدخالات في الصفيف.
+ +## Instructions +
قم getArrayOfUsers كتابة الدالة getArrayOfUsers بحيث تقوم بإرجاع صفيف يحتوي على كافة الخصائص في الكائن يتلقاها كوسيطة.
+ +## Tests +
+ +```yml +tests: + - text: يحتوي كائن users فقط على مفاتيح Alan و Jeff و Sarah و Ryan + testString: 'assert("Alan" in users && "Jeff" in users && "Sarah" in users && "Ryan" in users && Object.keys(users).length === 4, "The users object only contains the keys Alan, Jeff, Sarah, and Ryan");' + - text: ترجع الدالة getArrayOfUsers صفيف يحتوي على كافة المفاتيح الموجودة في كائن users + testString: 'assert((function() { users.Sam = {}; users.Lewis = {}; let R = getArrayOfUsers(users); return (R.indexOf("Alan") !== -1 && R.indexOf("Jeff") !== -1 && R.indexOf("Sarah") !== -1 && R.indexOf("Ryan") !== -1 && R.indexOf("Sam") !== -1 && R.indexOf("Lewis") !== -1); })() === true, "The getArrayOfUsers function returns an array which contains all the keys in the users object");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +let users = { + Alan: { + age: 27, + online: false + }, + Jeff: { + age: 32, + online: true + }, + Sarah: { + age: 48, + online: false + }, + Ryan: { + age: 19, + online: true + } +}; + +function getArrayOfUsers(obj) { + // change code below this line + + // change code above this line +} + +console.log(getArrayOfUsers(users)); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/iterate-through-all-an-arrays-items-using-for-loops.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/iterate-through-all-an-arrays-items-using-for-loops.arabic.md new file mode 100644 index 0000000000..5756320285 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/iterate-through-all-an-arrays-items-using-for-loops.arabic.md @@ -0,0 +1,66 @@ +--- +id: 587d7b7b367417b2b2512b15 +title: Iterate Through All an Array's Items Using For Loops +challengeType: 1 +videoUrl: '' +localeTitle: يتكرر من خلال جميع عناصر المصفوفة عن طريق استخدام الحلقات +--- + +## Description +
في بعض الأحيان عند العمل مع المصفوفات ، يكون من السهل جدًا التكرار من خلال كل عنصر للعثور على عنصر واحد أو أكثر قد نحتاجه ، أو التعامل مع صفيف استنادًا إلى عناصر البيانات التي تلبي مجموعة معينة من المعايير. تقدم JavaScript العديد من الطرق المضمنة التي يتم تكرار كل منها على المصفوفات بطرق مختلفة قليلاً لتحقيق نتائج مختلفة (مثل every() ، forEach() ، map() ، إلخ. ، ولكن التقنية الأكثر مرونة وتوفر لنا الأعظم مقدار التحكم هو بسيط for حلقة. خذ بعين الاعتبار ما يلي:
وظيفة greaterThanTen (arr) {
let newArr = []؛
لـ (let i = 0؛ i <arr.length؛ i ++) {
إذا (arr [i]> 10) {
newArr.push (آر [أنا])؛
}
}
عودة newArr ؛
}

greaterThanTen ([2، 12، 8، 14، 80، 0، 1])؛
// تُرجع [12 ، 14 ، 80]
باستخدام حلقة for ، تتكرر هذه الوظيفة خلال كل عنصر في الصفيف وتصل إليه ، وتضعه في اختبار بسيط قمنا بإنشائه. بهذه الطريقة ، حددنا بسهولة وببرمجية أي من عناصر البيانات أكبر من 10 ، وأعدنا مصفوفة جديدة تحتوي على تلك العناصر.
+ +## Instructions +
لقد حددنا دالة ، filteredArray ، والتي تأخذ arr ، ومصفوفة متداخلة ، و elem ، وتقوم بإرجاع صفيف جديد. يمثل elem عنصرًا قد يكون أو لا يكون موجودًا على واحد أو أكثر من الصفائف المتداخلة ضمن arr . قم بتعديل الوظيفة ، باستخدام حلقة for ، لإرجاع نسخة مفلترة من المصفوفة التي تم تمريرها بحيث يتم إزالة أي صفيف متداخل داخل arr يحتوي على elem .
+ +## Tests +
+ +```yml +tests: + - text: 'filteredArray([[10, 8, 3], [14, 6, 23], [3, 18, 6]], 18) يجب أن يعود [ [10, 8, 3], [14, 6, 23] ]' + testString: 'assert.deepEqual(filteredArray([ [10, 8, 3], [14, 6, 23], [3, 18, 6] ], 18), [[10, 8, 3], [14, 6, 23]], "filteredArray([[10, 8, 3], [14, 6, 23], [3, 18, 6]], 18) should return [ [10, 8, 3], [14, 6, 23] ]");' + - text: 'filteredArray([ ["trumpets", 2], ["flutes", 4], ["saxophones", 2] ], 2) يجب أن تعود [ ["flutes", 4] ]' + testString: 'assert.deepEqual(filteredArray([ ["trumpets", 2], ["flutes", 4], ["saxophones", 2] ], 2), [["flutes", 4]], "filteredArray([ ["trumpets", 2], ["flutes", 4], ["saxophones", 2] ], 2) should return [ ["flutes", 4] ]");' + - text: 'يجب أن تعود filteredArray([ ["amy", "beth", "sam"], ["dave", "sean", "peter"] ], "peter") [ ["amy", "beth", "sam"] ]' + testString: 'assert.deepEqual(filteredArray([["amy", "beth", "sam"], ["dave", "sean", "peter"]], "peter"), [["amy", "beth", "sam"]], "filteredArray([ ["amy", "beth", "sam"], ["dave", "sean", "peter"] ], "peter") should return [ ["amy", "beth", "sam"] ]");' + - text: 'filteredArray([[3, 2, 3], [1, 6, 3], [3, 13, 26], [19, 3, 9]], 3) يجب أن تعود [ ]' + testString: 'assert.deepEqual(filteredArray([[3, 2, 3], [1, 6, 3], [3, 13, 26], [19, 3, 9]], 3), [], "filteredArray([[3, 2, 3], [1, 6, 3], [3, 13, 26], [19, 3, 9]], 3) should return [ ]");' + - text: و filteredArray وظيفة يجب أن تستخدم ل for حلقة + testString: 'assert.notStrictEqual(filteredArray.toString().search(/for/), -1, "The filteredArray function should utilize a for loop");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function filteredArray(arr, elem) { + let newArr = []; + // change code below this line + + // change code above this line + return newArr; +} + +// change code here to test different cases: +console.log(filteredArray([[3, 2, 3], [1, 6, 3], [3, 13, 26], [19, 3, 9]], 3)); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/modify-an-array-stored-in-an-object.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/modify-an-array-stored-in-an-object.arabic.md new file mode 100644 index 0000000000..a1d63b7b00 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/modify-an-array-stored-in-an-object.arabic.md @@ -0,0 +1,79 @@ +--- +id: 587d7b7d367417b2b2512b1f +title: Modify an Array Stored in an Object +challengeType: 1 +videoUrl: '' +localeTitle: تعديل صفيف مخزنة في كائن +--- + +## Description +
لقد شاهدت الآن جميع العمليات الأساسية لكائنات جافا سكريبت. يمكنك إضافة أو تعديل أو إزالة أزواج قيمة المفتاح ، والتحقق من وجود المفاتيح ، وتكرارها على كافة المفاتيح الموجودة في كائن ما. أثناء متابعة تعلم لغة JavaScript ، سترى تطبيقات أكثر تنوعًا للكائنات. بالإضافة إلى ذلك ، فإن دروس "هياكل البيانات المتقدمة" الاختيارية في وقت لاحق في المنهج تغطي أيضًا كائنات ES6 Map و Set ، وكلاهما مشابهان للكائنات العادية ولكن مع توفير بعض الميزات الإضافية. الآن بعد أن تعلمت أساسيات المصفوفات والأشياء ، فأنت مستعد تمامًا للبدء في معالجة مشكلات أكثر تعقيدًا باستخدام JavaScript!
+ +## Instructions +
ألق نظرة على الكائن الذي قدمناه في محرر الشفرات. يحتوي كائن user على ثلاثة مفاتيح. يحتوي مفتاح data على خمسة مفاتيح ، يحتوي أحدها على مجموعة من friends . من هذا ، يمكنك أن ترى كيف الأجسام المرنة هي هياكل البيانات. لقد بدأنا في كتابة وظيفة addFriend . قم بإنهاء الكتابة بحيث تأخذ كائن user وتضيف اسم وسيطة friend إلى الصفيف المخزن في user.data.friends وتقوم بإرجاع هذا الصفيف.
+ +## Tests +
+ +```yml +tests: + - text: يحتوي كائن user على name age ومفاتيح data + testString: 'assert("name" in user && "age" in user && "data" in user, "The user object has name, age, and data keys");' + - text: تقبل وظيفة addFriend كائن user وسلسلة friend كوسيطة وتضيف الصديق إلى مصفوفة friends في كائن user + testString: 'assert((function() { let L1 = user.data.friends.length; addFriend(user, "Sean"); let L2 = user.data.friends.length; return (L2 === L1 + 1); })(), "The addFriend function accepts a user object and a friend string as arguments and adds the friend to the array of friends in the user object");' + - text: 'addFriend(user, "Pete") ["Sam", "Kira", "Tomo", "Pete"]' + testString: 'assert.deepEqual((function() { delete user.data.friends; user.data.friends = ["Sam", "Kira", "Tomo"]; return addFriend(user, "Pete") })(), ["Sam", "Kira", "Tomo", "Pete"], "addFriend(user, "Pete") should return ["Sam", "Kira", "Tomo", "Pete"]");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +let user = { + name: 'Kenneth', + age: 28, + data: { + username: 'kennethCodesAllDay', + joinDate: 'March 26, 2016', + organization: 'freeCodeCamp', + friends: [ + 'Sam', + 'Kira', + 'Tomo' + ], + location: { + city: 'San Francisco', + state: 'CA', + country: 'USA' + } + } +}; + +function addFriend(userObj, friend) { + // change code below this line + + // change code above this line +} + +console.log(addFriend(user, 'Pete')); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/modify-an-object-nested-within-an-object.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/modify-an-object-nested-within-an-object.arabic.md new file mode 100644 index 0000000000..90f98599a3 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/modify-an-object-nested-within-an-object.arabic.md @@ -0,0 +1,68 @@ +--- +id: 587d7b7c367417b2b2512b19 +title: Modify an Object Nested Within an Object +challengeType: 1 +videoUrl: '' +localeTitle: تعديل كائن متداخل داخل كائن +--- + +## Description +
الآن دعونا نلقي نظرة على كائن أكثر تعقيدا قليلا. يمكن أن تتداخل خصائص الكائن مع عمق اعتباطي ، ويمكن أن تكون قيمها أي نوع من البيانات التي تدعمها JavaScript ، بما في ذلك المصفوفات وحتى الكائنات الأخرى. خذ بعين الاعتبار ما يلي:
let nestedObject = {
id: 28802695164 ،
التاريخ: "31 ديسمبر 2016" ،
البيانات: {
totalUsers: 99 ،
على الانترنت: 80 ،
الموجودين: {
نشط: 67 ،
بعيدا: 13
}
}
يحتوي nestedObject على ثلاثة مفاتيح فريدة: id ، قيمته عبارة عن رقم date قيمته عبارة عن سلسلة data ، تكون قيمتها عبارة عن كائن يحتوي على كائن آخر متداخل داخله. في حين أن الهياكل يمكن أن تصبح معقدة بسرعة ، إلا أنه لا يزال بإمكاننا استخدام نفس الرموز للوصول إلى المعلومات التي نحتاج إليها.
+ +## Instructions +
هنا قمنا بتعريف كائن ، userActivity ، والذي يتضمن كائنًا آخرًا متداخلاً فيه. يمكنك تعديل الخصائص على هذا الكائن المتداخل بنفس الطريقة التي قمت بتعديل الخصائص في التحدي الأخير. قم بتعيين قيمة المفتاح online على 45 .
+ +## Tests +
+ +```yml +tests: + - text: لدى userActivity id date data + testString: 'assert("id" in userActivity && "date" in userActivity && "data" in userActivity, "userActivity has id, date and data properties");' + - text: لدى userActivity مفتاح data ضبطه على كائن به مفاتيح totalUsers وعبر online + testString: 'assert("totalUsers" in userActivity.data && "online" in userActivity.data, "userActivity has a data key set to an object with keys totalUsers and online");' + - text: يجب تعيين الخاصية online المتداخلة في مفتاح data userActivity على 45 + testString: 'assert(userActivity.data.online === 45, "The online property nested in the data key of userActivity should be set to 45");' + - text: يتم تعيين الخاصية online باستخدام تدوين النقطة أو القوس + testString: 'assert.strictEqual(code.search(/online: 45/), -1, "The online property is set using dot or bracket notation");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +let userActivity = { + id: 23894201352, + date: 'January 1, 2017', + data: { + totalUsers: 51, + online: 42 + } +}; + +// change code below this line + +// change code above this line + +console.log(userActivity); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/remove-items-from-an-array-with-pop-and-shift.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/remove-items-from-an-array-with-pop-and-shift.arabic.md new file mode 100644 index 0000000000..0d1e5fedf5 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/remove-items-from-an-array-with-pop-and-shift.arabic.md @@ -0,0 +1,60 @@ +--- +id: 587d78b2367417b2b2512b0f +title: Remove Items from an Array with pop() and shift() +challengeType: 1 +videoUrl: '' +localeTitle: إزالة العناصر من صفيف مع pop () و shift () +--- + +## Description +
كل من push() و unshift() لهما unshift() : pop() و shift() . كما قد تكون قد خمنت الآن ، بدلاً من إضافة ، يزيل pop() عنصرًا من نهاية صفيف ، بينما يزيل shift() عنصرًا من البداية. الاختلاف الرئيسي بين pop() و shift() وأبناء عمومتهم push() و unshift() ، هو أن كلا الأسلوبين لا unshift() معلمات ، وكل منهما يسمح فقط بتعديل مصفوفة بواسطة عنصر واحد في كل مرة. لنلقي نظرة:
اسمحوا تحيات = [ماذا يكون ما يصل؟ ، 'مرحبا' ، 'انظر يا!'] ؛

greetings.pop ()؛
// الآن تساوي ['ما الأمر؟' ، 'مرحبا']

greetings.shift ()؛
// الآن تساوي ['مرحبا']
يمكننا أيضًا إرجاع قيمة العنصر الذي تمت إزالته باستخدام أي من الطريقتين التاليتين:
دعونا برزت = تحيات. pop () ؛
// إرجاع "مرحبًا"
// تحيات الآن تساوي []
+ +## Instructions +
لقد حددنا وظيفة ، popShift ، والتي تأخذ مصفوفة كوسيطة وترجع مصفوفة جديدة. قم بتعديل الوظيفة ، باستخدام pop() و shift() ، لإزالة العناصر الأولى والأخيرة لصفيف الوسيطة ، وتعيين العناصر التي تم إزالتها للمتغيرات الخاصة بها ، بحيث يحتوي الصفيف الذي تم إرجاعه على قيمها.
+ +## Tests +
+ +```yml +tests: + - text: 'popShift(["challenge", "is", "not", "complete"]) يجب أن يعيد ["challenge", "complete"]' + testString: 'assert.deepEqual(popShift(["challenge", "is", "not", "complete"]), ["challenge", "complete"], "popShift(["challenge", "is", "not", "complete"]) should return ["challenge", "complete"]");' + - text: يجب أن تستخدم وظيفة popShift الأسلوب pop() + testString: 'assert.notStrictEqual(popShift.toString().search(/\.pop\(/), -1, "The popShift function should utilize the pop() method");' + - text: يجب أن تستخدم وظيفة popShift طريقة shift() + testString: 'assert.notStrictEqual(popShift.toString().search(/\.shift\(/), -1, "The popShift function should utilize the shift() method");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function popShift(arr) { + let popped; // change this line + let shifted; // change this line + return [shifted, popped]; +} + +// do not change code below this line +console.log(popShift(['challenge', 'is', 'not', 'complete'])); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/remove-items-using-splice.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/remove-items-using-splice.arabic.md new file mode 100644 index 0000000000..e053d35e60 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/remove-items-using-splice.arabic.md @@ -0,0 +1,59 @@ +--- +id: 587d78b2367417b2b2512b10 +title: Remove Items Using splice() +challengeType: 1 +videoUrl: '' +localeTitle: إزالة العناصر باستخدام لصق () +--- + +## Description +
حسنًا ، لقد تعلمنا كيفية إزالة عناصر من بداية ونهاية المصفوفات باستخدام shift() و pop() ، ولكن ماذا لو أردنا إزالة عنصر من مكان ما في المنتصف؟ أو إزالة أكثر من عنصر واحد في وقت واحد؟ حسنا ، هذا هو المكان الذي تأتي فيه splice() . يسمح لنا splice() بالقيام بذلك: إزالة أي عدد من العناصر المتتالية من أي مكان في صفيف. يمكن أن تأخذ splice() 3 معلمات ، ولكن في الوقت الحالي ، سنركز على أول 2 فقط. splice() من splice() هي أعداد صحيحة تمثل الفهارس ، أو المواضع ، للصفيف الذي يكون splice() دعا. وتذكر أن المصفوفات صفرية المفهرسة ، لذلك للإشارة إلى العنصر الأول من المصفوفة ، سنستخدم 0 . تمثل المعلمة الأولى splice() الفهرس الموجود في الصفيف الذي تبدأ منه إزالة العناصر ، بينما تشير المعلمة الثانية إلى عدد العناصر المطلوب حذفها. فمثلا:
دعونا صفيف = ['اليوم' ، 'كان' ، 'لا' ، 'هكذا' ، 'عظيم'] ؛

array.splice (2، 2)؛
// remove 2 elements starting with the 3rd element
// array الآن يساوي ['today'، 'was'، 'great']
splice() بتعديل المصفوفة التي يتم استدعاؤها فقط ، بل يقوم أيضًا بإرجاع صفيف جديد يحتوي على قيمة العناصر التي تمت إزالتها:
دعونا صفيف = ['أنا' ، 'أنا' ، 'شعور' ، 'حقا' ، 'سعيد'] ؛

السماح newArray = array.splice (3 ، 2) ؛
// newArray يساوي ['حقا' ، 'سعيد']
+ +## Instructions +
لقد قمنا بتعريف دالة ، sumOfTen ، والتي تأخذ مصفوفة كوسيطة وتقوم بإرجاع مجموع عناصر الصفيف. قم بتعديل الوظيفة ، باستخدام splice() ، بحيث تقوم بإرجاع قيمة 10 .
+ +## Tests +
+ +```yml +tests: + - text: sumOfTen 10 + testString: 'assert.strictEqual(sumOfTen([2, 5, 1, 5, 2, 1]), 10, "sumOfTen should return 10");' + - text: يجب أن تستخدم الدالة sumOfTen الأسلوب splice() + testString: 'assert.notStrictEqual(sumOfTen.toString().search(/\.splice\(/), -1, "The sumOfTen function should utilize the splice() method");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function sumOfTen(arr) { + // change code below this line + + // change code above this line + return arr.reduce((a, b) => a + b); +} + +// do not change code below this line +console.log(sumOfTen([2, 5, 1, 5, 2, 1])); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/use-an-array-to-store-a-collection-of-data.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/use-an-array-to-store-a-collection-of-data.arabic.md new file mode 100644 index 0000000000..25ebfb9c3d --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/use-an-array-to-store-a-collection-of-data.arabic.md @@ -0,0 +1,57 @@ +--- +id: 587d7b7e367417b2b2512b20 +title: Use an Array to Store a Collection of Data +challengeType: 1 +videoUrl: '' +localeTitle: استخدم صفيف لتخزين مجموعة من البيانات +--- + +## Description +
أدناه هو مثال عن أبسط تنفيذ بنية بيانات صفيف. وهذا ما يُعرف باسم مصفوفة أحادية البُعد ، بمعنى أنه يحتوي على مستوى واحد فقط ، أو أنه لا يحتوي على أي صفيفات أخرى متداخلة فيه. لاحظ أنه يحتوي على وحدات منطقية ، وسلاسل ، وأرقام ، من بين أنواع بيانات جافا سكريبت صالحة أخرى:
let simpleArray = ['one'، 2، 'three'، true، false، undefined، null]؛
console.log (simpleArray.length)؛
// سجلات 7
جميع الصفيف لها خاصية طول ، والتي كما هو موضح أعلاه ، يمكن الوصول إليها بسهولة بالغة مع Array.length . يمكن رؤية تنفيذ أكثر تعقيدًا لمصفوفة أدناه. هذا هو المعروف باسم مجموعة متعددة الأبعاد ، أو صفيف يحتوي على صفائف أخرى. لاحظ أن هذه المصفوفة تحتوي أيضًا على كائنات JavaScript ، والتي سنبحثها عن كثب في قسمنا التالي ، ولكن في الوقت الحالي ، كل ما تحتاج إلى معرفته هو أن المصفوفات قادرة أيضًا على تخزين الكائنات المعقدة.
اترك complexArray = [
[
{
واحد 1،
اثنان: 2

{
3: 3 ،
أربعة: 4
}

[
{
a: "a" ،
ب: "ب"

{
ج: "ج" ،
د: "د"
}
]
].
+ +## Instructions +
لقد حددنا متغيرًا يسمى yourArray . أكمل العبارة عن طريق تعيين صفيف مكون من خمسة عناصر على yourArray للمتغير yourArray . يجب أن يحتوي الصفيف الخاص بك على سلسلة واحدة على الأقل ورقم واحد وقيمة منطقية واحدة.
+ +## Tests +
+ +```yml +tests: + - text: yourArray هو مجموعة + testString: 'assert.strictEqual(Array.isArray(yourArray), true, "yourArray is an array");' + - text: yourArray ما لا يقل عن 5 عناصر طويلة + testString: 'assert.isAtLeast(yourArray.length, 5, "yourArray is at least 5 elements long");' + - text: yourArray يحتوي على boolean واحد على الأقل + testString: 'assert(yourArray.filter( el => typeof el === "boolean").length >= 1, "yourArray contains at least one boolean");' + - text: يحتوي yourArray على number واحد على الأقل + testString: 'assert(yourArray.filter( el => typeof el === "number").length >= 1, "yourArray contains at least one number");' + - text: يحتوي yourArray على string واحدة على الأقل + testString: 'assert(yourArray.filter( el => typeof el === "string").length >= 1, "yourArray contains at least one string");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +let yourArray; // change this line + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/use-the-delete-keyword-to-remove-object-properties.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/use-the-delete-keyword-to-remove-object-properties.arabic.md new file mode 100644 index 0000000000..a2ea271161 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-data-structures/use-the-delete-keyword-to-remove-object-properties.arabic.md @@ -0,0 +1,64 @@ +--- +id: 587d7b7c367417b2b2512b1b +title: Use the delete Keyword to Remove Object Properties +challengeType: 1 +videoUrl: '' +localeTitle: استخدم Delete keyword to Remove Object Properties +--- + +## Description +
الآن أنت تعرف ما هي الأشياء وخصائصها ومزاياها الأساسية. باختصار، فهي مخازن المفاتيح ذات قيمة والتي توفر طريقة بديهية مرنة لتنظيم البيانات، و، لأنها توفر الوقت بحث سريع جدا. خلال بقية هذه التحديات ، سنقوم بوصف العديد من العمليات الشائعة التي يمكنك القيام بها على الكائنات بحيث يمكنك أن تصبح مريحًا في تطبيق هذه الهياكل المفيدة للبيانات في برامجك. في التحديات السابقة ، قمنا بإضافة وتعديل أزواج قيمة المفتاح للكائن. سنرى هنا كيف يمكننا إزالة زوج قيمة مفتاح من كائن. دعونا نعيد النظر في مثال كائن foods لدينا للمرة الأخيرة. إذا أردنا إزالة مفتاح apples ، فيمكننا إزالته باستخدام الكلمة الرئيسية التي delete مثل هذا:
حذف foods.apples ؛
+ +## Instructions +
استخدم الكلمة الرئيسية حذف لإزالة oranges plums ومفاتيح strawberries من كائن foods .
+ +## Tests +
+ +```yml +tests: + - text: 'يحتوي جسم foods على ثلاثة مفاتيح فقط: apples grapes bananas' + testString: 'assert(!foods.hasOwnProperty("oranges") && !foods.hasOwnProperty("plums") && !foods.hasOwnProperty("strawberries") && Object.keys(foods).length === 3, "The foods object only has three keys: apples, grapes, and bananas");' + - text: تتم إزالة مفاتيح oranges plums strawberries باستخدام delete + testString: 'assert(code.search(/oranges:/) !== -1 && code.search(/plums:/) !== -1 && code.search(/strawberries:/) !== -1, "The oranges, plums, and strawberries keys are removed using delete");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +let foods = { + apples: 25, + oranges: 32, + plums: 28, + bananas: 13, + grapes: 35, + strawberries: 27 +}; + +// change code below this line + +// change code above this line + +console.log(foods); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/access-array-data-with-indexes.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/access-array-data-with-indexes.arabic.md new file mode 100644 index 0000000000..071f0e48ea --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/access-array-data-with-indexes.arabic.md @@ -0,0 +1,67 @@ +--- +id: 56bbb991ad1ed5201cd392ca +title: Access Array Data with Indexes +challengeType: 1 +guideUrl: 'https://arabic.freecodecamp.org/guide/certificates/access-array-data-with-indexes' +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert((function(){if(typeof myArray !== "undefined" && typeof myData !== "undefined" && myArray[0] === myData){return true;}else{return false;}})(), "The variable myData should equal the first value of myArray.");' + - text: يجب الوصول إلى البيانات في متغير myArray باستخدام تدوين قوس. + testString: 'assert((function(){if(code.match(/\s*=\s*myArray\[0\]/g)){return true;}else{return false;}})(), "The data in variable myArray should be accessed using bracket notation.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var ourArray = [50,60,70]; +var ourData = ourArray[0]; // equals 50 + +// Setup +var myArray = [50,60,70]; + +// Only change code below this line. + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/access-multi-dimensional-arrays-with-indexes.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/access-multi-dimensional-arrays-with-indexes.arabic.md new file mode 100644 index 0000000000..1e5baf7677 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/access-multi-dimensional-arrays-with-indexes.arabic.md @@ -0,0 +1,64 @@ +--- +id: 56592a60ddddeae28f7aa8e1 +title: Access Multi-Dimensional Arrays With Indexes +challengeType: 1 +guideUrl: 'https://arabic.freecodecamp.org/guide/certificates/access-array-data-with-indexes' +videoUrl: '' +localeTitle: الوصول إلى صفائف متعددة الأبعاد مع فهارس +--- + +## Description +
طريقة واحدة للتفكير في مصفوفة متعددة الأبعاد ، هي بمثابة صفيف من المصفوفات . عند استخدام الأقواس للوصول إلى الصفيف الخاص بك ، تشير المجموعة الأولى من الأقواس إلى الإدخالات الموجودة في مصفوفة الجزء الخارجي (المستوى الأول) ، ويشير كل زوج إضافي من الأقواس إلى المستوى التالي من الإدخالات بالداخل. مثال
var arr = [
[1،2،3]،
[4،5،6]،
[7،8،9]،
[[10،11،12] ، 13 ، 14]
].
آر [3]. // يساوي [[10،11،12] ، 13 ، 14]
آر [3] [0]؛ // يساوي [10،11،12]
آر [3] [0] [1]؛ // يساوي 11
ملحوظة
يجب ألا يكون هناك أي مسافات بين اسم الصفيف والأقواس المربعة ، مثل array [0][0] وحتى هذا array [0] [0] غير مسموح به. على الرغم من أن JavaScript قادر على معالجة هذا بشكل صحيح ، فقد يؤدي ذلك إلى إرباك المبرمجين الآخرين في قراءة التعليمات البرمجية.
+ +## Instructions +
باستخدام myArray قوس حدد عنصر من myArray بحيث يكون myData يساوي 8 .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تساوي myData 8 . + testString: 'assert(myData === 8, "myData should be equal to 8.");' + - text: يجب أن تستخدم تدوين قوس لقراءة القيمة الصحيحة من myArray . + testString: 'assert(/myArray\[2\]\[1\]/g.test(code) && !/myData\s*=\s*(?:.*[-+*/%]|\d)/g.test(code), "You should be using bracket notation to read the correct value from myArray.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Setup +var myArray = [[1,2,3], [4,5,6], [7,8,9], [[10,11,12], 13, 14]]; + +// Only change code below this line. +var myData = myArray[0][0]; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/accessing-nested-arrays.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/accessing-nested-arrays.arabic.md new file mode 100644 index 0000000000..42e7eb82f6 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/accessing-nested-arrays.arabic.md @@ -0,0 +1,82 @@ +--- +id: 56533eb9ac21ba0edf2244cd +title: Accessing Nested Arrays +challengeType: 1 +guideUrl: 'https://arabic.freecodecamp.org/guide/certificates/access-array-data-with-indexes' +videoUrl: '' +localeTitle: الوصول إلى صفائف متداخلة +--- + +## Description +
كما رأينا في الأمثلة السابقة ، يمكن أن تحتوي الكائنات على كل من الكائنات المتداخلة والصفائف المتداخلة. على غرار الوصول إلى الكائنات المتداخلة ، يمكن تقييد تدرج قوس Array للوصول إلى صفائف متداخلة. فيما يلي مثال لكيفية الوصول إلى صفيف متداخل:
var ourPets = [
{
animalType: "قطة" ،
الأسماء: [
"Meowzer"
"رقيق"،
"كيت كات"
]

{
animalType: "dog" ،
الأسماء: [
"بقعة"،
"العربة"،
"فرانكي"
]
}
].
ourPets [0] .names [1]؛ // "رقيق"
ourPets [1] .names [0]؛ // "سبوت"
+ +## Instructions +
استرجاع الشجرة الثانية من myPlants المتغير باستخدام myPlants نقطة الكائن myPlants مجموعة الصفيف.
+ +## Tests +
+ +```yml +tests: + - text: secondTree ينبغي أن يساوي "الصنوبر" + testString: 'assert(secondTree === "pine", "secondTree should equal "pine"");' + - text: استخدم نقطة myPlants قوس للوصول إلى myPlants + testString: 'assert(/=\s*myPlants\[1\].list\[1\]/.test(code), "Use dot and bracket notation to access myPlants");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Setup +var myPlants = [ + { + type: "flowers", + list: [ + "rose", + "tulip", + "dandelion" + ] + }, + { + type: "trees", + list: [ + "fir", + "pine", + "birch" + ] + } +]; + +// Only change code below this line + +var secondTree = ""; // Change this line + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/accessing-nested-objects.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/accessing-nested-objects.arabic.md new file mode 100644 index 0000000000..6c92f3bebb --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/accessing-nested-objects.arabic.md @@ -0,0 +1,73 @@ +--- +id: 56533eb9ac21ba0edf2244cc +title: Accessing Nested Objects +challengeType: 1 +guideUrl: 'https://arabic.freecodecamp.org/guide/certificates/accessing-nested-objects-in-json' +videoUrl: '' +localeTitle: الوصول إلى الكائنات المتداخلة +--- + +## Description +
يمكن الوصول إلى الخصائص الفرعية للكائنات عن طريق ربط صيغة النقطة أو القوس. هنا كائن متداخل:
var ourStorage = {
"مكتب": {
"الدرج": "دباسة"

"خزانة": {
"الدرج العلوي": {
"folder1": "ملف" ،
"folder2": "secrets"

"درج سفلي": "الصودا"
}

ourStorage.cabinet ["top drawer"]. // "أسرار"
ourStorage.desk.drawer. // "دباسة"
+ +## Instructions +
قم بالوصول إلى كائن myStorage وقم بتعيين محتويات خاصية glove box إلى متغير gloveBoxContents . استخدام تدرج قوس للمواقع مع مساحة في أسمائهم.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يساوي gloveBoxContents "الخرائط" + testString: 'assert(gloveBoxContents === "maps", "gloveBoxContents should equal "maps"");' + - text: استخدم تدوين النقطة myStorage للوصول إلى myStorage + testString: 'assert(/=\s*myStorage\.car\.inside\[\s*("|")glove box\1\s*\]/g.test(code), "Use dot and bracket notation to access myStorage");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Setup +var myStorage = { + "car": { + "inside": { + "glove box": "maps", + "passenger seat": "crumbs" + }, + "outside": { + "trunk": "jack" + } + } +}; + +var gloveBoxContents = undefined; // Change this line + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/accessing-object-properties-with-bracket-notation.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/accessing-object-properties-with-bracket-notation.arabic.md new file mode 100644 index 0000000000..c6bd01bc9f --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/accessing-object-properties-with-bracket-notation.arabic.md @@ -0,0 +1,76 @@ +--- +id: 56533eb9ac21ba0edf2244c8 +title: Accessing Object Properties with Bracket Notation +challengeType: 1 +guideUrl: 'https://arabic.freecodecamp.org/guide/certificates/accessing-objects-properties-with-bracket-notation' +videoUrl: '' +localeTitle: الوصول إلى خصائص كائن مع تدرج قوس +--- + +## Description +
الطريقة الثانية للوصول إلى خصائص كائن تدوين قوس ( [] ). إذا كانت خاصية الكائن الذي تحاول الوصول إليه تحتوي على مسافة في اسمه ، فستحتاج إلى استخدام تدرج قوس. ومع ذلك ، لا يزال بإمكانك استخدام تدرج قوس على خصائص الكائن بدون مسافات. هنا عينة من استخدام تدرج قوس لقراءة خاصية الكائن:
var myObj = {
"اسم الفضاء": "كيرك" ،
"مساحة إضافية": "سبوك" ،
"NoSpace": "USS Enterprise"

myObj ["اسم الفضاء"] ؛ // كيرك
myObj ['More Space']؛ // سبوك
myObj [ "NoSpace"]؛ // يو اس اس انتربرايز
لاحظ أن أسماء الخصائص التي تحتوي على مسافات يجب أن تكون بين علامتي اقتباس (مفرد أو مزدوج).
+ +## Instructions +
قراءة قيم خصائص "an entree" و "the drink" من testObj باستخدام تدوين قوس entreeValue إلى entreeValue drinkValue على التوالي.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون entreeValue عبارة عن سلسلة + testString: 'assert(typeof entreeValue === "string" , "entreeValue should be a string");' + - text: يجب أن تكون قيمة entreeValue "hamburger" + testString: 'assert(entreeValue === "hamburger" , "The value of entreeValue should be "hamburger"");' + - text: يجب أن يكون drinkValue سلسلة + testString: 'assert(typeof drinkValue === "string" , "drinkValue should be a string");' + - text: قيمة drinkValue يجب أن تكون "water" + testString: 'assert(drinkValue === "water" , "The value of drinkValue should be "water"");' + - text: يجب عليك استخدام تدوين قوس مرتين + testString: 'assert(code.match(/testObj\s*?\[("|")[^""]+\1\]/g).length > 1, "You should use bracket notation twice");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Setup +var testObj = { + "an entree": "hamburger", + "my side": "veggies", + "the drink": "water" +}; + +// Only change code below this line + +var entreeValue = testObj; // Change this line +var drinkValue = testObj; // Change this line + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/accessing-object-properties-with-dot-notation.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/accessing-object-properties-with-dot-notation.arabic.md new file mode 100644 index 0000000000..a1095d3128 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/accessing-object-properties-with-dot-notation.arabic.md @@ -0,0 +1,75 @@ +--- +id: 56533eb9ac21ba0edf2244c7 +title: Accessing Object Properties with Dot Notation +challengeType: 1 +videoUrl: '' +localeTitle: الوصول إلى خصائص كائن مع ترميز Dot +--- + +## Description +
هناك طريقتان للوصول إلى خصائص كائن: تدوين نقطي ( . ) وتدوين قوس ( [] ) ، شبيه بصفيف. Dot notation هو ما تستخدمه عندما تعرف اسم العقار الذي تحاول الوصول إليه في وقت مبكر. هنا عينة من استخدام تدوين النقطة ( . ) لقراءة خاصية الكائن:
var myObj = {
prop1: "val1" ،
prop2: "val2"

var prop1val = myObj.prop1 ، // val1
var prop2val = myObj.prop2؛ // val2
+ +## Instructions +
قراءة في قيم خاصية testObj باستخدام التدوين النقطي. تعيين hatValue متغير يساوي hat خاصية الكائن وتعيين shirtValue متغير shirtValue يساوي shirt خاصية الكائن.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون hatValue سلسلة + testString: 'assert(typeof hatValue === "string" , "hatValue should be a string");' + - text: قيمة hatValue يجب أن تكون "ballcap" + testString: 'assert(hatValue === "ballcap" , "The value of hatValue should be "ballcap"");' + - text: يجب أن يكون shirtValue عبارة عن سلسلة + testString: 'assert(typeof shirtValue === "string" , "shirtValue should be a string");' + - text: يجب أن تكون قيمة shirtValue "jersey" + testString: 'assert(shirtValue === "jersey" , "The value of shirtValue should be "jersey"");' + - text: يجب عليك استخدام dot notation مرتين + testString: 'assert(code.match(/testObj\.\w+/g).length > 1, "You should use dot notation twice");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Setup +var testObj = { + "hat": "ballcap", + "shirt": "jersey", + "shoes": "cleats" +}; + +// Only change code below this line + +var hatValue = testObj; // Change this line +var shirtValue = testObj; // Change this line + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/accessing-object-properties-with-variables.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/accessing-object-properties-with-variables.arabic.md new file mode 100644 index 0000000000..a8f87fba5c --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/accessing-object-properties-with-variables.arabic.md @@ -0,0 +1,78 @@ +--- +id: 56533eb9ac21ba0edf2244c9 +title: Accessing Object Properties with Variables +challengeType: 1 +guideUrl: 'https://arabic.freecodecamp.org/guide/certificates/accessing-objects-properties-with-variables' +videoUrl: '' +localeTitle: الوصول إلى خصائص الكائن مع المتغيرات +--- + +## Description +
استخدام آخر لتدوين قوس على الكائنات هو الوصول إلى خاصية يتم تخزينها كقيمة متغير. يمكن أن يكون هذا مفيدًا جدًا للتكرار من خلال خصائص الكائن أو عند الوصول إلى جدول البحث. في ما يلي مثال على استخدام متغير للوصول إلى موقع:
var dogs = {
Fido: "Mutt"، Hunter: "Doberman"، Snoopie: "Beagle"

var myDog = "Hunter" ؛
var myBreed = dogs [myDog]؛
console.log (myBreed)؛ // "دوبيرمان"
هناك طريقة أخرى لاستخدام هذا المفهوم وهي عندما يتم جمع اسم المنشأة ديناميكيًا أثناء تنفيذ البرنامج ، كما يلي:
var someObj = {
propName: "John"

وظيفة propPrefix (str) {
var s = "prop" ؛
return s + str؛
}
var someProp = propPrefix ("Name")؛ // someProp الآن يحمل القيمة "propName"
console.log (someObj [someProp])؛ // "يوحنا"
لاحظ أننا لا نستخدم علامات اقتباس حول اسم المتغير عند استخدامه للوصول إلى الخاصية لأننا نستخدم قيمة المتغير ، وليس الاسم .
+ +## Instructions +
استخدم متغير playerNumber للبحث عن المشغل 16 في testObj باستخدام testObj قوس. ثم قم بتعيين هذا الاسم إلى متغير player .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون playerNumber رقمًا + testString: 'assert(typeof playerNumber === "number", "playerNumber should be a number");' + - text: يجب أن يكون player المتغير عبارة عن سلسلة + testString: 'assert(typeof player === "string", "The variable player should be a string");' + - text: يجب أن تكون قيمة player "مونتانا" + testString: 'assert(player === "Montana", "The value of player should be "Montana"");' + - text: يجب عليك استخدام تدوين قوس للوصول إلى testObj + testString: 'assert(/testObj\s*?\[.*?\]/.test(code),"You should use bracket notation to access testObj");' + - text: يجب عدم تعيين قيمة Montana إلى player المتغير مباشرةً. + testString: 'assert(!code.match(/player\s*=\s*"|\"\s*Montana\s*"|\"\s*;/gi),"You should not assign the value Montana to the variable player directly.");' + - text: يجب أن تستخدم المتغير playerNumber في تدوين playerNumber + testString: 'assert(/testObj\s*?\[\s*playerNumber\s*\]/.test(code),"You should be using the variable playerNumber in your bracket notation");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Setup +var testObj = { + 12: "Namath", + 16: "Montana", + 19: "Unitas" +}; + +// Only change code below this line; + +var playerNumber; // Change this Line +var player = testObj; // Change this Line + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/add-new-properties-to-a-javascript-object.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/add-new-properties-to-a-javascript-object.arabic.md new file mode 100644 index 0000000000..03106fb5c2 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/add-new-properties-to-a-javascript-object.arabic.md @@ -0,0 +1,77 @@ +--- +id: 56bbb991ad1ed5201cd392d2 +title: Add New Properties to a JavaScript Object +challengeType: 1 +videoUrl: '' +localeTitle: أضف خصائص جديدة إلى كائن JavaScript +--- + +## Description +
يمكنك إضافة خصائص جديدة إلى كائنات JavaScript الموجودة بالطريقة نفسها التي يمكنك تعديلها بها. في ما يلي كيفية إضافة خاصية "bark" إلى ourDog : ourDog.bark = "bow-wow"; أو ourDog["bark"] = "bow-wow"; الآن عندما نقيم ourDog.bark ، ourDog.bark ، "bow-wow".
+ +## Instructions +
إضافة خاصية "bark" إلى myDog وتعيينه إلى صوت كلب ، مثل "woof". يمكنك استخدام أي نقطة أو تدوين قوس.
+ +## Tests +
+ +```yml +tests: + - text: إضافة "bark" الملكية إلى myDog . + testString: 'assert(myDog.bark !== undefined, "Add the property "bark" to myDog.");' + - text: لا تضف "bark" إلى قسم الإعداد + testString: 'assert(!/bark[^\n]:/.test(code), "Do not add "bark" to the setup section");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var ourDog = { + "name": "Camper", + "legs": 4, + "tails": 1, + "friends": ["everything!"] +}; + +ourDog.bark = "bow-wow"; + +// Setup +var myDog = { + "name": "Happy Coder", + "legs": 4, + "tails": 1, + "friends": ["freeCodeCamp Campers"] +}; + +// Only change code below this line. + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/add-two-numbers-with-javascript.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/add-two-numbers-with-javascript.arabic.md new file mode 100644 index 0000000000..f4550e549d --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/add-two-numbers-with-javascript.arabic.md @@ -0,0 +1,59 @@ +--- +id: cf1111c1c11feddfaeb3bdef +title: Add Two Numbers with JavaScript +challengeType: 1 +videoUrl: '' +localeTitle: أضف رقمين مع JavaScript +--- + +## Description +
Number هو نوع البيانات في JavaScript والذي يمثل البيانات الرقمية. الآن دعنا نحاول إضافة رقمين باستخدام JavaScript. تستخدم JavaScript الرمز + كعملية إضافة عند وضعها بين رقمين. مثال
myVar = 5 + 10؛ // المعين 15
+ +## Instructions +
تغيير 0 بحيث يساوي مجموع 20 .
+ +## Tests +
+ +```yml +tests: + - text: sum يجب أن يساوي 20 + testString: 'assert(sum === 20, "sum should equal 20");' + - text: استخدم عامل التشغيل + + testString: 'assert(/\+/.test(code), "Use the + operator");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +var sum = 10 + 0; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/adding-a-default-option-in-switch-statements.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/adding-a-default-option-in-switch-statements.arabic.md new file mode 100644 index 0000000000..89d6903233 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/adding-a-default-option-in-switch-statements.arabic.md @@ -0,0 +1,75 @@ +--- +id: 56533eb9ac21ba0edf2244de +title: Adding a Default Option in Switch Statements +challengeType: 1 +guideUrl: 'https://arabic.freecodecamp.org/guide/certificates/adding-a-default-option-in-switch-statements' +videoUrl: '' +localeTitle: إضافة خيار افتراضي في تبديل البيانات +--- + +## Description +
في بيان switch قد لا تتمكن من تحديد جميع القيم المحتملة كبيانات case . بدلاً من ذلك ، يمكنك إضافة العبارة default التي سيتم تنفيذها في حالة عدم العثور على عبارات case مطابقة. أعتقد أنه من مثل النهائي else بيان في if/else السلسلة. يجب أن تكون العبارة default هي الحالة الأخيرة.
التبديل (عدد) {
قيمة الحالة 1:
statement1.
استراحة؛
قيمة الحالة 2:
statement2.
استراحة؛
...
الافتراضي:
defaultStatement.
استراحة؛
}
+ +## Instructions +
اكتب عبارة تبديل لتعيين answer عن الشروط التالية:
"a" - "apple"
"b" - "طائر"
"c" - "cat"
default - "الاشياء"
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون لـ switchOfStuff("a") قيمة "apple" + testString: 'assert(switchOfStuff("a") === "apple", "switchOfStuff("a") should have a value of "apple"");' + - text: يجب أن يكون switchOfStuff("b") قيمة "bird" + testString: 'assert(switchOfStuff("b") === "bird", "switchOfStuff("b") should have a value of "bird"");' + - text: يجب أن يكون لـ switchOfStuff("c") قيمة "cat" + testString: 'assert(switchOfStuff("c") === "cat", "switchOfStuff("c") should have a value of "cat"");' + - text: يجب أن يكون لـ switchOfStuff("d") قيمة "الأشياء" + testString: 'assert(switchOfStuff("d") === "stuff", "switchOfStuff("d") should have a value of "stuff"");' + - text: يجب أن يكون switchOfStuff(4) قيمة "الأشياء" + testString: 'assert(switchOfStuff(4) === "stuff", "switchOfStuff(4) should have a value of "stuff"");' + - text: يجب عدم استخدام أي if أو else البيانات + testString: 'assert(!/else/g.test(code) || !/if/g.test(code), "You should not use any if or else statements");' + - text: يجب عليك استخدام العبارة default + testString: 'assert(switchOfStuff("string-to-trigger-default-case") === "stuff", "You should use a default statement");' + - text: يجب أن يكون لديك على الأقل 3 بيانات break + testString: 'assert(code.match(/break/g).length > 2, "You should have at least 3 break statements");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function switchOfStuff(val) { + var answer = ""; + // Only change code below this line + + + + // Only change code above this line + return answer; +} + +// Change this value to test +switchOfStuff(1); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/appending-variables-to-strings.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/appending-variables-to-strings.arabic.md new file mode 100644 index 0000000000..97e15d3339 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/appending-variables-to-strings.arabic.md @@ -0,0 +1,68 @@ +--- +id: 56533eb9ac21ba0edf2244ed +title: Appending Variables to Strings +challengeType: 1 +guideUrl: 'https://arabic.freecodecamp.org/guide/certificates/appending-variables-to-strings' +videoUrl: '' +localeTitle: إلحاق المتغيرات بالسلاسل +--- + +## Description +
مثلما يمكننا بناء سلسلة على عدة أسطر من القيم الحرفية ، يمكننا أيضًا إضافة متغيرات إلى سلسلة باستخدام عامل plus equals ( += ).
+ +## Instructions +
someAdjective إلى myStr باستخدام += عامل التشغيل.
+ +## Tests +
+ +```yml +tests: + - text: someAdjective يجب تعيين إلى سلسلة 3 أحرف على الأقل طويلة + testString: 'assert(typeof someAdjective !== "undefined" && someAdjective.length > 2, "someAdjective should be set to a string at least 3 characters long");' + - text: إلحاق someAdjective إلى myStr باستخدام += عامل التشغيل + testString: 'assert(code.match(/myStr\s*\+=\s*someAdjective\s*/).length > 0, "Append someAdjective to myStr using the += operator");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var anAdjective = "awesome!"; +var ourStr = "freeCodeCamp is "; +ourStr += anAdjective; + +// Only change code below this line + +var someAdjective; +var myStr = "Learning to code is "; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/assignment-with-a-returned-value.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/assignment-with-a-returned-value.arabic.md new file mode 100644 index 0000000000..5fd33b8845 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/assignment-with-a-returned-value.arabic.md @@ -0,0 +1,76 @@ +--- +id: 56533eb9ac21ba0edf2244c3 +title: Assignment with a Returned Value +challengeType: 1 +guideUrl: 'https://arabic.freecodecamp.org/guide/certificates/assignment-with-a-returned-value' +videoUrl: '' +localeTitle: التنازل مع القيمة المرتجعة +--- + +## Description +
إذا كنت ستتذكر من مناقشتنا لـ Storing Values ​​مع Assignment Operator ، يتم حل كل شيء على يمين علامة المساواة قبل تعيين القيمة. هذا يعني أنه يمكننا أخذ قيمة الإرجاع للدالة وتعيينها لمتغير. افترض أننا حددنا مسبقا sum وظيفة يضيف رقمين معا ، ثم: ourSum = sum(5, 12); سوف تستدعي دالة sum ، والتي تُرجع قيمة 17 ourSum المتغير.
+ +## Instructions +
استدعاء الدالة processArg مع وسيطة من 7 وتعيين قيمته الإرجاع إلى المتغير processed .
+ +## Tests +
+ +```yml +tests: + - text: processed يجب أن يكون لها قيمة 2 + testString: 'assert(processed === 2, "processed should have a value of 2");' + - text: يجب عليك تعيين processArg processed + testString: 'assert(/processed\s*=\s*processArg\(\s*7\s*\)\s*;/.test(code), "You should assign processArg to processed");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var changed = 0; + +function change(num) { + return (num + 5) / 3; +} + +changed = change(10); + +// Setup +var processed = 0; + +function processArg(num) { + return (num + 3) / 5; +} + +// Only change code below this line + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/build-javascript-objects.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/build-javascript-objects.arabic.md new file mode 100644 index 0000000000..fe869c7396 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/build-javascript-objects.arabic.md @@ -0,0 +1,80 @@ +--- +id: 56bbb991ad1ed5201cd392d0 +title: Build JavaScript Objects +challengeType: 1 +videoUrl: '' +localeTitle: بناء كائنات جافا سكريبت +--- + +## Description +
ربما سمعت المصطلح object قبل. تشبه الكائنات arrays ، إلا أنه بدلاً من استخدام الفهارس للوصول إلى بياناتها وتعديلها ، يمكنك الوصول إلى البيانات الموجودة في الكائنات من خلال ما يسمى properties . تُعد الكائنات مفيدة لتخزين البيانات بطريقة منظمة ، ويمكن أن تمثل كائنات العالم الحقيقي ، مثل القطة. وإليك عينة كائن القط:
var cat = {
"الاسم": "الشعيرات" ،
"الساقين": 4 ،
"ذيول": 1 ،
"الأعداء": ["Water"، "Dogs"]
في هذا المثال ، يتم تخزين جميع الخصائص كسلاسل ، مثل - "name" ، "legs" ، و "tails" . ومع ذلك ، يمكنك أيضًا استخدام الأرقام كخصائص. يمكنك حتى حذف علامات الاقتباس لخصائص السلسلة المفردة الكلمة ، كما يلي:
var anotherObject = {
جعل: "فورد" ،
5: "خمسة" ،
"نموذج": "التركيز"
ومع ذلك ، إذا كان الكائن الخاص بك يحتوي على أية خصائص غير سلسلة ، فسوف يقوم جافا سكريبت بتلبيسها تلقائيًا كسلاسل.
+ +## Instructions +
جعل كائن يمثل كلب يسمى myDog الذي يحتوي على خصائص "name" (سلسلة) ، "legs" ، "tails" و "friends" . يمكنك تعيين خصائص الكائن هذه إلى أي قيم تريدها ، حيث أن "name" الطويل عبارة عن سلسلة ، و "legs" و "tails" هي أرقام ، و "friends" هو مصفوفة.
+ +## Tests +
+ +```yml +tests: + - text: myDog يجب أن يحتوي على name الخاصية ويجب أن يكون string . + testString: 'assert((function(z){if(z.hasOwnProperty("name") && z.name !== undefined && typeof z.name === "string"){return true;}else{return false;}})(myDog), "myDog should contain the property name and it should be a string.");' + - text: myDog يجب أن يحتوي على legs العقار ويجب أن يكون number . + testString: 'assert((function(z){if(z.hasOwnProperty("legs") && z.legs !== undefined && typeof z.legs === "number"){return true;}else{return false;}})(myDog), "myDog should contain the property legs and it should be a number.");' + - text: myDog يجب أن يحتوي على tails الخاصية ويجب أن يكون number . + testString: 'assert((function(z){if(z.hasOwnProperty("tails") && z.tails !== undefined && typeof z.tails === "number"){return true;}else{return false;}})(myDog), "myDog should contain the property tails and it should be a number.");' + - text: myDog يجب أن يحتوي على friends الملكية ويجب أن يكون array . + testString: 'assert((function(z){if(z.hasOwnProperty("friends") && z.friends !== undefined && Array.isArray(z.friends)){return true;}else{return false;}})(myDog), "myDog should contain the property friends and it should be an array.");' + - text: يجب أن يحتوي myDog على جميع الخصائص المحددة فقط. + testString: 'assert((function(z){return Object.keys(z).length === 4;})(myDog), "myDog should only contain all the given properties.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var ourDog = { + "name": "Camper", + "legs": 4, + "tails": 1, + "friends": ["everything!"] +}; + +// Only change code below this line. + +var myDog = { + + + + +}; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/chaining-if-else-statements.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/chaining-if-else-statements.arabic.md new file mode 100644 index 0000000000..d31ac641b0 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/chaining-if-else-statements.arabic.md @@ -0,0 +1,82 @@ +--- +id: 56533eb9ac21ba0edf2244dc +title: Chaining If Else Statements +challengeType: 1 +videoUrl: '' +localeTitle: تسلسل إذا كانت تصريحات أخرى +--- + +## Description +
if/else يمكن ربط عبارات if/else معًا لمنطق معقد. هنا هو pseudocode متعددة متعددة السلاسل if / else if العبارات:
إذا ( condition1 ) {
statement1
} آخر إذا ( condition2 ) {
statement2
} آخر إذا ( condition3 ) {
statement3
. . .
} آخر {
statementN
}
+ +## Instructions +
كتابة مقيد if / else if عبارات تفي بالشروط التالية: num < 5 - return "Tiny"
num < 10 - عودة "صغير"
num < 15 - عودة "متوسطة"
num < 20 - عودة "كبير"
num >= 20 - return "Huge"
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون لديك على الأقل أربع else البيانات + testString: 'assert(code.match(/else/g).length > 3, "You should have at least four else statements");' + - text: يجب أن يكون لديك أربعة على الأقل if البيانات + testString: 'assert(code.match(/if/g).length > 3, "You should have at least four if statements");' + - text: يجب أن يكون لديك بيان return واحد على الأقل + testString: 'assert(code.match(/return/g).length >= 1, "You should have at least one return statement");' + - text: يجب أن ترجع testSize(0) "صغيرة" + testString: 'assert(testSize(0) === "Tiny", "testSize(0) should return "Tiny"");' + - text: يجب أن ترجع testSize(4) "صغيرة" + testString: 'assert(testSize(4) === "Tiny", "testSize(4) should return "Tiny"");' + - text: testSize(5) إرجاع "صغير" + testString: 'assert(testSize(5) === "Small", "testSize(5) should return "Small"");' + - text: testSize(8) إرجاع "صغير" + testString: 'assert(testSize(8) === "Small", "testSize(8) should return "Small"");' + - text: testSize(10) إرجاع "Medium" + testString: 'assert(testSize(10) === "Medium", "testSize(10) should return "Medium"");' + - text: testSize(14) إرجاع "Medium" + testString: 'assert(testSize(14) === "Medium", "testSize(14) should return "Medium"");' + - text: testSize(15) إرجاع "كبير" + testString: 'assert(testSize(15) === "Large", "testSize(15) should return "Large"");' + - text: testSize(17) إرجاع "كبير" + testString: 'assert(testSize(17) === "Large", "testSize(17) should return "Large"");' + - text: testSize(20) إرجاع "ضخم" + testString: 'assert(testSize(20) === "Huge", "testSize(20) should return "Huge"");' + - text: testSize(25) إرجاع "ضخم" + testString: 'assert(testSize(25) === "Huge", "testSize(25) should return "Huge"");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function testSize(num) { + // Only change code below this line + + + return "Change Me"; + // Only change code above this line +} + +// Change this value to test +testSize(7); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comment-your-javascript-code.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comment-your-javascript-code.arabic.md new file mode 100644 index 0000000000..005129702a --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comment-your-javascript-code.arabic.md @@ -0,0 +1,50 @@ +--- +id: bd7123c9c441eddfaeb4bdef +title: Comment Your JavaScript Code +challengeType: 1 +videoUrl: '' +localeTitle: تعليق كود جافاسكريبت الخاص بك +--- + +## Description +
التعليقات هي أسطر من التعليمات البرمجية التي ستتجاهلها JavaScript بشكل مقصود. تعتبر التعليقات طريقة رائعة لترك ملاحظاتك لنفسك وللأشخاص الآخرين الذين سيحتاجون لاحقًا لمعرفة ما يفعله هذا الرمز. هناك طريقتان لكتابة التعليقات في جافا سكريبت: سيخبر استخدام // جافا سكريبت JavaScript لتجاهل الجزء المتبقي من النص في السطر الحالي:
// هذا تعليق مباشر.
يمكنك إنشاء تعليق متعدد الأسطر يبدأ بـ /* وينتهي بـ */ :
/* هذا ال
تعليق متعدد الخطوط * /
افضل تمرين
أثناء كتابة التعليمة البرمجية ، يجب إضافة التعليقات بانتظام لتوضيح وظيفة أجزاء من التعليمات البرمجية. يمكن للتعليق الجيد أن يساعد في توصيل مقاصد رمزك - سواء بالنسبة للآخرين أو لمستقبلك.
+ +## Instructions +
حاول إنشاء واحد من كل نوع من التعليقات.
+ +## Tests +
+ +```yml +tests: + - text: أنشئ تعليقًا بنمط // يحتوي على خمس رسائل على الأقل. + testString: 'assert(code.match(/(\/\/)...../g), "Create a // style comment that contains at least five letters.");' + - text: أنشئ تعليقًا بنمط /* */ يحتوي على خمس رسائل على الأقل. + testString: 'assert(code.match(/(\/\*)([^\/]{5,})(?=\*\/)/gm), "Create a /* */ style comment that contains at least five letters.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-equality-operator.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-equality-operator.arabic.md new file mode 100644 index 0000000000..933f60864b --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-equality-operator.arabic.md @@ -0,0 +1,64 @@ +--- +id: 56533eb9ac21ba0edf2244d0 +title: Comparison with the Equality Operator +challengeType: 1 +videoUrl: '' +localeTitle: مقارنة مع مشغل المساواة +--- + +## Description +
هناك العديد من مشغلي المقارنة في JavaScript. كل هذه العوامل إرجاع منطقية true أو false القيمة. المشغل الأساسي هو مشغل المساواة == . يقارن عامل المساواة بين قيمتين ويعرض true إذا كانت مكافئة أو false إذا لم تكن كذلك. لاحظ أن المساواة تختلف عن الواجب ( = ) ، الذي يعين القيمة على يمين المشغل إلى متغير في اليسار.
الوظيفة equalestTest (myVal) {
if (myVal == 10) {
العودة "يساوي" ؛
}
"لا يساوي"؛
}
إذا كانت myVal تساوي 10 ، myVal عامل التساوي true ، لذا سيتم تنفيذ الشفرة في الأقواس المتعرجة ، وستعرض الدالة "Equal" . خلاف ذلك ، ستقوم الدالة بإرجاع "Not Equal" . لكي تتمكن JavaScript من مقارنة نوعين مختلفين من data types (على سبيل المثال ، numbers strings ) ، يجب أن تقوم بتحويل نوع واحد إلى آخر. هذا هو المعروف باسم "نوع الإكراه". وبمجرد الانتهاء من ذلك ، يمكن مقارنة الشروط كما يلي:
1 == 1 // true
1 == 2 // false
1 == '1' // true
"3" == 3 // true
+ +## Instructions +
أضف equality operator إلى الخط المحدد بحيث تقوم الدالة بإرجاع "Equal" عندما يكون val مساويًا لـ 12
+ +## Tests +
+ +```yml +tests: + - text: testEqual(10) يجب أن ترجع "غير مساوي" + testString: 'assert(testEqual(10) === "Not Equal", "testEqual(10) should return "Not Equal"");' + - text: testEqual(12) يجب أن ترجع "Equal" + testString: 'assert(testEqual(12) === "Equal", "testEqual(12) should return "Equal"");' + - text: testEqual("12") إرجاع "Equal" + testString: 'assert(testEqual("12") === "Equal", "testEqual("12") should return "Equal"");' + - text: يجب عليك استخدام عامل التشغيل == + testString: 'assert(code.match(/==/g) && !code.match(/===/g), "You should use the == operator");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Setup +function testEqual(val) { + if (val) { // Change this line + return "Equal"; + } + return "Not Equal"; +} + +// Change this value to test +testEqual(10); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-greater-than-operator.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-greater-than-operator.arabic.md new file mode 100644 index 0000000000..9118202a67 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-greater-than-operator.arabic.md @@ -0,0 +1,76 @@ +--- +id: 56533eb9ac21ba0edf2244d4 +title: Comparison with the Greater Than Operator +challengeType: 1 +videoUrl: '' +localeTitle: مقارنة مع أكبر من المشغل +--- + +## Description +
أكبر من المشغل ( > ) يقارن قيم رقمين. إذا كان الرقم إلى اليسار أكبر من الرقم إلى اليمين ، فسيعود إلى true . خلاف ذلك ، فإنها ترجع false . مثل المشغل المساواة ، أكبر من المشغل سوف يحول أنواع البيانات من القيم في حين مقارنة. أمثلة
5> 3 // صحيح
7> '3' // true
2> 3 // false
'1'> 9 // false
+ +## Instructions +
إضافة greater than المشغل إلى الخطوط المشار إليها بحيث تكون عبارات العودة منطقية.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن testGreaterThan(0) "10 أو أقل" + testString: 'assert(testGreaterThan(0) === "10 or Under", "testGreaterThan(0) should return "10 or Under"");' + - text: testGreaterThan(10) إرجاع "10 أو أقل" + testString: 'assert(testGreaterThan(10) === "10 or Under", "testGreaterThan(10) should return "10 or Under"");' + - text: يجب أن ترجع testGreaterThan(11) "أكثر من 10" + testString: 'assert(testGreaterThan(11) === "Over 10", "testGreaterThan(11) should return "Over 10"");' + - text: testGreaterThan(99) إرجاع "أكثر من 10" + testString: 'assert(testGreaterThan(99) === "Over 10", "testGreaterThan(99) should return "Over 10"");' + - text: testGreaterThan(100) إرجاع "أكثر من 10" + testString: 'assert(testGreaterThan(100) === "Over 10", "testGreaterThan(100) should return "Over 10"");' + - text: testGreaterThan(101) إرجاع "أكثر من 100" + testString: 'assert(testGreaterThan(101) === "Over 100", "testGreaterThan(101) should return "Over 100"");' + - text: testGreaterThan(150) إرجاع "أكثر من 100" + testString: 'assert(testGreaterThan(150) === "Over 100", "testGreaterThan(150) should return "Over 100"");' + - text: يجب عليك استخدام > مشغل على الأقل مرتين + testString: 'assert(code.match(/val\s*>\s*("|")*\d+("|")*/g).length > 1, "You should use the > operator at least twice");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function testGreaterThan(val) { + if (val) { // Change this line + return "Over 100"; + } + + if (val) { // Change this line + return "Over 10"; + } + + return "10 or Under"; +} + +// Change this value to test +testGreaterThan(10); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-greater-than-or-equal-to-operator.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-greater-than-or-equal-to-operator.arabic.md new file mode 100644 index 0000000000..3e090929dc --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-greater-than-or-equal-to-operator.arabic.md @@ -0,0 +1,76 @@ +--- +id: 56533eb9ac21ba0edf2244d5 +title: Comparison with the Greater Than Or Equal To Operator +challengeType: 1 +videoUrl: '' +localeTitle: مقارنة مع أكبر من أو يساوي المشغل +--- + +## Description +
يقارن العامل greater than or equal to ( >= ) قيم رقمين. إذا كان الرقم إلى اليسار أكبر من أو يساوي الرقم إلى اليمين ، فإنه يُرجع true . خلاف ذلك ، فإنها ترجع false . مثل مشغل عامل المساواة ، فإن greater than or equal to المشغل سيقوم بتحويل أنواع البيانات أثناء المقارنة. أمثلة
6> = 6 // true
7> = '3' // true
2> = 3 // false
'7'> = 9 // false
+ +## Instructions +
إضافة greater than or equal to المشغل إلى الخطوط المشار إليها بحيث تكون عبارات العودة منطقية.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن testGreaterOrEqual(0) "أقل من 10" + testString: 'assert(testGreaterOrEqual(0) === "Less than 10", "testGreaterOrEqual(0) should return "Less than 10"");' + - text: testGreaterOrEqual(9) إرجاع "أقل من 10" + testString: 'assert(testGreaterOrEqual(9) === "Less than 10", "testGreaterOrEqual(9) should return "Less than 10"");' + - text: يجب أن testGreaterOrEqual(10) "10 أو أكثر" + testString: 'assert(testGreaterOrEqual(10) === "10 or Over", "testGreaterOrEqual(10) should return "10 or Over"");' + - text: testGreaterOrEqual(11) إرجاع "10 أو أكثر" + testString: 'assert(testGreaterOrEqual(11) === "10 or Over", "testGreaterOrEqual(11) should return "10 or Over"");' + - text: testGreaterOrEqual(19) إرجاع "10 أو أكثر" + testString: 'assert(testGreaterOrEqual(19) === "10 or Over", "testGreaterOrEqual(19) should return "10 or Over"");' + - text: يجب أن testGreaterOrEqual(100) "20 أو أكثر" + testString: 'assert(testGreaterOrEqual(100) === "20 or Over", "testGreaterOrEqual(100) should return "20 or Over"");' + - text: testGreaterOrEqual(21) إرجاع "20 أو أكثر" + testString: 'assert(testGreaterOrEqual(21) === "20 or Over", "testGreaterOrEqual(21) should return "20 or Over"");' + - text: يجب عليك استخدام >= عامل التشغيل على الأقل مرتين + testString: 'assert(code.match(/val\s*>=\s*("|")*\d+("|")*/g).length > 1, "You should use the >= operator at least twice");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function testGreaterOrEqual(val) { + if (val) { // Change this line + return "20 or Over"; + } + + if (val) { // Change this line + return "10 or Over"; + } + + return "Less than 10"; +} + +// Change this value to test +testGreaterOrEqual(10); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-inequality-operator.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-inequality-operator.arabic.md new file mode 100644 index 0000000000..b53a6e8e67 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-inequality-operator.arabic.md @@ -0,0 +1,68 @@ +--- +id: 56533eb9ac21ba0edf2244d2 +title: Comparison with the Inequality Operator +challengeType: 1 +videoUrl: '' +localeTitle: مقارنة مع مشغل عدم المساواة +--- + +## Description +
عامل عدم المساواة ( != ) هو عكس مشغل المساواة. يعني "غير متساوٍ" ويعيد false حيث أن المساواة ستعود true والعكس صحيح . وعلى غرار مشغل المساواة ، يقوم مشغل عدم المساواة بتحويل أنواع البيانات من القيم عند المقارنة. أمثلة
1! = 2 / صحيح
1! = "1" // false
1! = '1' // false
1! = true // false
0! = false // false
+ +## Instructions +
إضافة عامل عدم المساواة != في جملة if بحيث تقوم الدالة بإرجاع "غير مساوي" عندما لا يكون val مساوياً لـ 99
+ +## Tests +
+ +```yml +tests: + - text: testNotEqual(99) يجب أن ترجع "Equal" + testString: 'assert(testNotEqual(99) === "Equal", "testNotEqual(99) should return "Equal"");' + - text: testNotEqual("99") يجب أن يقوم بإرجاع "Equal" + testString: 'assert(testNotEqual("99") === "Equal", "testNotEqual("99") should return "Equal"");' + - text: يجب أن testNotEqual(12) "غير مساوي" + testString: 'assert(testNotEqual(12) === "Not Equal", "testNotEqual(12) should return "Not Equal"");' + - text: testNotEqual("12") "غير مساوي" + testString: 'assert(testNotEqual("12") === "Not Equal", "testNotEqual("12") should return "Not Equal"");' + - text: testNotEqual("bob") "غير مساوي" + testString: 'assert(testNotEqual("bob") === "Not Equal", "testNotEqual("bob") should return "Not Equal"");' + - text: يجب عليك استخدام != عامل التشغيل + testString: 'assert(code.match(/(?!!==)!=/), "You should use the != operator");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Setup +function testNotEqual(val) { + if (val) { // Change this line + return "Not Equal"; + } + return "Equal"; +} + +// Change this value to test +testNotEqual(10); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-less-than-operator.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-less-than-operator.arabic.md new file mode 100644 index 0000000000..a10d25a5ee --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-less-than-operator.arabic.md @@ -0,0 +1,74 @@ +--- +id: 56533eb9ac21ba0edf2244d6 +title: Comparison with the Less Than Operator +challengeType: 1 +videoUrl: '' +localeTitle: مقارنة مع أقل من المشغل +--- + +## Description +
يقارن أقل من المشغل ( < ) قيم رقمين. إذا كان الرقم إلى اليسار أقل من الرقم إلى اليمين ، فسيعود إلى الحالة true . خلاف ذلك ، فإنها ترجع false . مثل المشغل المساواة ، أقل من المشغل يحول أنواع البيانات أثناء مقارنة. أمثلة
2 <5 / صحيح
"3" <7 // صحيح
5 <5 // خاطئة
3 <2 // false
"8" <4 // كاذبة
+ +## Instructions +
إضافة less than المشغل إلى الخطوط المشار إليها بحيث تكون عبارات العودة منطقية.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن ترجع testLessThan(0) "تحت 25" + testString: 'assert(testLessThan(0) === "Under 25", "testLessThan(0) should return "Under 25"");' + - text: يجب أن ترجع testLessThan(24) "تحت 25" + testString: 'assert(testLessThan(24) === "Under 25", "testLessThan(24) should return "Under 25"");' + - text: يجب أن ترجع testLessThan(25) "تحت 55" + testString: 'assert(testLessThan(25) === "Under 55", "testLessThan(25) should return "Under 55"");' + - text: يجب أن ترجع testLessThan(54) "تحت 55" + testString: 'assert(testLessThan(54) === "Under 55", "testLessThan(54) should return "Under 55"");' + - text: testLessThan(55) إرجاع "55 أو أكثر" + testString: 'assert(testLessThan(55) === "55 or Over", "testLessThan(55) should return "55 or Over"");' + - text: يجب أن ترجع testLessThan(99) "55 أو أكثر" + testString: 'assert(testLessThan(99) === "55 or Over", "testLessThan(99) should return "55 or Over"");' + - text: يجب عليك استخدام < المشغل مرتين على الأقل + testString: 'assert(code.match(/val\s*<\s*("|")*\d+("|")*/g).length > 1, "You should use the < operator at least twice");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function testLessThan(val) { + if (val) { // Change this line + return "Under 25"; + } + + if (val) { // Change this line + return "Under 55"; + } + + return "55 or Over"; +} + +// Change this value to test +testLessThan(10); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-less-than-or-equal-to-operator.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-less-than-or-equal-to-operator.arabic.md new file mode 100644 index 0000000000..a5b3205508 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-less-than-or-equal-to-operator.arabic.md @@ -0,0 +1,76 @@ +--- +id: 56533eb9ac21ba0edf2244d7 +title: Comparison with the Less Than Or Equal To Operator +challengeType: 1 +videoUrl: '' +localeTitle: مقارنة مع أقل من أو يساوي المشغل +--- + +## Description +
يقارن less than or equal to المشغل ( <= ) قيم رقمين. إذا كان الرقم إلى اليسار أقل من أو يساوي الرقم إلى اليمين ، فسيعود إلى true . إذا كان الرقم الموجود على اليسار أكبر من الرقم الموجود على اليمين ، فسيعرض false . مثل مشغل المساواة ، less than or equal to تحويل أنواع البيانات. أمثلة
4 <= 5 // صحيح
"7" <= 7 // صحيح
5 <= 5 // صحيح
3 <= 2 // خطأ
"8" <= 4 // كاذبة
+ +## Instructions +
إضافة less than or equal to المشغل إلى الخطوط المشار إليها بحيث تكون عبارات العودة منطقية.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن ترجع testLessOrEqual(0) "Smaller Than أو Equal إلى 12" + testString: 'assert(testLessOrEqual(0) === "Smaller Than or Equal to 12", "testLessOrEqual(0) should return "Smaller Than or Equal to 12"");' + - text: يجب أن ترجع testLessOrEqual(11) "أصغر من أو يساوي إلى 12" + testString: 'assert(testLessOrEqual(11) === "Smaller Than or Equal to 12", "testLessOrEqual(11) should return "Smaller Than or Equal to 12"");' + - text: يجب أن ترجع testLessOrEqual(12) "Smaller Than أو Equal إلى 12" + testString: 'assert(testLessOrEqual(12) === "Smaller Than or Equal to 12", "testLessOrEqual(12) should return "Smaller Than or Equal to 12"");' + - text: يجب أن ترجع testLessOrEqual(23) "Smaller Than أو Equal إلى 24" + testString: 'assert(testLessOrEqual(23) === "Smaller Than or Equal to 24", "testLessOrEqual(23) should return "Smaller Than or Equal to 24"");' + - text: يجب أن ترجع testLessOrEqual(24) "Smaller Than أو Equal إلى 24" + testString: 'assert(testLessOrEqual(24) === "Smaller Than or Equal to 24", "testLessOrEqual(24) should return "Smaller Than or Equal to 24"");' + - text: يجب أن ترجع testLessOrEqual(25) "أكثر من 24" + testString: 'assert(testLessOrEqual(25) === "More Than 24", "testLessOrEqual(25) should return "More Than 24"");' + - text: يجب أن ترجع testLessOrEqual(55) "أكثر من 24" + testString: 'assert(testLessOrEqual(55) === "More Than 24", "testLessOrEqual(55) should return "More Than 24"");' + - text: يجب عليك استخدام <= عامل التشغيل على الأقل مرتين + testString: 'assert(code.match(/val\s*<=\s*("|")*\d+("|")*/g).length > 1, "You should use the <= operator at least twice");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function testLessOrEqual(val) { + if (val) { // Change this line + return "Smaller Than or Equal to 12"; + } + + if (val) { // Change this line + return "Smaller Than or Equal to 24"; + } + + return "More Than 24"; +} + +// Change this value to test +testLessOrEqual(10); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-equality-operator.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-equality-operator.arabic.md new file mode 100644 index 0000000000..d2b138d2e3 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-equality-operator.arabic.md @@ -0,0 +1,64 @@ +--- +id: 56533eb9ac21ba0edf2244d1 +title: Comparison with the Strict Equality Operator +challengeType: 1 +videoUrl: '' +localeTitle: مقارنة مع مشغل المساواة الصارمة +--- + +## Description +
المساواة === ( === ) هي نظير مشغل المساواة ( == ). ومع ذلك ، على عكس مشغل المساواة ، الذي يحاول تحويل كلتا القيمتين مقارنة بالنوع الشائع ، فإن مشغل المساواة الصارم لا يقوم بتحويل نوع. إذا كانت القيم التي يتم مقارنتها لها أنواع مختلفة ، فإنها تعتبر غير متساوية ، وسيعود المشغل الصارم للمساواة كاذبة. أمثلة
3 === 3 // true
3 === '3' // false
في المثال الثاني ، 3 هو نوع Number و '3' هو نوع String .
+ +## Instructions +
استخدم عامل التساوي الصارم في العبارة if بحيث تقوم الدالة بإرجاع "Equal" عندما تكون val تساوي تمامًا 7
+ +## Tests +
+ +```yml +tests: + - text: يجب أن ترجع testStrict(10) "غير مساوي" + testString: 'assert(testStrict(10) === "Not Equal", "testStrict(10) should return "Not Equal"");' + - text: testStrict(7) إرجاع "Equal" + testString: 'assert(testStrict(7) === "Equal", "testStrict(7) should return "Equal"");' + - text: testStrict("7") إرجاع "غير مساوي" + testString: 'assert(testStrict("7") === "Not Equal", "testStrict("7") should return "Not Equal"");' + - text: يجب عليك استخدام عامل التشغيل === + testString: 'assert(code.match(/(val\s*===\s*\d+)|(\d+\s*===\s*val)/g).length > 0, "You should use the === operator");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Setup +function testStrict(val) { + if (val) { // Change this line + return "Equal"; + } + return "Not Equal"; +} + +// Change this value to test +testStrict(10); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-inequality-operator.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-inequality-operator.arabic.md new file mode 100644 index 0000000000..6c98aae6d4 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-inequality-operator.arabic.md @@ -0,0 +1,71 @@ +--- +id: 56533eb9ac21ba0edf2244d3 +title: Comparison with the Strict Inequality Operator +challengeType: 1 +videoUrl: '' +localeTitle: مقارنة مع مشغل عدم المساواة الصارم +--- + +## Description +
إن عامل عدم المساواة الصارم ( !== ) هو المقابل المنطقي للمشغل الصارم للمساواة. ويعني "عدم التساوي في الدقة" ويعود false حيث تعود المساواة الصارمة إلى true والعكس صحيح . عدم المساواة الصارمة لن تقوم بتحويل أنواع البيانات. أمثلة
3! == 3 // false
3! == '3' // true
4! == 3 // صحيح
+ +## Instructions +
إضافة strict inequality operator إلى العبارة if بحيث تقوم الدالة بإرجاع "غير مساوي" عندما لا يكون val مساوياً تمامًا لـ 17
+ +## Tests +
+ +```yml +tests: + - text: testStrictNotEqual(17) إرجاع "مساواة" + testString: 'assert(testStrictNotEqual(17) === "Equal", "testStrictNotEqual(17) should return "Equal"");' + - text: testStrictNotEqual("17") "غير مساوي" + testString: 'assert(testStrictNotEqual("17") === "Not Equal", "testStrictNotEqual("17") should return "Not Equal"");' + - text: يجب أن testStrictNotEqual(12) "غير مساوي" + testString: 'assert(testStrictNotEqual(12) === "Not Equal", "testStrictNotEqual(12) should return "Not Equal"");' + - text: testStrictNotEqual("bob") "غير مساوي" + testString: 'assert(testStrictNotEqual("bob") === "Not Equal", "testStrictNotEqual("bob") should return "Not Equal"");' + - text: يجب عليك استخدام !== المشغل + testString: 'assert(code.match(/(val\s*!==\s*\d+)|(\d+\s*!==\s*val)/g).length > 0, "You should use the !== operator");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Setup +function testStrictNotEqual(val) { + // Only Change Code Below this Line + + if (val) { + + // Only Change Code Above this Line + + return "Not Equal"; + } + return "Equal"; +} + +// Change this value to test +testStrictNotEqual(10); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparisons-with-the-logical-and-operator.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparisons-with-the-logical-and-operator.arabic.md new file mode 100644 index 0000000000..a4b741e8e5 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparisons-with-the-logical-and-operator.arabic.md @@ -0,0 +1,81 @@ +--- +id: 56533eb9ac21ba0edf2244d8 +title: Comparisons with the Logical And Operator +challengeType: 1 +videoUrl: '' +localeTitle: مقارنات مع المنطقية والمشغل +--- + +## Description +
في بعض الأحيان ستحتاج إلى اختبار أكثر من شيء واحد في كل مرة. إرجاع المنطقية والمشغل ( && ) true إذا وفقط إذا كانت المعاملات إلى اليسار واليمين صحيحاً. يمكن تحقيق نفس التأثير بتضمين جملة if داخل أخرى إذا:
if (num> 5) {
إذا (عدد <10) {
العودة "نعم" ؛
}
}
العودة "لا" ؛
سيعود فقط "نعم" إذا num أكبر من 5 وأقل من 10 . نفس المنطق يمكن كتابته على النحو التالي:
if (num> 5 & num <10) {
العودة "نعم" ؛
}
العودة "لا" ؛
+ +## Instructions +
قم بدمج العبارة "if" في عبارة واحدة والتي ستُرجع "Yes" إذا كان val أقل من أو يساوي 50 وأكبر من أو يساوي 25 . خلاف ذلك ، سيعود "No" .
+ +## Tests +
+ +```yml +tests: + - text: يجب عليك استخدام مشغل && مرة واحدة + testString: 'assert(code.match(/&&/g).length === 1, "You should use the && operator once");' + - text: يجب أن يكون لديك واحد فقط if البيان + testString: 'assert(code.match(/if/g).length === 1, "You should only have one if statement");' + - text: يجب أن ترجع testLogicalAnd(0) "لا" + testString: 'assert(testLogicalAnd(0) === "No", "testLogicalAnd(0) should return "No"");' + - text: testLogicalAnd(24) يجب أن ترجع "لا" + testString: 'assert(testLogicalAnd(24) === "No", "testLogicalAnd(24) should return "No"");' + - text: testLogicalAnd(25) يجب أن ترجع "Yes" + testString: 'assert(testLogicalAnd(25) === "Yes", "testLogicalAnd(25) should return "Yes"");' + - text: يجب أن ترجع testLogicalAnd(30) "نعم" + testString: 'assert(testLogicalAnd(30) === "Yes", "testLogicalAnd(30) should return "Yes"");' + - text: يجب أن ترجع testLogicalAnd(50) "نعم" + testString: 'assert(testLogicalAnd(50) === "Yes", "testLogicalAnd(50) should return "Yes"");' + - text: testLogicalAnd(51) يجب أن ترجع "لا" + testString: 'assert(testLogicalAnd(51) === "No", "testLogicalAnd(51) should return "No"");' + - text: يجب أن testLogicalAnd(75) "لا" + testString: 'assert(testLogicalAnd(75) === "No", "testLogicalAnd(75) should return "No"");' + - text: testLogicalAnd(80) يجب أن ترجع "لا" + testString: 'assert(testLogicalAnd(80) === "No", "testLogicalAnd(80) should return "No"");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function testLogicalAnd(val) { + // Only change code below this line + + if (val) { + if (val) { + return "Yes"; + } + } + + // Only change code above this line + return "No"; +} + +// Change this value to test +testLogicalAnd(10); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparisons-with-the-logical-or-operator.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparisons-with-the-logical-or-operator.arabic.md new file mode 100644 index 0000000000..0ae38ebbac --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparisons-with-the-logical-or-operator.arabic.md @@ -0,0 +1,83 @@ +--- +id: 56533eb9ac21ba0edf2244d9 +title: Comparisons with the Logical Or Operator +challengeType: 1 +videoUrl: '' +localeTitle: مقارنات مع المنطقي أو المشغل +--- + +## Description +
إرجاع المنطقية أو عامل التشغيل ( || ) true إذا كان أي من المعاملات true . خلاف ذلك ، فإنها ترجع false . المنطقي أو المشغل يتكون من اثنين من رموز الأنبوب ( | ). يمكن العثور على ذلك عادةً بين مفتاحي Backspace و Enter. يجب أن يبدو النمط أدناه مألوفًا من نقاط الطريق السابقة:
if (num> 10) {
العودة "لا" ؛
}
إذا (عدد <5) {
العودة "لا" ؛
}
العودة "نعم" ؛
سيعود "نعم" إلا إذا num ما بين 5 و 10 (5 و 10 مدرجة). نفس المنطق يمكن كتابته على النحو التالي:
if (num> 10 || num <5) {
العودة "لا" ؛
}
العودة "نعم" ؛
+ +## Instructions +
اجمع بين العبارة " if في عبارة واحدة والتي تُرجع "Outside" إذا لم يكن val ما بين 10 و 20 ضمناً. خلاف ذلك ، والعودة "Inside" .
+ +## Tests +
+ +```yml +tests: + - text: يجب عليك استخدام || عامل مرة واحدة + testString: 'assert(code.match(/\|\|/g).length === 1, "You should use the || operator once");' + - text: يجب أن يكون لديك واحد فقط if البيان + testString: 'assert(code.match(/if/g).length === 1, "You should only have one if statement");' + - text: يجب أن ترجع testLogicalOr(0) "خارج" + testString: 'assert(testLogicalOr(0) === "Outside", "testLogicalOr(0) should return "Outside"");' + - text: يجب أن ترجع testLogicalOr(9) "خارج" + testString: 'assert(testLogicalOr(9) === "Outside", "testLogicalOr(9) should return "Outside"");' + - text: testLogicalOr(10) إرجاع "Inside" + testString: 'assert(testLogicalOr(10) === "Inside", "testLogicalOr(10) should return "Inside"");' + - text: testLogicalOr(15) إرجاع "Inside" + testString: 'assert(testLogicalOr(15) === "Inside", "testLogicalOr(15) should return "Inside"");' + - text: testLogicalOr(19) إرجاع "Inside" + testString: 'assert(testLogicalOr(19) === "Inside", "testLogicalOr(19) should return "Inside"");' + - text: testLogicalOr(20) إرجاع "Inside" + testString: 'assert(testLogicalOr(20) === "Inside", "testLogicalOr(20) should return "Inside"");' + - text: يجب أن ترجع testLogicalOr(21) "خارج" + testString: 'assert(testLogicalOr(21) === "Outside", "testLogicalOr(21) should return "Outside"");' + - text: يجب أن ترجع testLogicalOr(25) "خارج" + testString: 'assert(testLogicalOr(25) === "Outside", "testLogicalOr(25) should return "Outside"");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function testLogicalOr(val) { + // Only change code below this line + + if (val) { + return "Outside"; + } + + if (val) { + return "Outside"; + } + + // Only change code above this line + return "Inside"; +} + +// Change this value to test +testLogicalOr(15); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-addition.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-addition.arabic.md new file mode 100644 index 0000000000..bb116951ae --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-addition.arabic.md @@ -0,0 +1,73 @@ +--- +id: 56533eb9ac21ba0edf2244af +title: Compound Assignment With Augmented Addition +challengeType: 1 +videoUrl: '' +localeTitle: مهمة مركبة مع إضافة مضافة +--- + +## Description +
في البرمجة ، من الشائع استخدام التعيينات لتعديل محتويات المتغير. تذكر أن كل شيء على يمين علامة المساواة يتم تقييمه أولاً ، حتى يمكننا قول: myVar = myVar + 5; لإضافة 5 إلى myVar . بما أن هذا هو النمط الشائع ، فهناك مشغلين يقومون بعملية رياضية وتعيين في خطوة واحدة. أحد هذه المشغلات هو عامل += .
var myVar = 1 ،
myVar + = 5؛
console.log (myVar)؛ // إرجاع 6
+ +## Instructions +
قم بتحويل التعيينات لـ a و b و c لاستخدام += عامل التشغيل.
+ +## Tests +
+ +```yml +tests: + - text: a يجب أن يساوي 15 + testString: 'assert(a === 15, "a should equal 15");' + - text: b يجب أن تساوي 26 + testString: 'assert(b === 26, "b should equal 26");' + - text: c يجب أن تساوي 19 + testString: 'assert(c === 19, "c should equal 19");' + - text: يجب عليك استخدام += عامل لكل متغير + testString: 'assert(code.match(/\+=/g).length === 3, "You should use the += operator for each variable");' + - text: لا تعدّل الشفرة فوق الخط + testString: 'assert(/var a = 3;/.test(code) && /var b = 17;/.test(code) && /var c = 12;/.test(code), "Do not modify the code above the line");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +var a = 3; +var b = 17; +var c = 12; + +// Only modify code below this line + +a = a + 12; +b = 9 + b; +c = c + 7; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-division.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-division.arabic.md new file mode 100644 index 0000000000..9d165d7ee7 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-division.arabic.md @@ -0,0 +1,73 @@ +--- +id: 56533eb9ac21ba0edf2244b2 +title: Compound Assignment With Augmented Division +challengeType: 1 +videoUrl: '' +localeTitle: تكليف مركب مع قسم معزز +--- + +## Description +
يقوم عامل التشغيل /= بتقسيم متغير برقم آخر. myVar = myVar / 5; سوف يقسم myVar بنسبة 5 . يمكن إعادة كتابة هذا كـ: myVar /= 5;
+ +## Instructions +
قم بتحويل التعيينات لـ a و b و c لاستخدام /= operator.
+ +## Tests +
+ +```yml +tests: + - text: a يجب أن يساوي 4 + testString: 'assert(a === 4, "a should equal 4");' + - text: b يجب أن تساوي 27 + testString: 'assert(b === 27, "b should equal 27");' + - text: c يجب أن يساوي 3 + testString: 'assert(c === 3, "c should equal 3");' + - text: يجب عليك استخدام عامل التشغيل /= لكل متغير + testString: 'assert(code.match(/\/=/g).length === 3, "You should use the /= operator for each variable");' + - text: لا تعدّل الشفرة فوق الخط + testString: 'assert(/var a = 48;/.test(code) && /var b = 108;/.test(code) && /var c = 33;/.test(code), "Do not modify the code above the line");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +var a = 48; +var b = 108; +var c = 33; + +// Only modify code below this line + +a = a / 12; +b = b / 4; +c = c / 11; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-multiplication.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-multiplication.arabic.md new file mode 100644 index 0000000000..b9458251d0 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-multiplication.arabic.md @@ -0,0 +1,73 @@ +--- +id: 56533eb9ac21ba0edf2244b1 +title: Compound Assignment With Augmented Multiplication +challengeType: 1 +videoUrl: '' +localeTitle: مهمة مركبة مع تكاثر مضاعف +--- + +## Description +
يقوم عامل التشغيل *= بضرب متغير برقم. myVar = myVar * 5; سوف تضاعف myVar بنسبة 5 . يمكن إعادة كتابة هذا كـ: myVar *= 5;
+ +## Instructions +
قم بتحويل التعيينات لـ a و b و c لاستخدام *= operator.
+ +## Tests +
+ +```yml +tests: + - text: a يجب أن يساوي 25 + testString: 'assert(a === 25, "a should equal 25");' + - text: b يجب أن تساوي 36 + testString: 'assert(b === 36, "b should equal 36");' + - text: c يجب أن تساوي 46 + testString: 'assert(c === 46, "c should equal 46");' + - text: يجب عليك استخدام عامل التشغيل *= لكل متغير + testString: 'assert(code.match(/\*=/g).length === 3, "You should use the *= operator for each variable");' + - text: لا تعدّل الشفرة فوق الخط + testString: 'assert(/var a = 5;/.test(code) && /var b = 12;/.test(code) && /var c = 4\.6;/.test(code), "Do not modify the code above the line");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +var a = 5; +var b = 12; +var c = 4.6; + +// Only modify code below this line + +a = a * 5; +b = 3 * b; +c = c * 10; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-subtraction.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-subtraction.arabic.md new file mode 100644 index 0000000000..fea3cbc24a --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-subtraction.arabic.md @@ -0,0 +1,73 @@ +--- +id: 56533eb9ac21ba0edf2244b0 +title: Compound Assignment With Augmented Subtraction +challengeType: 1 +videoUrl: '' +localeTitle: مهمة مركبة مع الطرح المعزز +--- + +## Description +
مثل += عامل التشغيل ، -= طرح عدد من متغير. myVar = myVar - 5; سوف طرح 5 من myVar . يمكن إعادة كتابة هذا كـ: myVar -= 5;
+ +## Instructions +
قم بتحويل التعيينات لـ a و b و c لاستخدام عامل التشغيل -= .
+ +## Tests +
+ +```yml +tests: + - text: a يجب أن يساوي 5 + testString: 'assert(a === 5, "a should equal 5");' + - text: b ينبغي أن تساوي -6 + testString: 'assert(b === -6, "b should equal -6");' + - text: c يجب أن تساوي 2 + testString: 'assert(c === 2, "c should equal 2");' + - text: يجب عليك استخدام -= عامل لكل متغير + testString: 'assert(code.match(/-=/g).length === 3, "You should use the -= operator for each variable");' + - text: لا تعدّل الشفرة فوق الخط + testString: 'assert(/var a = 11;/.test(code) && /var b = 9;/.test(code) && /var c = 3;/.test(code), "Do not modify the code above the line");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +var a = 11; +var b = 9; +var c = 3; + +// Only modify code below this line + +a = a - 6; +b = b - 15; +c = c - 1; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/concatenating-strings-with-plus-operator.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/concatenating-strings-with-plus-operator.arabic.md new file mode 100644 index 0000000000..96a796e0a6 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/concatenating-strings-with-plus-operator.arabic.md @@ -0,0 +1,68 @@ +--- +id: 56533eb9ac21ba0edf2244b7 +title: Concatenating Strings with Plus Operator +challengeType: 1 +videoUrl: '' +localeTitle: سلاسل متسلسلة مع Plus Operator +--- + +## Description +
في JavaScript ، عندما يتم استخدام عامل التشغيل + مع قيمة String ، يطلق عليه عامل التشغيل السلسة . يمكنك إنشاء سلسلة جديدة خارج السلاسل الأخرى عن طريق وصلها معًا. مثال
"اسمي ألان ،" + "أنا سلسلته".
ملحوظة
احترس من المساحات. لا يضيف Concatenation فراغات بين السلاسل المتسلسلة ، لذا ستحتاج إلى إضافتها بنفسك.
+ +## Instructions +
بناء myStr من السلاسل "This is the start. " و "This is the end." باستخدام عامل + .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون لـ myStr قيمة This is the start. This is the end. + testString: 'assert(myStr === "This is the start. This is the end.", "myStr should have a value of This is the start. This is the end.");' + - text: استخدم عامل التشغيل + لبناء myStr + testString: 'assert(code.match(/([""]).*([""])\s*\+\s*([""]).*([""])/g).length > 1, "Use the + operator to build myStr");' + - text: يجب إنشاء myStr باستخدام الكلمة الرئيسية var . + testString: 'assert(/var\s+myStr/.test(code), "myStr should be created using the var keyword.");' + - text: تأكد من تعيين النتيجة لمتغير myStr . + testString: 'assert(/myStr\s*=/.test(code), "Make sure to assign the result to the myStr variable.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var ourStr = "I come first. " + "I come second."; + +// Only change code below this line + +var myStr; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/concatenating-strings-with-the-plus-equals-operator.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/concatenating-strings-with-the-plus-equals-operator.arabic.md new file mode 100644 index 0000000000..e43f306f00 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/concatenating-strings-with-the-plus-equals-operator.arabic.md @@ -0,0 +1,65 @@ +--- +id: 56533eb9ac21ba0edf2244b8 +title: Concatenating Strings with the Plus Equals Operator +challengeType: 1 +videoUrl: '' +localeTitle: سلاسل متسلسلة مع Plus Equals Operator +--- + +## Description +
يمكننا أيضًا استخدام += operator لسَلسَلة سلسلة في نهاية متغير سلسلة موجود. يمكن أن يكون هذا مفيدًا جدًا لكسر سلسلة طويلة عبر عدة أسطر. ملحوظة
احترس من المساحات. لا يضيف Concatenation فراغات بين السلاسل المتسلسلة ، لذا ستحتاج إلى إضافتها بنفسك.
+ +## Instructions +
إنشاء myStr عبر عدة سطور عن طريق وصل هاتين السلسلتين: "This is the first sentence. " و "This is the second sentence." باستخدام += عامل التشغيل. استخدم += عامل مشابه لكيفية ظهوره في المحرر. ابدأ بتخصيص السلسلة الأولى إلى myStr ، ثم أضفها في السلسلة الثانية.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون لـ myStr قيمة This is the first sentence. This is the second sentence. + testString: 'assert(myStr === "This is the first sentence. This is the second sentence.", "myStr should have a value of This is the first sentence. This is the second sentence.");' + - text: استخدم += عامل لبناء myStr + testString: 'assert(code.match(/\w\s*\+=\s*[""]/g).length > 1 && code.match(/\w\s*\=\s*[""]/g).length > 1, "Use the += operator to build myStr");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var ourStr = "I come first. "; +ourStr += "I come second."; + +// Only change code below this line + +var myStr; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/constructing-strings-with-variables.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/constructing-strings-with-variables.arabic.md new file mode 100644 index 0000000000..54bea91d47 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/constructing-strings-with-variables.arabic.md @@ -0,0 +1,65 @@ +--- +id: 56533eb9ac21ba0edf2244b9 +title: Constructing Strings with Variables +challengeType: 1 +videoUrl: '' +localeTitle: بناء سلاسل مع المتغيرات +--- + +## Description +
في بعض الأحيان سوف تحتاج إلى بناء سلسلة ، نمط Mad Libs . باستخدام عامل التشغيل السلسة ( + ) ، يمكنك إدراج متغير واحد أو أكثر في سلسلة تقوم ببنائها.
+ +## Instructions +
تعيين myName إلى سلسلة يساوي اسمك وبناء myStr مع myName بين الجمل "My name is " و " and I am well!"
+ +## Tests +
+ +```yml +tests: + - text: يجب تعيين myName إلى سلسلة لا تقل عن 3 أحرف + testString: 'assert(typeof myName !== "undefined" && myName.length > 2, "myName should be set to a string at least 3 characters long");' + - text: استخدام اثنين + المشغلين لبناء myStr مع myName داخله + testString: 'assert(code.match(/[""]\s*\+\s*myName\s*\+\s*[""]/g).length > 0, "Use two + operators to build myStr with myName inside it");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var ourName = "freeCodeCamp"; +var ourStr = "Hello, our name is " + ourName + ", how are you?"; + +// Only change code below this line +var myName; +var myStr; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/count-backwards-with-a-for-loop.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/count-backwards-with-a-for-loop.arabic.md new file mode 100644 index 0000000000..67c94755ff --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/count-backwards-with-a-for-loop.arabic.md @@ -0,0 +1,71 @@ +--- +id: 56105e7b514f539506016a5e +title: Count Backwards With a For Loop +challengeType: 1 +videoUrl: '' +localeTitle: عد إلى الخلف مع ل حلقة +--- + +## Description +
يمكن أيضًا حساب العروة للخلف ، طالما أننا نستطيع تحديد الشروط الصحيحة. من أجل احتساب العكسيتين بعلامة twos ، سنحتاج إلى تغيير initialization condition final-expression . سنبدأ عند i = 10 والحلقة بينما i > 0 . سنقوم decrement i كل حلقة 2 مع i -= 2 .
var ourArray = []؛
for (var i = 10؛ i> 0؛ i- = 2) {
ourArray.push (ط)؛
}
ourArray الآن [10,8,6,4,2] . دعونا نغير initialization final-expression حتى نتمكن من العد إلى الوراء من خلال الاثنتين بالأرقام الفردية.
+ +## Instructions +
ادفع الأرقام الفردية من 9 إلى 1 إلى myArray باستخدام حلقة for .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تكون باستخدام for حلقة لهذا الغرض. + testString: 'assert(code.match(/for\s*\(/g).length > 1, "You should be using a for loop for this.");' + - text: يجب أن تستخدم push طريقة الصفيف. + testString: 'assert(code.match(/myArray.push/), "You should be using the array method push.");' + - text: 'myArray ينبغي أن تساوي [9,7,5,3,1] .' + testString: 'assert.deepEqual(myArray, [9,7,5,3,1], "myArray should equal [9,7,5,3,1].");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var ourArray = []; + +for (var i = 10; i > 0; i -= 2) { + ourArray.push(i); +} + +// Setup +var myArray = []; + +// Only change code below this line. + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/counting-cards.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/counting-cards.arabic.md new file mode 100644 index 0000000000..4c16fbd9a1 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/counting-cards.arabic.md @@ -0,0 +1,74 @@ +--- +id: 565bbe00e9cc8ac0725390f4 +title: Counting Cards +challengeType: 1 +videoUrl: '' +localeTitle: عد بطاقات +--- + +## Description +
في لعبة الكازينو Blackjack ، يمكن للاعب الحصول على ميزة على المنزل من خلال تتبع العدد النسبي للبطاقات العالية والمنخفضة المتبقية في سطح السفينة. وهذا ما يسمى حساب البطاقة . وجود المزيد من البطاقات العالية المتبقية في سطح السفينة تفضل اللاعب. يتم تعيين قيمة لكل بطاقة وفقًا للجدول أدناه. عندما يكون العد موجبًا ، يجب أن يراهن اللاعب عالياً. عندما يكون العدد صفرًا أو سلبيًا ، يجب على اللاعب الرهان منخفضًا.
عد التغيير بطاقات
+1 2 و 3 و 4 و 5 و 6
0 7 و 8 و 9
-1 10 ، 'J' ، 'Q' ، 'K' ، 'A'
ستكتب وظيفة حساب البطاقة. سيحصل على معلمة card ، والتي يمكن أن تكون رقمًا أو سلسلة ، وزيادة أو إنقاص متغير count العالمي وفقًا لقيمة البطاقة (انظر الجدول). ستقوم الدالة بعد ذلك بإرجاع سلسلة مع العدد الحالي وسلسلة Bet إذا كان العدد موجبًا ، أو Hold إذا كان العدد صفراً أو سالباً. يجب فصل العدد الحالي وقرار اللاعب ( Bet أو Hold ) بمسافة واحدة. ناتج المثال
-3 Hold
5 Bet تلميح 5 Bet
لا تقم بإعادة تعيين count إلى 0 عندما تكون القيمة 7 أو 8 أو 9.
لا ترجع مصفوفة.
لا تقم بتضمين علامات الاقتباس (مفردة أو مزدوجة) في الإخراج.
+ +## Instructions +
+
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تعود تسلسلات البطاقات 2 و 3 و 4 و 5 و 6 إلى 5 Bet + testString: 'assert((function(){ count = 0; cc(2);cc(3);cc(4);cc(5);var out = cc(6); if(out === "5 Bet") {return true;} return false; })(), "Cards Sequence 2, 3, 4, 5, 6 should return 5 Bet");' + - text: يجب أن تعود تسلسلات البطاقات 7 و 8 و 9 0 Hold + testString: 'assert((function(){ count = 0; cc(7);cc(8);var out = cc(9); if(out === "0 Hold") {return true;} return false; })(), "Cards Sequence 7, 8, 9 should return 0 Hold");' + - text: يجب أن تعود تسلسلات البطاقات 10 و J و Q و K و A إلى -5 Hold + testString: 'assert((function(){ count = 0; cc(10);cc("J");cc("Q");cc("K");var out = cc("A"); if(out === "-5 Hold") {return true;} return false; })(), "Cards Sequence 10, J, Q, K, A should return -5 Hold");' + - text: يجب أن تعود تسلسلات البطاقات 3 و 7 و Q و 8 و A إلى -1 Hold + testString: 'assert((function(){ count = 0; cc(3);cc(7);cc("Q");cc(8);var out = cc("A"); if(out === "-1 Hold") {return true;} return false; })(), "Cards Sequence 3, 7, Q, 8, A should return -1 Hold");' + - text: يجب أن تعيد بطاقات التسلسل 2 ، J ، 9 ، 2 ، 7 1 Bet + testString: 'assert((function(){ count = 0; cc(2);cc("J");cc(9);cc(2);var out = cc(7); if(out === "1 Bet") {return true;} return false; })(), "Cards Sequence 2, J, 9, 2, 7 should return 1 Bet");' + - text: يجب أن تعيد بطاقات التسلسل 2 و 2 و 10 1 Bet + testString: 'assert((function(){ count = 0; cc(2);cc(2);var out = cc(10); if(out === "1 Bet") {return true;} return false; })(), "Cards Sequence 2, 2, 10 should return 1 Bet");' + - text: يجب أن تعود تسلسلات البطاقات 3 ، 2 ، A ، 10 ، K -1 Hold + testString: 'assert((function(){ count = 0; cc(3);cc(2);cc("A");cc(10);var out = cc("K"); if(out === "-1 Hold") {return true;} return false; })(), "Cards Sequence 3, 2, A, 10, K should return -1 Hold");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +var count = 0; + +function cc(card) { + // Only change code below this line + + + return "Change Me"; + // Only change code above this line +} + +// Add/remove calls to test your function. +// Note: Only the last will display +cc(2); cc(3); cc(7); cc('K'); cc('A'); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/create-decimal-numbers-with-javascript.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/create-decimal-numbers-with-javascript.arabic.md new file mode 100644 index 0000000000..674f5ea830 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/create-decimal-numbers-with-javascript.arabic.md @@ -0,0 +1,61 @@ +--- +id: cf1391c1c11feddfaeb4bdef +title: Create Decimal Numbers with JavaScript +challengeType: 1 +videoUrl: '' +localeTitle: قم بإنشاء أرقام عشرية باستخدام جافا سكريبت +--- + +## Description +
يمكننا تخزين الأرقام العشرية في المتغيرات أيضًا. ويشار إلى الأرقام العشرية في بعض الأحيان باسم أرقام النقطة العائمة أو العوامات . ملحوظة
لا يمكن تمثيل جميع الأرقام الحقيقية بدقة في نقطة عائمة . هذا يمكن أن يؤدي إلى أخطاء التقريب. التفاصيل هنا .
+ +## Instructions +
إنشاء متغير myDecimal وإعطائه قيمة عشرية مع جزء كسري (على سبيل المثال 5.7 ).
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون myDecimal رقمًا. + testString: 'assert(typeof myDecimal === "number", "myDecimal should be a number.");' + - text: myDecimal يجب أن يكون لديك myDecimal العشرية + testString: 'assert(myDecimal % 1 != 0, "myDecimal should have a decimal point"); ' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +var ourDecimal = 5.7; + +// Only change code below this line + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/declare-javascript-variables.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/declare-javascript-variables.arabic.md new file mode 100644 index 0000000000..b3fae3ff13 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/declare-javascript-variables.arabic.md @@ -0,0 +1,60 @@ +--- +id: bd7123c9c443eddfaeb5bdef +title: Declare JavaScript Variables +challengeType: 1 +videoUrl: '' +localeTitle: تحديد متغيرات جافا سكريبت +--- + +## Description +
في علم الكمبيوتر ، البيانات هي أي شيء مفيد للكمبيوتر. يوفر JavaScript سبعة أنواع بيانات مختلفة undefined ، null ، boolean ، string ، symbol ، number ، object . على سبيل المثال ، تميز أجهزة الكمبيوتر بين الأرقام ، مثل الرقم 12 ، strings ، مثل "12" أو "dog" أو "123 cats" ، وهي مجموعات من الأحرف. يمكن لأجهزة الكمبيوتر إجراء العمليات الحسابية على عدد ، ولكن ليس على سلسلة. تسمح المتغيرات لأجهزة الكمبيوتر بتخزين البيانات ومعالجتها بطريقة ديناميكية. يفعلون ذلك باستخدام "تسمية" للإشارة إلى البيانات بدلاً من استخدام البيانات نفسها. يمكن تخزين أي من أنواع البيانات السبعة في متغير. تشبه Variables x و y التي تستخدمها في الرياضيات ، مما يعني أنها اسم بسيط لتمثيل البيانات التي نريد الرجوع إليها. تختلف variables الكمبيوتر عن variables الرياضية في أنها يمكن أن تخزن قيمًا مختلفة في أوقات مختلفة. نقول جافا سكريبت لإنشاء أو تعريف متغير عن طريق وضع الكلمة var أمامه، كما يلي:
var ourName؛
يخلق variable يسمى ourName . في جافا سكريبت ، ننتهي من العبارات بفواصل منقوطة. يمكن أن تتكون أسماء Variable من أرقام وأحرف و $ أو _ ، لكن قد لا تحتوي على مسافات أو تبدأ برقم.
+ +## Instructions +
استخدم الكلمة الأساسية var لإنشاء متغير يسمى myName . ملحوظة
انظر إلى مثال ourName إذا واجهتك ourName .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تعلن myName مع الكلمة الرئيسية var ، وتنتهي بفاصلة منقوطة + testString: 'assert(/var\s+myName\s*;/.test(code), "You should declare myName with the var keyword, ending with a semicolon");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var ourName; + +// Declare myName below this line + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/declare-string-variables.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/declare-string-variables.arabic.md new file mode 100644 index 0000000000..619393139c --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/declare-string-variables.arabic.md @@ -0,0 +1,63 @@ +--- +id: bd7123c9c444eddfaeb5bdef +title: Declare String Variables +challengeType: 1 +videoUrl: '' +localeTitle: تعبير سلسلة المتغيرات +--- + +## Description +
سبق لنا استخدام الرمز var myName = "your name"; يسمى "your name" سلسلة حرفية . وهي سلسلة لأنها عبارة عن سلسلة من صفر أو أكثر من الأحرف محاطة بعلامات اقتباس مفردة أو مزدوجة.
+ +## Instructions +
إنشاء اثنين الجديدة string المتغيرات: myFirstName و myLastName وتعيينها القيم من الاسم الأول والأخير، على التوالي.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون myFirstName عبارة عن سلسلة بها حرف واحد على الأقل. + testString: 'assert((function(){if(typeof myFirstName !== "undefined" && typeof myFirstName === "string" && myFirstName.length > 0){return true;}else{return false;}})(), "myFirstName should be a string with at least one character in it.");' + - text: يجب أن يكون myLastName عبارة عن سلسلة بها حرف واحد على الأقل. + testString: 'assert((function(){if(typeof myLastName !== "undefined" && typeof myLastName === "string" && myLastName.length > 0){return true;}else{return false;}})(), "myLastName should be a string with at least one character in it.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var firstName = "Alan"; +var lastName = "Turing"; + +// Only change code below this line + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/decrement-a-number-with-javascript.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/decrement-a-number-with-javascript.arabic.md new file mode 100644 index 0000000000..c9e9aa68df --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/decrement-a-number-with-javascript.arabic.md @@ -0,0 +1,66 @@ +--- +id: 56533eb9ac21ba0edf2244ad +title: Decrement a Number with JavaScript +challengeType: 1 +videoUrl: '' +localeTitle: إنقاص رقم مع JavaScript +--- + +## Description +
يمكنك بسهولة إنقاص أو إنقاص متغير بواحد مع -- المشغل. i--; يعادل i = i - 1; ملحوظة
يصبح الخط بأكمله i--; ، مما يلغي الحاجة إلى علامة المساواة.
+ +## Instructions +
تغيير الرمز لاستخدام -- المشغل على myVar .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يساوي myVar 10 + testString: 'assert(myVar === 10, "myVar should equal 10");' + - text: myVar = myVar - 1; يجب تغييرها + testString: 'assert(/var\s*myVar\s*=\s*11;\s*\/*.*\s*([-]{2}\s*myVar|myVar\s*[-]{2});/.test(code), "myVar = myVar - 1; should be changed");' + - text: استخدم -- المشغل على myVar + testString: 'assert(/[-]{2}\s*myVar|myVar\s*[-]{2}/.test(code), "Use the -- operator on myVar");' + - text: لا تغير الكود فوق الخط + testString: 'assert(/var myVar = 11;/.test(code), "Do not change code above the line");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +var myVar = 11; + +// Only change code below this line +myVar = myVar - 1; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/delete-properties-from-a-javascript-object.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/delete-properties-from-a-javascript-object.arabic.md new file mode 100644 index 0000000000..a1be9d5633 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/delete-properties-from-a-javascript-object.arabic.md @@ -0,0 +1,79 @@ +--- +id: 56bbb991ad1ed5201cd392d3 +title: Delete Properties from a JavaScript Object +challengeType: 1 +videoUrl: '' +localeTitle: حذف الخصائص من كائن JavaScript +--- + +## Description +
يمكننا أيضًا حذف خصائص من كائنات مثل: delete ourDog.bark;
+ +## Instructions +
حذف خاصية "tails" من myDog . يمكنك استخدام أي نقطة أو تدوين قوس.
+ +## Tests +
+ +```yml +tests: + - text: حذف الخاصية "tails" من myDog . + testString: 'assert(typeof myDog === "object" && myDog.tails === undefined, "Delete the property "tails" from myDog.");' + - text: لا تقم بتعديل إعداد myDog + testString: 'assert(code.match(/"tails": 1/g).length > 1, "Do not modify the myDog setup");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var ourDog = { + "name": "Camper", + "legs": 4, + "tails": 1, + "friends": ["everything!"], + "bark": "bow-wow" +}; + +delete ourDog.bark; + +// Setup +var myDog = { + "name": "Happy Coder", + "legs": 4, + "tails": 1, + "friends": ["freeCodeCamp Campers"], + "bark": "woof" +}; + +// Only change code below this line. + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/divide-one-decimal-by-another-with-javascript.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/divide-one-decimal-by-another-with-javascript.arabic.md new file mode 100644 index 0000000000..66e6f4e5d0 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/divide-one-decimal-by-another-with-javascript.arabic.md @@ -0,0 +1,61 @@ +--- +id: bd7993c9ca9feddfaeb7bdef +title: Divide One Decimal by Another with JavaScript +challengeType: 1 +videoUrl: '' +localeTitle: قسّم رقم عشري واحد إلى آخر باستخدام جافا سكريبت +--- + +## Description +
الآن دعونا تقسيم واحد عشري بآخر.
+ +## Instructions +
غيِّر القيمة 0.0 بحيث يساوي ذلك quotient 2.2 .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يساوي quotient المتغير 2.2 + testString: 'assert(quotient === 2.2, "The variable quotient should equal 2.2");' + - text: يجب عليك استخدام / المشغل لتقسيم 4.4 على 2 + testString: 'assert(/4\.40*\s*\/\s*2\.*0*/.test(code), "You should use the / operator to divide 4.4 by 2");' + - text: يجب تعيين متغير القسمة مرة واحدة فقط + testString: 'assert(code.match(/quotient/g).length === 1, "The quotient variable should only be assigned once");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +var quotient = 0.0 / 2.0; // Fix this line + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/divide-one-number-by-another-with-javascript.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/divide-one-number-by-another-with-javascript.arabic.md new file mode 100644 index 0000000000..40d9b11735 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/divide-one-number-by-another-with-javascript.arabic.md @@ -0,0 +1,59 @@ +--- +id: cf1111c1c11feddfaeb6bdef +title: Divide One Number by Another with JavaScript +challengeType: 1 +videoUrl: '' +localeTitle: قسمة رقم واحد على آخر باستخدام JavaScript +--- + +## Description +
يمكننا أيضًا تقسيم رقم واحد بآخر. تستخدم جافا سكريبت الرمز / للقسمة.

مثال

myVar = 16/2؛ // تعيين 8
+ +## Instructions +
تغيير 0 بحيث يكون quotient تساوي 2 .
+ +## Tests +
+ +```yml +tests: + - text: اجعل quotient المتغير تساوي 2. + testString: 'assert(quotient === 2, "Make the variable quotient equal to 2.");' + - text: استخدم / المشغل + testString: 'assert(/\d+\s*\/\s*\d+/.test(code), "Use the / operator");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +var quotient = 66 / 0; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/escape-sequences-in-strings.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/escape-sequences-in-strings.arabic.md new file mode 100644 index 0000000000..6b7affc400 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/escape-sequences-in-strings.arabic.md @@ -0,0 +1,67 @@ +--- +id: 56533eb9ac21ba0edf2244b6 +title: Escape Sequences in Strings +challengeType: 1 +videoUrl: '' +localeTitle: الهروب من التسلسل في السلاسل +--- + +## Description +
لا تكون علامات الاقتباس هي الأحرف الوحيدة التي يمكن تجنبها داخل سلسلة. هناك سببان لاستخدام أحرف الهروب: أولاً هو السماح لك باستخدام الأحرف التي قد لا تتمكن من كتابتها ، مثل backspace. ثانيًا ، تسمح لك بتمثيل علامات الاقتباس المتعددة في سلسلة بدون إساءة تفسير جافا سكريبت لما تعنيه. تعلمنا هذا في التحدي السابق.
الشفرة انتاج |
\' اقتباس واحد
\" اقتباس مزدوج
\\ مائل
\n خط جديد
\r إرجاع
\t التبويب
\b مسافة للخلف
\f نموذج تغذية
لاحظ أنه يجب أن يتم إبطال الخط المائل العكسي نفسه ليتم عرضه كشرطة مائلة للخلف (Backslash).
+ +## Instructions +
قم بتعيين أسطر النص الثلاثة التالية في myStr متغير واحد باستخدام تسلسلات الهروب.
السطر الأول
\السطر الثاني
ThirdLine
ستحتاج إلى استخدام تسلسلات الهروب لإدراج أحرف خاصة بشكل صحيح. ستحتاج أيضًا إلى اتباع التباعد كما يبدو أعلاه ، مع عدم وجود مسافات بين تتابعات الهروب أو الكلمات. هنا هو النص مع تسلسل الهروب مكتوبة. FirstLine newline tab backslash SecondLine newline ThirdLine
+ +## Tests +
+ +```yml +tests: + - text: يجب ألا تحتوي myStr على أية مسافات + testString: 'assert(!/ /.test(myStr), "myStr should not contain any spaces");' + - text: يجب أن تحتوي myStr على السلاسل FirstLine و SecondLine و ThirdLine (تذكر حالة الحساسية) + testString: 'assert(/FirstLine/.test(myStr) && /SecondLine/.test(myStr) && /ThirdLine/.test(myStr), "myStr should contain the strings FirstLine, SecondLine and ThirdLine (remember case sensitivity)");' + - text: يجب أن يتبع FirstLine حرف السطر الجديد \n + testString: 'assert(/FirstLine\n/.test(myStr), "FirstLine should be followed by the newline character \n");' + - text: يجب أن تحتوي myStr على حرف tab \t يتبع حرف السطر الجديد + testString: 'assert(/\n\t/.test(myStr), "myStr should contain a tab character \t which follows a newline character");' + - text: SecondLine يجب أن يسبقه حرف مائل \\ + testString: 'assert(/\SecondLine/.test(myStr), "SecondLine should be preceded by the backslash character \\");' + - text: يجب أن يكون هناك حرف سطر جديد بين SecondLine و ThirdLine + testString: 'assert(/SecondLine\nThirdLine/.test(myStr), "There should be a newline character between SecondLine and ThirdLine");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +var myStr; // Change this line + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/escaping-literal-quotes-in-strings.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/escaping-literal-quotes-in-strings.arabic.md new file mode 100644 index 0000000000..547791203f --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/escaping-literal-quotes-in-strings.arabic.md @@ -0,0 +1,59 @@ +--- +id: 56533eb9ac21ba0edf2244b5 +title: Escaping Literal Quotes in Strings +challengeType: 1 +videoUrl: '' +localeTitle: الهروب من الأسعار الحرفيه في الاوتار +--- + +## Description +
عندما تقوم بتحديد سلسلة ، يجب أن تبدأ وتنتهي بعلامة اقتباس مفردة أو مزدوجة. ماذا يحدث عندما تحتاج إلى عرض سعر حرفي: " أو ' داخل السلسلة الخاصة بك؟ في JavaScript ، يمكنك الهروب من اقتباس من اعتباره كنهاية لسلسلة الاقتباس عن طريق وضع خط مائل عكسي ( \ ) أمام الاقتباس. var sampleStr = "Alan said, \"Peter is learning JavaScript\"."; يشير هذا إلى جافا سكريبت بأن الاقتباس التالي ليس نهاية السلسلة ، بل يجب أن يظهر داخل السلسلة بدلاً من ذلك. لذلك إذا كنت ستطبعه إلى وحدة التحكم ، ستحصل على: Alan said, "Peter is learning JavaScript".
+ +## Instructions +
استخدم myStr المائلة العكسية لتعيين سلسلة إلى متغير myStr بحيث إذا كنت myStr إلى وحدة التحكم ، سترى: I am a "double quoted" string inside "double quotes".
+ +## Tests +
+ +```yml +tests: + - text: يجب عليك استخدام علامتي اقتباس مزدوجتين ( " ) وأربعة علامات اقتباس مزدوجة ( \" ). + testString: 'assert(code.match(/\\"/g).length === 4 && code.match(/[^\\]"/g).length === 2, "You should use two double quotes (") and four escaped double quotes (\").");' + - text: 'يجب أن يحتوي myStr المتغير على السلسلة: I am a "double quoted" string inside "double quotes".' + testString: 'assert(myStr === "I am a \"double quoted\" string inside \"double quotes\".", "Variable myStr should contain the string: I am a "double quoted" string inside "double quotes".");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +var myStr = ""; // Change this line + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/find-the-length-of-a-string.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/find-the-length-of-a-string.arabic.md new file mode 100644 index 0000000000..ea890b9f15 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/find-the-length-of-a-string.arabic.md @@ -0,0 +1,71 @@ +--- +id: bd7123c9c448eddfaeb5bdef +title: Find the Length of a String +challengeType: 1 +videoUrl: '' +localeTitle: العثور على طول سلسلة +--- + +## Description +
يمكنك العثور على طول قيمة String بالكتابة. .length بعد متغير السلسلة أو سلسلة حرفية. "Alan Peter".length; // 10 على سبيل المثال ، إذا أنشأنا متغير var firstName = "Charles" ، يمكننا معرفة طول السلسلة "Charles" باستخدام الخاصية firstName.length .
+ +## Instructions +
استخدم خاصية .length لحساب عدد الأحرف في متغير lastName وتعيينه إلى lastNameLength .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تساوي lastNameLength ثمانية. + testString: 'assert((function(){if(typeof lastNameLength !== "undefined" && typeof lastNameLength === "number" && lastNameLength === 8){return true;}else{return false;}})(), "lastNameLength should be equal to eight.");' + - text: 'يجب أن تحصل على طول اسم lastName باستخدام .length مثل هذا: lastName.length .' + testString: 'assert((function(){if(code.match(/\.length/gi) && code.match(/\.length/gi).length >= 2 && code.match(/var lastNameLength \= 0;/gi) && code.match(/var lastNameLength \= 0;/gi).length >= 1){return true;}else{return false;}})(), "You should be getting the length of lastName by using .length like this: lastName.length.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var firstNameLength = 0; +var firstName = "Ada"; + +firstNameLength = firstName.length; + +// Setup +var lastNameLength = 0; +var lastName = "Lovelace"; + +// Only change code below this line. + +lastNameLength = lastName; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/finding-a-remainder-in-javascript.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/finding-a-remainder-in-javascript.arabic.md new file mode 100644 index 0000000000..336baad08d --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/finding-a-remainder-in-javascript.arabic.md @@ -0,0 +1,63 @@ +--- +id: 56533eb9ac21ba0edf2244ae +title: Finding a Remainder in JavaScript +challengeType: 1 +videoUrl: '' +localeTitle: العثور على البقية في جافا سكريبت +--- + +## Description +
يعطي عامل الباقي % الباقي من قسم رقمين. مثال
5٪ 2 = 1 بسبب
Math.floor (5/2) = 2 (Quotient)
2 * 2 = 4
5 - 4 = 1 (البقية)
استعمال
في الرياضيات ، يمكن التحقق من الرقم ليكون زوجي أو فردي عن طريق فحص الجزء المتبقي من تقسيم الرقم إلى 2 .
17٪ 2 = 1 (17 فردي)
48٪ 2 = 0 (48 حتى)
ملحوظة
في بعض الأحيان يشار إلى مشغل الباقي بشكل غير صحيح باسم مشغل "المعامل". وهي تشبه إلى حد بعيد المعامل ، ولكنها لا تعمل بشكل صحيح مع الأرقام السالبة.
+ +## Instructions +
حدد remainder مساويًا لما تبقى من 11 مقسومًا على 3 باستخدام عامل الباقي ( % ).
+ +## Tests +
+ +```yml +tests: + - text: يجب تهيئة المتغير remainder + testString: 'assert(/var\s+?remainder/.test(code), "The variable remainder should be initialized");' + - text: يجب أن تكون قيمة remainder 2 + testString: 'assert(remainder === 2, "The value of remainder should be 2");' + - text: يجب عليك استخدام عامل التشغيل % + testString: 'assert(/\s+?remainder\s*?=\s*?.*%.*;/.test(code), "You should use the % operator");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Only change code below this line + +var remainder; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/generate-random-fractions-with-javascript.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/generate-random-fractions-with-javascript.arabic.md new file mode 100644 index 0000000000..1918f1ad80 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/generate-random-fractions-with-javascript.arabic.md @@ -0,0 +1,68 @@ +--- +id: cf1111c1c11feddfaeb9bdef +title: Generate Random Fractions with JavaScript +challengeType: 1 +videoUrl: '' +localeTitle: توليد الكسور العشوائية مع جافا سكريبت +--- + +## Description +
الأرقام العشوائية مفيدة لإنشاء سلوك عشوائي. يحتوي JavaScript على دالة Math.random() التي تنشئ رقمًا عشريًا عشوائيًا بين 0 (شامل) وليس تمامًا 1 (خاص). وبالتالي ، يمكن أن يقوم Math.random() بإرجاع 0 ولكن لا يُرجع أبدًا ملاحظة 1
مثل تخزين القيم مع عامل التشغيل المتساوي ، سيتم حل جميع استدعاءات الدوال قبل تنفيذ عملية return ، حتى نتمكن من return قيمة الدالة Math.random() .
+ +## Instructions +
قم بتغيير randomFraction لإرجاع رقم عشوائي بدلاً من إرجاع 0 .
+ +## Tests +
+ +```yml +tests: + - text: randomFraction يجب إرجاع رقم عشوائي. + testString: 'assert(typeof randomFraction() === "number", "randomFraction should return a random number.");' + - text: يجب أن يكون الرقم الذي تم إرجاعه بواسطة randomFraction عشريًا. + testString: 'assert((randomFraction()+""). match(/\./g), "The number returned by randomFraction should be a decimal.");' + - text: يجب أن تستخدم Math.random لإنشاء الرقم العشري العشوائي. + testString: 'assert(code.match(/Math\.random/g).length >= 0, "You should be using Math.random to generate the random decimal number.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function randomFraction() { + + // Only change code below this line. + + return 0; + + // Only change code above this line. +} + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/generate-random-whole-numbers-with-javascript.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/generate-random-whole-numbers-with-javascript.arabic.md new file mode 100644 index 0000000000..51eae2b534 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/generate-random-whole-numbers-with-javascript.arabic.md @@ -0,0 +1,70 @@ +--- +id: cf1111c1c12feddfaeb1bdef +title: Generate Random Whole Numbers with JavaScript +challengeType: 1 +videoUrl: '' +localeTitle: توليد أرقام كاملة عشوائية مع جافا سكريبت +--- + +## Description +
من الرائع أن نتمكن من توليد أرقام عشرية عشوائية ، ولكنها أكثر فائدة إذا استخدمناها لإنشاء أرقام صحيحة عشوائية.
  1. استخدم Math.random() لإنشاء عشري عشوائي.
  2. اضرب هذا الرقم العشري العشوائي بـ 20 .
  3. استخدم دالة أخرى ، Math.floor() الرقم إلى أقرب رقم Math.floor() له.
تذكر أن Math.random() لا يمكنها أبدًا إرجاع 1 و ، نظرًا لأننا نقوم بالتقريب ، فمن المستحيل الحصول على 20 بالفعل. ستعطينا هذه التقنية عددًا صحيحًا بين 0 و 19 . وضع كل شيء معا ، وهذا هو ما تبدو عليه الكود لدينا: Math.floor(Math.random() * 20); نحن نطلق على Math.random() ، بضرب النتيجة بـ 20 ، ثم نمرر قيمة Math.floor() القيمة إلى أقرب رقم Math.floor() .
+ +## Instructions +
استخدم هذه التقنية لتوليد وإرجاع رقم صحيح عشوائي بين 0 و 9 .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تكون نتيجة randomWholeNum . + testString: 'assert(typeof randomWholeNum() === "number" && (function(){var r = randomWholeNum();return Math.floor(r) === r;})(), "The result of randomWholeNum should be a whole number.");' + - text: يجب أن تستخدم Math.random لإنشاء رقم عشوائي. + testString: 'assert(code.match(/Math.random/g).length > 1, "You should be using Math.random to generate a random number.");' + - text: يجب أن تضاعف نتيجة Math.random بمقدار 10 لجعله رقمًا بين صفر وتسعة. + testString: 'assert(code.match(/\s*?Math.random\s*?\(\s*?\)\s*?\*\s*?10[\D]\s*?/g) || code.match(/\s*?10\s*?\*\s*?Math.random\s*?\(\s*?\)\s*?/g), "You should have multiplied the result of Math.random by 10 to make it a number that is between zero and nine.");' + - text: يجب عليك استخدام Math.floor لإزالة الجزء العشري من الرقم. + testString: 'assert(code.match(/Math.floor/g).length > 1, "You should use Math.floor to remove the decimal part of the number.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +var randomNumberBetween0and19 = Math.floor(Math.random() * 20); + +function randomWholeNum() { + + // Only change code below this line. + + return Math.random(); +} + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/generate-random-whole-numbers-within-a-range.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/generate-random-whole-numbers-within-a-range.arabic.md new file mode 100644 index 0000000000..89e3c11cac --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/generate-random-whole-numbers-within-a-range.arabic.md @@ -0,0 +1,80 @@ +--- +id: cf1111c1c12feddfaeb2bdef +title: Generate Random Whole Numbers within a Range +challengeType: 1 +videoUrl: '' +localeTitle: توليد أرقام كاملة عشوائية داخل نطاق +--- + +## Description +
بدلاً من إنشاء رقم عشوائي بين الصفر ورقم معين كما فعلنا من قبل ، يمكننا إنشاء رقم عشوائي يقع ضمن نطاق من رقمين محددين. للقيام بذلك، ونحن سوف تحدد العدد الأدنى من min والحد الأقصى ل max . إليكم الصيغة التي سنستخدمها. خذ لحظة في قراءته وحاول فهم ما يفعله هذا الكود: Math.floor(Math.random() * (max - min + 1)) + min
+ +## Instructions +
قم بإنشاء دالة تسمى randomRange والتي تأخذ نطاق myMin و myMax وتقوم بإرجاع رقم عشوائي أكبر من أو يساوي myMin ، وهو أقل من أو يساوي myMax ، شامل.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يكون العدد العشوائي الأدنى الذي يمكن إنشاؤه بواسطة randomRange مساوياً للحد الأدنى للرقم ، myMin . + testString: 'assert(calcMin === 5, "The lowest random number that can be generated by randomRange should be equal to your minimum number, myMin.");' + - text: يجب أن يكون الرقم العشوائي الأعلى الذي يمكن إنشاؤه بواسطة randomRange مساويا myMax عدد ممكن ، myMax . + testString: 'assert(calcMax === 15, "The highest random number that can be generated by randomRange should be equal to your maximum number, myMax.");' + - text: يجب أن يكون الرقم العشوائي الذي تم إنشاؤه بواسطة randomRange عددًا صحيحًا وليس عشريًا. + testString: 'assert(randomRange(0,1) % 1 === 0 , "The random number generated by randomRange should be an integer, not a decimal.");' + - text: randomRange يجب استخدام كل myMax و myMin ، وإرجاع رقم عشوائي في النطاق الخاص بك. + testString: 'assert((function(){if(code.match(/myMax/g).length > 1 && code.match(/myMin/g).length > 2 && code.match(/Math.floor/g) && code.match(/Math.random/g)){return true;}else{return false;}})(), "randomRange should use both myMax and myMin, and return a random number in your range.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +function ourRandomRange(ourMin, ourMax) { + + return Math.floor(Math.random() * (ourMax - ourMin + 1)) + ourMin; +} + +ourRandomRange(1, 9); + +// Only change code below this line. + +function randomRange(myMin, myMax) { + + return 0; // Change this line + +} + +// Change these values to test your function +var myRandom = randomRange(5, 15); + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/global-scope-and-functions.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/global-scope-and-functions.arabic.md new file mode 100644 index 0000000000..c251bb4e36 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/global-scope-and-functions.arabic.md @@ -0,0 +1,109 @@ +--- +id: 56533eb9ac21ba0edf2244be +title: Global Scope and Functions +challengeType: 1 +videoUrl: '' +localeTitle: النطاق العالمي والوظائف +--- + +## Description +
في JavaScript ، يشير النطاق إلى رؤية المتغيرات. المتغيرات التي يتم تعريفها خارج كتلة وظيفة لها نطاق عالمي . وهذا يعني أنه يمكن رؤيتها في أي مكان في شفرة جافا سكريبت. يتم إنشاء المتغيرات التي يتم استخدامها بدون الكلمة الأساسية var تلقائيًا في النطاق global . هذا يمكن أن يخلق عواقب غير مقصودة في مكان آخر في التعليمات البرمجية الخاصة بك أو عند تشغيل وظيفة مرة أخرى. يجب عليك دائما أن تعلن عن المتغيرات الخاصة بك مع var .
+ +## Instructions +
باستخدام var ، قم بتعريف متغير global myGlobal خارج أي وظيفة. قم بتهيئته بقيمة 10 . داخل الدالة fun1 ، قم بتعيين 5 إلى oopsGlobal دون استخدام الكلمة الأساسية var .
+ +## Tests +
+ +```yml +tests: + - text: يجب تعريف myGlobal + testString: 'assert(typeof myGlobal != "undefined", "myGlobal should be defined");' + - text: يجب أن يكون ل myGlobal قيمة 10 + testString: 'assert(myGlobal === 10, "myGlobal should have a value of 10");' + - text: يجب إعلان myGlobal باستخدام الكلمة الرئيسية var + testString: 'assert(/var\s+myGlobal/.test(code), "myGlobal should be declared using the var keyword");' + - text: يجب أن يكون oopsGlobal متغيرًا عامًا وله قيمة 5 + testString: 'assert(typeof oopsGlobal != "undefined" && oopsGlobal === 5, "oopsGlobal should be a global variable and have a value of 5");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Declare your variable here + + +function fun1() { + // Assign 5 to oopsGlobal Here + +} + +// Only change code above this line +function fun2() { + var output = ""; + if (typeof myGlobal != "undefined") { + output += "myGlobal: " + myGlobal; + } + if (typeof oopsGlobal != "undefined") { + output += " oopsGlobal: " + oopsGlobal; + } + console.log(output); +} + +``` + +
+ +### Before Test +
+ +```js +var logOutput = ""; +var originalConsole = console +function capture() { + var nativeLog = console.log; + console.log = function (message) { + logOutput = message; + if(nativeLog.apply) { + nativeLog.apply(originalConsole, arguments); + } else { + var nativeMsg = Array.prototype.slice.apply(arguments).join(' '); + nativeLog(nativeMsg); + } + }; +} + +function uncapture() { + console.log = originalConsole.log; +} +var oopsGlobal; +capture(); + +``` + +
+ +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/global-vs.-local-scope-in-functions.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/global-vs.-local-scope-in-functions.arabic.md new file mode 100644 index 0000000000..bdc8bd2a4e --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/global-vs.-local-scope-in-functions.arabic.md @@ -0,0 +1,65 @@ +--- +id: 56533eb9ac21ba0edf2244c0 +title: Global vs. Local Scope in Functions +challengeType: 1 +videoUrl: '' +localeTitle: نطاق عالمي مقابل نطاق محلي في الوظائف +--- + +## Description +
من الممكن أن يكون لديك متغيرات محلية وعالمية تحمل نفس الاسم. عند القيام بذلك ، يأخذ المتغير local الأسبقية على المتغير global . في هذا المثال:
var someVar = "Hat" ،
وظيفة myFun () {
var someVar = "الرأس" ؛
عودة بعض
}
ستقوم الدالة myFun بإرجاع "Head" لأن الإصدار local للمتغير موجود.
+ +## Instructions +
إضافة متغير محلي لوظيفة myOutfit لتجاوز قيمة outerWear مع "sweater" .
+ +## Tests +
+ +```yml +tests: + - text: لا تغير قيمة outerWear + testString: 'assert(outerWear === "T-Shirt", "Do not change the value of the global outerWear");' + - text: يجب أن يعود myOutfit "sweater" + testString: 'assert(myOutfit() === "sweater", "myOutfit should return "sweater"");' + - text: لا تقم بتغيير بيان الإرجاع + testString: 'assert(/return outerWear/.test(code), "Do not change the return statement");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Setup +var outerWear = "T-Shirt"; + +function myOutfit() { + // Only change code below this line + + + + // Only change code above this line + return outerWear; +} + +myOutfit(); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/golf-code.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/golf-code.arabic.md new file mode 100644 index 0000000000..1721a5fe8a --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/golf-code.arabic.md @@ -0,0 +1,79 @@ +--- +id: 5664820f61c48e80c9fa476c +title: Golf Code +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(golfScore(4, 1) === "Hole-in-one!", "golfScore(4, 1) should return "Hole-in-one!"");' + - text: '' + testString: 'assert(golfScore(4, 2) === "Eagle", "golfScore(4, 2) should return "Eagle"");' + - text: '' + testString: 'assert(golfScore(5, 2) === "Eagle", "golfScore(5, 2) should return "Eagle"");' + - text: '' + testString: 'assert(golfScore(4, 3) === "Birdie", "golfScore(4, 3) should return "Birdie"");' + - text: '' + testString: 'assert(golfScore(4, 4) === "Par", "golfScore(4, 4) should return "Par"");' + - text: '' + testString: 'assert(golfScore(1, 1) === "Hole-in-one!", "golfScore(1, 1) should return "Hole-in-one!"");' + - text: '' + testString: 'assert(golfScore(5, 5) === "Par", "golfScore(5, 5) should return "Par"");' + - text: '' + testString: 'assert(golfScore(4, 5) === "Bogey", "golfScore(4, 5) should return "Bogey"");' + - text: '' + testString: 'assert(golfScore(4, 6) === "Double Bogey", "golfScore(4, 6) should return "Double Bogey"");' + - text: '' + testString: 'assert(golfScore(4, 7) === "Go Home!", "golfScore(4, 7) should return "Go Home!"");' + - text: '' + testString: 'assert(golfScore(5, 9) === "Go Home!", "golfScore(5, 9) should return "Go Home!"");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +var names = ["Hole-in-one!", "Eagle", "Birdie", "Par", "Bogey", "Double Bogey", "Go Home!"]; +function golfScore(par, strokes) { + // Only change code below this line + + + return "Change Me"; + // Only change code above this line +} + +// Change these values to test +golfScore(5, 4); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/increment-a-number-with-javascript.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/increment-a-number-with-javascript.arabic.md new file mode 100644 index 0000000000..5daa8ddcd8 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/increment-a-number-with-javascript.arabic.md @@ -0,0 +1,66 @@ +--- +id: 56533eb9ac21ba0edf2244ac +title: Increment a Number with JavaScript +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(myVar === 88, "myVar should equal 88");' + - text: '' + testString: 'assert(/var\s*myVar\s*=\s*87;\s*\/*.*\s*([+]{2}\s*myVar|myVar\s*[+]{2});/.test(code), "myVar = myVar + 1; should be changed");' + - text: '' + testString: 'assert(/[+]{2}\s*myVar|myVar\s*[+]{2}/.test(code), "Use the ++ operator");' + - text: '' + testString: 'assert(/var myVar = 87;/.test(code), "Do not change code above the line");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +var myVar = 87; + +// Only change code below this line +myVar = myVar + 1; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/initializing-variables-with-the-assignment-operator.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/initializing-variables-with-the-assignment-operator.arabic.md new file mode 100644 index 0000000000..1838ff3c25 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/initializing-variables-with-the-assignment-operator.arabic.md @@ -0,0 +1,60 @@ +--- +id: 56533eb9ac21ba0edf2244a9 +title: Initializing Variables with the Assignment Operator +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(/var\s+a\s*=\s*9\s*/.test(code), "Initialize a to a value of 9");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var ourVar = 19; + +// Only change code below this line + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/introducing-else-if-statements.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/introducing-else-if-statements.arabic.md new file mode 100644 index 0000000000..d51e9f1db7 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/introducing-else-if-statements.arabic.md @@ -0,0 +1,76 @@ +--- +id: 56533eb9ac21ba0edf2244db +title: Introducing Else If Statements +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(code.match(/else/g).length > 1, "You should have at least two else statements");' + - text: '' + testString: 'assert(code.match(/if/g).length > 1, "You should have at least two if statements");' + - text: '' + testString: 'assert(code.match(/if\s*\((.+)\)\s*\{[\s\S]+\}\s*else if\s*\((.+)\)\s*\{[\s\S]+\}\s*else\s*\{[\s\S]+\s*\}/), "You should have closing and opening curly braces for each condition in your if else statement");' + - text: '' + testString: 'assert(testElseIf(0) === "Smaller than 5", "testElseIf(0) should return "Smaller than 5"");' + - text: '' + testString: 'assert(testElseIf(5) === "Between 5 and 10", "testElseIf(5) should return "Between 5 and 10"");' + - text: '' + testString: 'assert(testElseIf(7) === "Between 5 and 10", "testElseIf(7) should return "Between 5 and 10"");' + - text: '' + testString: 'assert(testElseIf(10) === "Between 5 and 10", "testElseIf(10) should return "Between 5 and 10"");' + - text: '' + testString: 'assert(testElseIf(12) === "Greater than 10", "testElseIf(12) should return "Greater than 10"");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function testElseIf(val) { + if (val > 10) { + return "Greater than 10"; + } + + if (val < 5) { + return "Smaller than 5"; + } + + return "Between 5 and 10"; +} + +// Change this value to test +testElseIf(7); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/introducing-else-statements.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/introducing-else-statements.arabic.md new file mode 100644 index 0000000000..83e5175874 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/introducing-else-statements.arabic.md @@ -0,0 +1,78 @@ +--- +id: 56533eb9ac21ba0edf2244da +title: Introducing Else Statements +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(code.match(/if/g).length === 1, "You should only have one if statement in the editor");' + - text: '' + testString: 'assert(/else/g.test(code), "You should use an else statement");' + - text: '' + testString: 'assert(testElse(4) === "5 or Smaller", "testElse(4) should return "5 or Smaller"");' + - text: '' + testString: 'assert(testElse(5) === "5 or Smaller", "testElse(5) should return "5 or Smaller"");' + - text: '' + testString: 'assert(testElse(6) === "Bigger than 5", "testElse(6) should return "Bigger than 5"");' + - text: '' + testString: 'assert(testElse(10) === "Bigger than 5", "testElse(10) should return "Bigger than 5"");' + - text: '' + testString: 'assert(/var result = "";/.test(code) && /return result;/.test(code), "Do not change the code above or below the lines.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function testElse(val) { + var result = ""; + // Only change code below this line + + if (val > 5) { + result = "Bigger than 5"; + } + + if (val <= 5) { + result = "5 or Smaller"; + } + + // Only change code above this line + return result; +} + +// Change this value to test +testElse(4); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-odd-numbers-with-a-for-loop.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-odd-numbers-with-a-for-loop.arabic.md new file mode 100644 index 0000000000..c2592f99d6 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-odd-numbers-with-a-for-loop.arabic.md @@ -0,0 +1,69 @@ +--- +id: 56104e9e514f539506016a5c +title: Iterate Odd Numbers With a For Loop +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(code.match(/for\s*\(/g).length > 1, "You should be using a for loop for this.");' + - text: '' + testString: 'assert.deepEqual(myArray, [1,3,5,7,9], "myArray should equal [1,3,5,7,9].");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var ourArray = []; + +for (var i = 0; i < 10; i += 2) { + ourArray.push(i); +} + +// Setup +var myArray = []; + +// Only change code below this line. + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-through-an-array-with-a-for-loop.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-through-an-array-with-a-for-loop.arabic.md new file mode 100644 index 0000000000..42ae2f6a04 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-through-an-array-with-a-for-loop.arabic.md @@ -0,0 +1,74 @@ +--- +id: 5675e877dbd60be8ad28edc6 +title: Iterate Through an Array with a For Loop +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(code.match(/var.*?total\s*=\s*0.*?;/), "total should be declared and initialized to 0");' + - text: '' + testString: 'assert(total === 20, "total should equal 20");' + - text: '' + testString: 'assert(code.match(/for\s*\(/g).length > 1 && code.match(/myArr\s*\[/), "You should use a for loop to iterate through myArr");' + - text: '' + testString: 'assert(!code.match(/total[\s\+\-]*=\s*(\d(?!\s*[;,])|[1-9])/g), "Do not set total to 20 directly");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var ourArr = [ 9, 10, 11, 12]; +var ourTotal = 0; + +for (var i = 0; i < ourArr.length; i++) { + ourTotal += ourArr[i]; +} + +// Setup +var myArr = [ 2, 3, 4, 5, 6]; + +// Only change code below this line + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-with-javascript-do...while-loops.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-with-javascript-do...while-loops.arabic.md new file mode 100644 index 0000000000..1f34844f95 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-with-javascript-do...while-loops.arabic.md @@ -0,0 +1,70 @@ +--- +id: 5a2efd662fb457916e1fe604 +title: Iterate with JavaScript Do...While Loops +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(code.match(/do/g), "You should be using a do...while loop for this.");' + - text: '' + testString: 'assert.deepEqual(myArray, [10], "myArray should equal [10].");' + - text: '' + testString: 'assert.deepEqual(i, 11, "i should equal 11");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Setup +var myArray = []; +var i = 10; + +// Only change code below this line. + +while (i < 5) { + myArray.push(i); + i++; +} + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-with-javascript-for-loops.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-with-javascript-for-loops.arabic.md new file mode 100644 index 0000000000..a6eabad277 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-with-javascript-for-loops.arabic.md @@ -0,0 +1,69 @@ +--- +id: cf1111c1c11feddfaeb5bdef +title: Iterate with JavaScript For Loops +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(code.match(/for\s*\(/g).length > 1, "You should be using a for loop for this.");' + - text: '' + testString: 'assert.deepEqual(myArray, [1,2,3,4,5], "myArray should equal [1,2,3,4,5].");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var ourArray = []; + +for (var i = 0; i < 5; i++) { + ourArray.push(i); +} + +// Setup +var myArray = []; + +// Only change code below this line. + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-with-javascript-while-loops.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-with-javascript-while-loops.arabic.md new file mode 100644 index 0000000000..be6c39ae22 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-with-javascript-while-loops.arabic.md @@ -0,0 +1,62 @@ +--- +id: cf1111c1c11feddfaeb1bdef +title: Iterate with JavaScript While Loops +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(code.match(/while/g), "You should be using a while loop for this.");' + - text: '' + testString: 'assert.deepEqual(myArray, [0,1,2,3,4], "myArray should equal [0,1,2,3,4].");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Setup +var myArray = []; + +// Only change code below this line. + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/local-scope-and-functions.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/local-scope-and-functions.arabic.md new file mode 100644 index 0000000000..5cbe25c2fe --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/local-scope-and-functions.arabic.md @@ -0,0 +1,96 @@ +--- +id: 56533eb9ac21ba0edf2244bf +title: Local Scope and Functions +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(typeof myVar === "undefined", "No global myVar variable");' + - text: '' + testString: 'assert(/var\s+myVar/.test(code), "Add a local myVar variable");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function myLocalScope() { + 'use strict'; // you shouldn't need to edit this line + + console.log(myVar); +} +myLocalScope(); + +// Run and check the console +// myVar is not defined outside of myLocalScope +console.log(myVar); + +// Now remove the console log line to pass the test + +``` + +
+ +### Before Test +
+ +```js +var logOutput = ""; +var originalConsole = console +function capture() { + var nativeLog = console.log; + console.log = function (message) { + logOutput = message; + if(nativeLog.apply) { + nativeLog.apply(originalConsole, arguments); + } else { + var nativeMsg = Array.prototype.slice.apply(arguments).join(' '); + nativeLog(nativeMsg); + } + }; +} + +function uncapture() { + console.log = originalConsole.log; +} + +``` + +
+ +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/logical-order-in-if-else-statements.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/logical-order-in-if-else-statements.arabic.md new file mode 100644 index 0000000000..79eb09a0d6 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/logical-order-in-if-else-statements.arabic.md @@ -0,0 +1,64 @@ +--- +id: 5690307fddb111c6084545d7 +title: Logical Order in If Else Statements +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(orderMyLogic(4) === "Less than 5", "orderMyLogic(4) should return "Less than 5"");' + - text: '' + testString: 'assert(orderMyLogic(6) === "Less than 10", "orderMyLogic(6) should return "Less than 10"");' + - text: '' + testString: 'assert(orderMyLogic(11) === "Greater than or equal to 10", "orderMyLogic(11) should return "Greater than or equal to 10"");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function orderMyLogic(val) { + if (val < 10) { + return "Less than 10"; + } else if (val < 5) { + return "Less than 5"; + } else { + return "Greater than or equal to 10"; + } +} + +// Change this value to test +orderMyLogic(7); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/manipulate-arrays-with-pop.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/manipulate-arrays-with-pop.arabic.md new file mode 100644 index 0000000000..c915235c16 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/manipulate-arrays-with-pop.arabic.md @@ -0,0 +1,70 @@ +--- +id: 56bbb991ad1ed5201cd392cc +title: Manipulate Arrays With pop() +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert((function(d){if(d[0][0] == "John" && d[0][1] === 23 && d[1] == undefined){return true;}else{return false;}})(myArray), "myArray should only contain [["John", 23]].");' + - text: '' + testString: 'assert(/removedFromMyArray\s*=\s*myArray\s*.\s*pop\s*(\s*)/.test(code), "Use pop() on myArray");' + - text: '' + testString: 'assert((function(d){if(d[0] == "cat" && d[1] === 2 && d[2] == undefined){return true;}else{return false;}})(removedFromMyArray), "removedFromMyArray should only contain ["cat", 2].");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var ourArray = [1,2,3]; +var removedFromOurArray = ourArray.pop(); +// removedFromOurArray now equals 3, and ourArray now equals [1,2] + +// Setup +var myArray = [["John", 23], ["cat", 2]]; + +// Only change code below this line. +var removedFromMyArray; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/manipulate-arrays-with-push.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/manipulate-arrays-with-push.arabic.md new file mode 100644 index 0000000000..f983ad5006 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/manipulate-arrays-with-push.arabic.md @@ -0,0 +1,65 @@ +--- +id: 56bbb991ad1ed5201cd392cb +title: Manipulate Arrays With push() +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert((function(d){if(d[2] != undefined && d[0][0] == "John" && d[0][1] === 23 && d[2][0] == "dog" && d[2][1] === 3 && d[2].length == 2){return true;}else{return false;}})(myArray), "myArray should now equal [["John", 23], ["cat", 2], ["dog", 3]].");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var ourArray = ["Stimpson", "J", "cat"]; +ourArray.push(["happy", "joy"]); +// ourArray now equals ["Stimpson", "J", "cat", ["happy", "joy"]] + +// Setup +var myArray = [["John", 23], ["cat", 2]]; + +// Only change code below this line. + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/manipulate-arrays-with-shift.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/manipulate-arrays-with-shift.arabic.md new file mode 100644 index 0000000000..9488fa77e2 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/manipulate-arrays-with-shift.arabic.md @@ -0,0 +1,68 @@ +--- +id: 56bbb991ad1ed5201cd392cd +title: Manipulate Arrays With shift() +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert((function(d){if(d[0][0] == "dog" && d[0][1] === 3 && d[1] == undefined){return true;}else{return false;}})(myArray), "myArray should now equal [["dog", 3]].");' + - text: '' + testString: 'assert((function(d){if(d[0] == "John" && d[1] === 23 && typeof removedFromMyArray === "object"){return true;}else{return false;}})(removedFromMyArray), "removedFromMyArray should contain ["John", 23].");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var ourArray = ["Stimpson", "J", ["cat"]]; +var removedFromOurArray = ourArray.shift(); +// removedFromOurArray now equals "Stimpson" and ourArray now equals ["J", ["cat"]]. + +// Setup +var myArray = [["John", 23], ["dog", 3]]; + +// Only change code below this line. +var removedFromMyArray; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/manipulate-arrays-with-unshift.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/manipulate-arrays-with-unshift.arabic.md new file mode 100644 index 0000000000..97b2e6f689 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/manipulate-arrays-with-unshift.arabic.md @@ -0,0 +1,67 @@ +--- +id: 56bbb991ad1ed5201cd392ce +title: Manipulate Arrays With unshift() +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert((function(d){if(typeof d[0] === "object" && d[0][0] == "Paul" && d[0][1] === 35 && d[1][0] != undefined && d[1][0] == "dog" && d[1][1] != undefined && d[1][1] == 3){return true;}else{return false;}})(myArray), "myArray should now have [["Paul", 35], ["dog", 3]].");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var ourArray = ["Stimpson", "J", "cat"]; +ourArray.shift(); // ourArray now equals ["J", "cat"] +ourArray.unshift("Happy"); +// ourArray now equals ["Happy", "J", "cat"] + +// Setup +var myArray = [["John", 23], ["dog", 3]]; +myArray.shift(); + +// Only change code below this line. + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/manipulating-complex-objects.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/manipulating-complex-objects.arabic.md new file mode 100644 index 0000000000..6e7c3a8af4 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/manipulating-complex-objects.arabic.md @@ -0,0 +1,86 @@ +--- +id: 56533eb9ac21ba0edf2244cb +title: Manipulating Complex Objects +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(Array.isArray(myMusic), "myMusic should be an array");' + - text: '' + testString: 'assert(myMusic.length > 1, "myMusic should have at least two elements");' + - text: '' + testString: 'assert(typeof myMusic[1] === "object", "myMusic[1] should be an object");' + - text: '' + testString: 'assert(Object.keys(myMusic[1]).length > 3, "myMusic[1] should have at least 4 properties");' + - text: '' + testString: 'assert(myMusic[1].hasOwnProperty("artist") && typeof myMusic[1].artist === "string", "myMusic[1] should contain an artist property which is a string");' + - text: '' + testString: 'assert(myMusic[1].hasOwnProperty("title") && typeof myMusic[1].title === "string", "myMusic[1] should contain a title property which is a string");' + - text: '' + testString: 'assert(myMusic[1].hasOwnProperty("release_year") && typeof myMusic[1].release_year === "number", "myMusic[1] should contain a release_year property which is a number");' + - text: '' + testString: 'assert(myMusic[1].hasOwnProperty("formats") && Array.isArray(myMusic[1].formats), "myMusic[1] should contain a formats property which is an array");' + - text: '' + testString: 'assert(myMusic[1].formats.every(function(item) { return (typeof item === "string")}) && myMusic[1].formats.length > 1, "formats should be an array of strings with at least two elements");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +var myMusic = [ + { + "artist": "Billy Joel", + "title": "Piano Man", + "release_year": 1973, + "formats": [ + "CD", + "8T", + "LP" + ], + "gold": true + } + // Add record here +]; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/modify-array-data-with-indexes.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/modify-array-data-with-indexes.arabic.md new file mode 100644 index 0000000000..2c8c952094 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/modify-array-data-with-indexes.arabic.md @@ -0,0 +1,66 @@ +--- +id: cf1111c1c11feddfaeb8bdef +title: Modify Array Data With Indexes +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert((function(){if(typeof myArray != "undefined" && myArray[0] == 45 && myArray[1] == 64 && myArray[2] == 99){return true;}else{return false;}})(), "myArray should now be [45,64,99].");' + - text: '' + testString: 'assert((function(){if(code.match(/myArray\[0\]\s*=\s*/g)){return true;}else{return false;}})(), "You should be using correct index to modify the value in myArray.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var ourArray = [18,64,99]; +ourArray[1] = 45; // ourArray now equals [18,45,99]. + +// Setup +var myArray = [18,64,99]; + +// Only change code below this line. + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/multiple-identical-options-in-switch-statements.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/multiple-identical-options-in-switch-statements.arabic.md new file mode 100644 index 0000000000..632db814c0 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/multiple-identical-options-in-switch-statements.arabic.md @@ -0,0 +1,80 @@ +--- +id: 56533eb9ac21ba0edf2244df +title: Multiple Identical Options in Switch Statements +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(sequentialSizes(1) === "Low", "sequentialSizes(1) should return "Low"");' + - text: '' + testString: 'assert(sequentialSizes(2) === "Low", "sequentialSizes(2) should return "Low"");' + - text: '' + testString: 'assert(sequentialSizes(3) === "Low", "sequentialSizes(3) should return "Low"");' + - text: '' + testString: 'assert(sequentialSizes(4) === "Mid", "sequentialSizes(4) should return "Mid"");' + - text: '' + testString: 'assert(sequentialSizes(5) === "Mid", "sequentialSizes(5) should return "Mid"");' + - text: '' + testString: 'assert(sequentialSizes(6) === "Mid", "sequentialSizes(6) should return "Mid"");' + - text: '' + testString: 'assert(sequentialSizes(7) === "High", "sequentialSizes(7) should return "High"");' + - text: '' + testString: 'assert(sequentialSizes(8) === "High", "sequentialSizes(8) should return "High"");' + - text: '' + testString: 'assert(sequentialSizes(9) === "High", "sequentialSizes(9) should return "High"");' + - text: '' + testString: 'assert(!/else/g.test(code) || !/if/g.test(code), "You should not use any if or else statements");' + - text: '' + testString: 'assert(code.match(/case/g).length === 9, "You should have nine case statements");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function sequentialSizes(val) { + var answer = ""; + // Only change code below this line + + + + // Only change code above this line + return answer; +} + +// Change this value to test +sequentialSizes(1); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/multiply-two-decimals-with-javascript.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/multiply-two-decimals-with-javascript.arabic.md new file mode 100644 index 0000000000..12d63751ab --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/multiply-two-decimals-with-javascript.arabic.md @@ -0,0 +1,59 @@ +--- +id: bd7993c9c69feddfaeb7bdef +title: Multiply Two Decimals with JavaScript +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(product === 5.0, "The variable product should equal 5.0.");' + - text: '' + testString: 'assert(/\*/.test(code), "You should use the * operator");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +var product = 2.0 * 0.0; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/multiply-two-numbers-with-javascript.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/multiply-two-numbers-with-javascript.arabic.md new file mode 100644 index 0000000000..a594b0bbd2 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/multiply-two-numbers-with-javascript.arabic.md @@ -0,0 +1,59 @@ +--- +id: cf1231c1c11feddfaeb5bdef +title: Multiply Two Numbers with JavaScript +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(product === 80,"Make the variable product equal 80");' + - text: '' + testString: 'assert(/\*/.test(code), "Use the * operator");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +var product = 8 * 0; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/nest-one-array-within-another-array.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/nest-one-array-within-another-array.arabic.md new file mode 100644 index 0000000000..6f39a7c4a3 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/nest-one-array-within-another-array.arabic.md @@ -0,0 +1,61 @@ +--- +id: cf1111c1c11feddfaeb7bdef +title: Nest one Array within Another Array +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(Array.isArray(myArray) && myArray.some(Array.isArray), "myArray should have at least one array nested within another array.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var ourArray = [["the universe", 42], ["everything", 101010]]; + +// Only change code below this line. +var myArray = []; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/nesting-for-loops.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/nesting-for-loops.arabic.md new file mode 100644 index 0000000000..32c99b9dec --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/nesting-for-loops.arabic.md @@ -0,0 +1,62 @@ +--- +id: 56533eb9ac21ba0edf2244e1 +title: Nesting For Loops +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(multiplyAll([[1],[2],[3]]) === 6, "multiplyAll([[1],[2],[3]]) should return 6");' + - text: '' + testString: 'assert(multiplyAll([[1,2],[3,4],[5,6,7]]) === 5040, "multiplyAll([[1,2],[3,4],[5,6,7]]) should return 5040");' + - text: '' + testString: 'assert(multiplyAll([[5,1],[0.2, 4, 0.5],[3, 9]]) === 54, "multiplyAll([[5,1],[0.2, 4, 0.5],[3, 9]]) should return 54");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function multiplyAll(arr) { + var product = 1; + // Only change code below this line + + // Only change code above this line + return product; +} + +// Modify values below to test your code +multiplyAll([[1,2],[3,4],[5,6,7]]); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/passing-values-to-functions-with-arguments.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/passing-values-to-functions-with-arguments.arabic.md new file mode 100644 index 0000000000..859192e2be --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/passing-values-to-functions-with-arguments.arabic.md @@ -0,0 +1,97 @@ +--- +id: 56533eb9ac21ba0edf2244bd +title: Passing Values to Functions with Arguments +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(typeof functionWithArgs === "function", "functionWithArgs should be a function");' + - text: '' + testString: 'if(typeof functionWithArgs === "function") { capture(); functionWithArgs(1,2); uncapture(); } assert(logOutput == 3, "functionWithArgs(1,2) should output 3");' + - text: '' + testString: 'if(typeof functionWithArgs === "function") { capture(); functionWithArgs(7,9); uncapture(); } assert(logOutput == 16, "functionWithArgs(7,9) should output 16");' + - text: '' + testString: 'assert(/^\s*functionWithArgs\s*\(\s*\d+\s*,\s*\d+\s*\)\s*;/m.test(code), "Call functionWithArgs with two numbers after you define it.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +function ourFunctionWithArgs(a, b) { + console.log(a - b); +} +ourFunctionWithArgs(10, 5); // Outputs 5 + +// Only change code below this line. + +``` + +
+ +### Before Test +
+ +```js +var logOutput = ""; +var originalConsole = console +function capture() { + var nativeLog = console.log; + console.log = function (message) { + if(message) logOutput = JSON.stringify(message).trim(); + if(nativeLog.apply) { + nativeLog.apply(originalConsole, arguments); + } else { + var nativeMsg = Array.prototype.slice.apply(arguments).join(' '); + nativeLog(nativeMsg); + } + }; +} + +function uncapture() { + console.log = originalConsole.log; +} + +capture(); + +``` + +
+ +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/practice-comparing-different-values.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/practice-comparing-different-values.arabic.md new file mode 100644 index 0000000000..627c33f4f1 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/practice-comparing-different-values.arabic.md @@ -0,0 +1,62 @@ +--- +id: 599a789b454f2bbd91a3ff4d +title: Practice comparing different values +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(compareEquality(10, "10") === "Not Equal", "compareEquality(10, "10") should return "Not Equal"");' + - text: '' + testString: 'assert(compareEquality("20", 20) === "Not Equal", "compareEquality("20", 20) should return "Not Equal"");' + - text: '' + testString: 'assert(code.match(/===/g), "You should use the === operator");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Setup +function compareEquality(a, b) { + if (a == b) { // Change this line + return "Equal"; + } + return "Not Equal"; +} + +// Change this value to test +compareEquality(10, "10"); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/profile-lookup.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/profile-lookup.arabic.md new file mode 100644 index 0000000000..decd6f929a --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/profile-lookup.arabic.md @@ -0,0 +1,95 @@ +--- +id: 5688e62ea601b2482ff8422b +title: Profile Lookup +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(lookUpProfile("Kristian","lastName") === "Vos", ""Kristian", "lastName" should return "Vos"");' + - text: '' + testString: 'assert.deepEqual(lookUpProfile("Sherlock", "likes"), ["Intriguing Cases", "Violin"], ""Sherlock", "likes" should return ["Intriguing Cases", "Violin"]");' + - text: '' + testString: 'assert(typeof lookUpProfile("Harry", "likes") === "object", ""Harry","likes" should return an array");' + - text: '' + testString: 'assert(lookUpProfile("Bob", "number") === "No such contact", ""Bob", "number" should return "No such contact"");' + - text: '' + testString: 'assert(lookUpProfile("Bob", "potato") === "No such contact", ""Bob", "potato" should return "No such contact"");' + - text: '' + testString: 'assert(lookUpProfile("Akira", "address") === "No such property", ""Akira", "address" should return "No such property"");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +//Setup +var contacts = [ + { + "firstName": "Akira", + "lastName": "Laine", + "number": "0543236543", + "likes": ["Pizza", "Coding", "Brownie Points"] + }, + { + "firstName": "Harry", + "lastName": "Potter", + "number": "0994372684", + "likes": ["Hogwarts", "Magic", "Hagrid"] + }, + { + "firstName": "Sherlock", + "lastName": "Holmes", + "number": "0487345643", + "likes": ["Intriguing Cases", "Violin"] + }, + { + "firstName": "Kristian", + "lastName": "Vos", + "number": "unknown", + "likes": ["JavaScript", "Gaming", "Foxes"] + } +]; + + +function lookUpProfile(name, prop){ +// Only change code below this line + +// Only change code above this line +} + +// Change these values to test your function +lookUpProfile("Akira", "likes"); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/quoting-strings-with-single-quotes.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/quoting-strings-with-single-quotes.arabic.md new file mode 100644 index 0000000000..fa652819b6 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/quoting-strings-with-single-quotes.arabic.md @@ -0,0 +1,59 @@ +--- +id: 56533eb9ac21ba0edf2244b4 +title: Quoting Strings with Single Quotes +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(!/\\/g.test(code) && myStr.match("\\s*\\s*Link\\s*\\s*"), "Remove all the backslashes (\)");' + - text: '' + testString: 'assert(code.match(/"/g).length === 4 && code.match(/"/g).length === 2, "You should have two single quotes ' and four double quotes "");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +var myStr = "Link"; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/record-collection.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/record-collection.arabic.md new file mode 100644 index 0000000000..c544e15413 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/record-collection.arabic.md @@ -0,0 +1,106 @@ +--- +id: 56533eb9ac21ba0edf2244cf +title: Record Collection +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'collection = collectionCopy; assert(updateRecords(5439, "artist", "ABBA")[5439]["artist"] === "ABBA", "After updateRecords(5439, "artist", "ABBA"), artist should be "ABBA"");' + - text: '' + testString: 'assert(updateRecords(5439, "tracks", "Take a Chance on Me")[5439]["tracks"].pop() === "Take a Chance on Me", "After updateRecords(5439, "tracks", "Take a Chance on Me"), tracks should have "Take a Chance on Me" as the last element.");' + - text: '' + testString: 'updateRecords(2548, "artist", ""); assert(!collection[2548].hasOwnProperty("artist"), "After updateRecords(2548, "artist", ""), artist should not be set");' + - text: '' + testString: 'assert(updateRecords(1245, "tracks", "Addicted to Love")[1245]["tracks"].pop() === "Addicted to Love", "After updateRecords(1245, "tracks", "Addicted to Love"), tracks should have "Addicted to Love" as the last element.");' + - text: '' + testString: 'assert(updateRecords(2468, "tracks", "Free")[2468]["tracks"][0] === "1999", "After updateRecords(2468, "tracks", "Free"), tracks should have "1999" as the first element.");' + - text: '' + testString: 'updateRecords(2548, "tracks", ""); assert(!collection[2548].hasOwnProperty("tracks"), "After updateRecords(2548, "tracks", ""), tracks should not be set");' + - text: '' + testString: 'assert(updateRecords(1245, "album", "Riptide")[1245]["album"] === "Riptide", "After updateRecords(1245, "album", "Riptide"), album should be "Riptide"");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Setup +var collection = { + "2548": { + "album": "Slippery When Wet", + "artist": "Bon Jovi", + "tracks": [ + "Let It Rock", + "You Give Love a Bad Name" + ] + }, + "2468": { + "album": "1999", + "artist": "Prince", + "tracks": [ + "1999", + "Little Red Corvette" + ] + }, + "1245": { + "artist": "Robert Palmer", + "tracks": [ ] + }, + "5439": { + "album": "ABBA Gold" + } +}; +// Keep a copy of the collection for tests +var collectionCopy = JSON.parse(JSON.stringify(collection)); + +// Only change code below this line +function updateRecords(id, prop, value) { + + + return collection; +} + +// Alter values below to test your code +updateRecords(5439, "artist", "ABBA"); + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/replacing-if-else-chains-with-switch.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/replacing-if-else-chains-with-switch.arabic.md new file mode 100644 index 0000000000..244e21e8b2 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/replacing-if-else-chains-with-switch.arabic.md @@ -0,0 +1,88 @@ +--- +id: 56533eb9ac21ba0edf2244e0 +title: Replacing If Else Chains with Switch +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(!/else/g.test(code), "You should not use any else statements anywhere in the editor");' + - text: '' + testString: 'assert(!/if/g.test(code), "You should not use any if statements anywhere in the editor");' + - text: '' + testString: 'assert(code.match(/break/g).length >= 4, "You should have at least four break statements");' + - text: '' + testString: 'assert(chainToSwitch("bob") === "Marley", "chainToSwitch("bob") should be "Marley"");' + - text: '' + testString: 'assert(chainToSwitch(42) === "The Answer", "chainToSwitch(42) should be "The Answer"");' + - text: '' + testString: 'assert(chainToSwitch(1) === "There is no #1", "chainToSwitch(1) should be "There is no #1"");' + - text: '' + testString: 'assert(chainToSwitch(99) === "Missed me by this much!", "chainToSwitch(99) should be "Missed me by this much!"");' + - text: '' + testString: 'assert(chainToSwitch(7) === "Ate Nine", "chainToSwitch(7) should be "Ate Nine"");' + - text: '' + testString: 'assert(chainToSwitch("John") === "", "chainToSwitch("John") should be "" (empty string)");' + - text: '' + testString: 'assert(chainToSwitch(156) === "", "chainToSwitch(156) should be "" (empty string)");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function chainToSwitch(val) { + var answer = ""; + // Only change code below this line + + if (val === "bob") { + answer = "Marley"; + } else if (val === 42) { + answer = "The Answer"; + } else if (val === 1) { + answer = "There is no #1"; + } else if (val === 99) { + answer = "Missed me by this much!"; + } else if (val === 7) { + answer = "Ate Nine"; + } + + // Only change code above this line + return answer; +} + +// Change this value to test +chainToSwitch(7); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/return-a-value-from-a-function-with-return.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/return-a-value-from-a-function-with-return.arabic.md new file mode 100644 index 0000000000..a2391865d2 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/return-a-value-from-a-function-with-return.arabic.md @@ -0,0 +1,64 @@ +--- +id: 56533eb9ac21ba0edf2244c2 +title: Return a Value from a Function with Return +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(typeof timesFive === "function", "timesFive should be a function");' + - text: '' + testString: 'assert(timesFive(5) === 25, "timesFive(5) should return 25");' + - text: '' + testString: 'assert(timesFive(2) === 10, "timesFive(2) should return 10");' + - text: '' + testString: 'assert(timesFive(0) === 0, "timesFive(0) should return 0");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +function minusSeven(num) { + return num - 7; +} + +// Only change code below this line + + + +console.log(minusSeven(10)); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/return-early-pattern-for-functions.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/return-early-pattern-for-functions.arabic.md new file mode 100644 index 0000000000..35f911d48a --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/return-early-pattern-for-functions.arabic.md @@ -0,0 +1,71 @@ +--- +id: 56533eb9ac21ba0edf2244c4 +title: Return Early Pattern for Functions +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(typeof abTest(2,2) === "number" , "abTest(2,2) should return a number");' + - text: '' + testString: 'assert(abTest(2,2) === 8 , "abTest(2,2) should return 8");' + - text: '' + testString: 'assert(abTest(-2,2) === undefined , "abTest(-2,2) should return undefined");' + - text: '' + testString: 'assert(abTest(2,-2) === undefined , "abTest(2,-2) should return undefined");' + - text: '' + testString: 'assert(abTest(2,8) === 18 , "abTest(2,8) should return 18");' + - text: '' + testString: 'assert(abTest(3,3) === 12 , "abTest(3,3) should return 12");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Setup +function abTest(a, b) { + // Only change code below this line + + + + // Only change code above this line + + return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2)); +} + +// Change values below to test your code +abTest(2,2); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/returning-boolean-values-from-functions.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/returning-boolean-values-from-functions.arabic.md new file mode 100644 index 0000000000..327b23506a --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/returning-boolean-values-from-functions.arabic.md @@ -0,0 +1,63 @@ +--- +id: 5679ceb97cbaa8c51670a16b +title: Returning Boolean Values from Functions +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(isLess(10,15) === true, "isLess(10,15) should return true");' + - text: '' + testString: 'assert(isLess(15, 10) === false, "isLess(15,10) should return false");' + - text: '' + testString: 'assert(!/if|else/g.test(code), "You should not use any if or else statements");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function isLess(a, b) { + // Fix this code + if (a < b) { + return true; + } else { + return false; + } +} + +// Change these values to test +isLess(10, 15); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/selecting-from-many-options-with-switch-statements.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/selecting-from-many-options-with-switch-statements.arabic.md new file mode 100644 index 0000000000..ceb38d28c5 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/selecting-from-many-options-with-switch-statements.arabic.md @@ -0,0 +1,70 @@ +--- +id: 56533eb9ac21ba0edf2244dd +title: Selecting from Many Options with Switch Statements +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(caseInSwitch(1) === "alpha", "caseInSwitch(1) should have a value of "alpha"");' + - text: '' + testString: 'assert(caseInSwitch(2) === "beta", "caseInSwitch(2) should have a value of "beta"");' + - text: '' + testString: 'assert(caseInSwitch(3) === "gamma", "caseInSwitch(3) should have a value of "gamma"");' + - text: '' + testString: 'assert(caseInSwitch(4) === "delta", "caseInSwitch(4) should have a value of "delta"");' + - text: '' + testString: 'assert(!/else/g.test(code) || !/if/g.test(code), "You should not use any if or else statements");' + - text: '' + testString: 'assert(code.match(/break/g).length > 2, "You should have at least 3 break statements");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function caseInSwitch(val) { + var answer = ""; + // Only change code below this line + + + + // Only change code above this line + return answer; +} + +// Change this value to test +caseInSwitch(1); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/shopping-list.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/shopping-list.arabic.md new file mode 100644 index 0000000000..f2268b74f6 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/shopping-list.arabic.md @@ -0,0 +1,63 @@ +--- +id: 56533eb9ac21ba0edf2244bc +title: Shopping List +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(isArray, "myList should be an array");' + - text: '' + testString: 'assert(hasString, "The first elements in each of your sub-arrays must all be strings");' + - text: '' + testString: 'assert(hasNumber, "The second elements in each of your sub-arrays must all be numbers");' + - text: '' + testString: 'assert(count > 4, "You must have at least 5 items in your list");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +var myList = []; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/stand-in-line.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/stand-in-line.arabic.md new file mode 100644 index 0000000000..8ae8db7d80 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/stand-in-line.arabic.md @@ -0,0 +1,105 @@ +--- +id: 56533eb9ac21ba0edf2244c6 +title: Stand in Line +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert.isNumber(nextInLine([],5), "nextInLine([], 5) should return a number.");' + - text: '' + testString: 'assert(nextInLine([],1) === 1, "nextInLine([], 1) should return 1");' + - text: '' + testString: 'assert(nextInLine([2],1) === 2, "nextInLine([2], 1) should return 2");' + - text: '' + testString: 'assert(nextInLine([5,6,7,8,9],1) === 5, "nextInLine([5,6,7,8,9], 1) should return 5");' + - text: '' + testString: 'nextInLine(testArr, 10); assert(testArr[4] === 10, "After nextInLine(testArr, 10), testArr[4] should be 10");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function nextInLine(arr, item) { + // Your code here + + return item; // Change this line +} + +// Test Setup +var testArr = [1,2,3,4,5]; + +// Display Code +console.log("Before: " + JSON.stringify(testArr)); +console.log(nextInLine(testArr, 6)); // Modify this line to test +console.log("After: " + JSON.stringify(testArr)); + +``` + +
+ +### Before Test +
+ +```js +var logOutput = []; +var originalConsole = console +function capture() { + var nativeLog = console.log; + console.log = function (message) { + logOutput.push(message); + if(nativeLog.apply) { + nativeLog.apply(originalConsole, arguments); + } else { + var nativeMsg = Array.prototype.slice.apply(arguments).join(' '); + nativeLog(nativeMsg); + } + }; +} + +function uncapture() { + console.log = originalConsole.log; +} + +capture(); + +``` + +
+ +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/store-multiple-values-in-one-variable-using-javascript-arrays.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/store-multiple-values-in-one-variable-using-javascript-arrays.arabic.md new file mode 100644 index 0000000000..ff911c6cd9 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/store-multiple-values-in-one-variable-using-javascript-arrays.arabic.md @@ -0,0 +1,65 @@ +--- +id: bd7993c9c69feddfaeb8bdef +title: Store Multiple Values in one Variable using JavaScript Arrays +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(typeof myArray == "object", "myArray should be an array.");' + - text: '' + testString: 'assert(typeof myArray[0] !== "undefined" && typeof myArray[0] == "string", "The first item in myArray should be a string.");' + - text: '' + testString: 'assert(typeof myArray[1] !== "undefined" && typeof myArray[1] == "number", "The second item in myArray should be a number.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var ourArray = ["John", 23]; + +// Only change code below this line. +var myArray = []; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/storing-values-with-the-assignment-operator.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/storing-values-with-the-assignment-operator.arabic.md new file mode 100644 index 0000000000..790545ada2 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/storing-values-with-the-assignment-operator.arabic.md @@ -0,0 +1,81 @@ +--- +id: 56533eb9ac21ba0edf2244a8 +title: Storing Values with the Assignment Operator +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(/var a;/.test(code) && /var b = 2;/.test(code), "Do not change code above the line");' + - text: '' + testString: 'assert(typeof a === "number" && a === 7, "a should have a value of 7");' + - text: '' + testString: 'assert(typeof b === "number" && b === 7, "b should have a value of 7");' + - text: '' + testString: 'assert(/b\s*=\s*a\s*;/g.test(code), "a should be assigned to b with =");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Setup +var a; +var b = 2; + +// Only change code below this line + +``` + +
+ +### Before Test +
+ +```js +if (typeof a != 'undefined') { + a = undefined; +} +if (typeof b != 'undefined') { + b = undefined; +} + +``` + +
+ +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/subtract-one-number-from-another-with-javascript.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/subtract-one-number-from-another-with-javascript.arabic.md new file mode 100644 index 0000000000..b47ae3e449 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/subtract-one-number-from-another-with-javascript.arabic.md @@ -0,0 +1,59 @@ +--- +id: cf1111c1c11feddfaeb4bdef +title: Subtract One Number from Another with JavaScript +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(difference === 12, "Make the variable difference equal 12.");' + - text: '' + testString: 'assert(/var\s*difference\s*=\s*45\s*-\s*[0-9]*;(?!\s*[a-zA-Z0-9]+)/.test(code),"Only subtract one number from 45.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +var difference = 45 - 0; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/testing-objects-for-properties.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/testing-objects-for-properties.arabic.md new file mode 100644 index 0000000000..54c8107d1d --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/testing-objects-for-properties.arabic.md @@ -0,0 +1,67 @@ +--- +id: 567af2437cbaa8c51670a16c +title: Testing Objects for Properties +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(checkObj("gift") === "pony", "checkObj("gift") should return "pony".");' + - text: '' + testString: 'assert(checkObj("pet") === "kitten", "checkObj("pet") should return "kitten".");' + - text: '' + testString: 'assert(checkObj("house") === "Not Found", "checkObj("house") should return "Not Found".");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Setup +var myObj = { + gift: "pony", + pet: "kitten", + bed: "sleigh" +}; + +function checkObj(checkProp) { + // Your Code Here + + return "Change Me!"; +} + +// Test your code by modifying these values +checkObj("gift"); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/understand-string-immutability.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/understand-string-immutability.arabic.md new file mode 100644 index 0000000000..dd81f41973 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/understand-string-immutability.arabic.md @@ -0,0 +1,64 @@ +--- +id: 56533eb9ac21ba0edf2244ba +title: Understand String Immutability +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(myStr === "Hello World", "myStr should have a value of Hello World");' + - text: '' + testString: 'assert(/myStr = "Jello World"/.test(code), "Do not change the code above the line");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Setup +var myStr = "Jello World"; + +// Only change code below this line + +myStr[0] = "H"; // Fix Me + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-boolean-values.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-boolean-values.arabic.md new file mode 100644 index 0000000000..850d3d2d92 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-boolean-values.arabic.md @@ -0,0 +1,66 @@ +--- +id: bd7123c9c441eddfaeb5bdef +title: Understanding Boolean Values +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(typeof welcomeToBooleans() === "boolean", "The welcomeToBooleans() function should return a boolean (true/false) value.");' + - text: '' + testString: 'assert(welcomeToBooleans() === true, "welcomeToBooleans() should return true.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function welcomeToBooleans() { + +// Only change code below this line. + +return false; // Change this line + +// Only change code above this line. +} + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-case-sensitivity-in-variables.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-case-sensitivity-in-variables.arabic.md new file mode 100644 index 0000000000..b5024b57a5 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-case-sensitivity-in-variables.arabic.md @@ -0,0 +1,67 @@ +--- +id: 56533eb9ac21ba0edf2244ab +title: Understanding Case Sensitivity in Variables +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(typeof studlyCapVar !== "undefined" && studlyCapVar === 10, "studlyCapVar is defined and has a value of 10");' + - text: '' + testString: 'assert(typeof properCamelCase !== "undefined" && properCamelCase === "A String", "properCamelCase is defined and has a value of "A String"");' + - text: '' + testString: 'assert(typeof titleCaseOver !== "undefined" && titleCaseOver === 9000, "titleCaseOver is defined and has a value of 9000");' + - text: '' + testString: 'assert(code.match(/studlyCapVar/g).length === 2, "studlyCapVar should use camelCase in both declaration and assignment sections.");' + - text: '' + testString: 'assert(code.match(/properCamelCase/g).length === 2, "properCamelCase should use camelCase in both declaration and assignment sections.");' + - text: '' + testString: 'assert(code.match(/titleCaseOver/g).length === 2, "titleCaseOver should use camelCase in both declaration and assignment sections.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Declarations +var StUdLyCapVaR; +var properCamelCase; +var TitleCaseOver; + +// Assignments +STUDLYCAPVAR = 10; +PRoperCAmelCAse = "A String"; +tITLEcASEoVER = 9000; + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-undefined-value-returned-from-a-function.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-undefined-value-returned-from-a-function.arabic.md new file mode 100644 index 0000000000..7f5222f25b --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-undefined-value-returned-from-a-function.arabic.md @@ -0,0 +1,74 @@ +--- +id: 598e8944f009e646fc236146 +title: Understanding Undefined Value returned from a Function +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(typeof addFive === "function", "addFive should be a function");' + - text: '' + testString: 'assert(sum === 8, "sum should be equal to 8");' + - text: '' + testString: 'assert(addFive() === undefined, "Returned value from addFive should be undefined");' + - text: '' + testString: 'assert(code.match(/(sum\s*\=\s*sum\s*\+\s*5)|(sum\s*\+\=\s*5)/g).length === 1, "Inside of your functions, add 5 to the sum variable");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var sum = 0; +function addThree() { + sum = sum + 3; +} + +// Only change code below this line + + + +// Only change code above this line +var returnedValue = addFive(); + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-uninitialized-variables.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-uninitialized-variables.arabic.md new file mode 100644 index 0000000000..687bbf479e --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-uninitialized-variables.arabic.md @@ -0,0 +1,72 @@ +--- +id: 56533eb9ac21ba0edf2244aa +title: Understanding Uninitialized Variables +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(typeof a === "number" && a === 6, "a should be defined and evaluated to have the value of 6");' + - text: '' + testString: 'assert(typeof b === "number" && b === 15, "b should be defined and evaluated to have the value of 15");' + - text: '' + testString: 'assert(!/undefined/.test(c) && c === "I am a String!", "c should not contain undefined and should have a value of "I am a String!"");' + - text: '' + testString: 'assert(/a = a \+ 1;/.test(code) && /b = b \+ 5;/.test(code) && /c = c \+ " String!";/.test(code), "Do not change code below the line");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Initialize these three variables +var a; +var b; +var c; + +// Do not change code below this line + +a = a + 1; +b = b + 5; +c = c + " String!"; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/updating-object-properties.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/updating-object-properties.arabic.md new file mode 100644 index 0000000000..9d02c9b131 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/updating-object-properties.arabic.md @@ -0,0 +1,77 @@ +--- +id: 56bbb991ad1ed5201cd392d1 +title: Updating Object Properties +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(/happy coder/gi.test(myDog.name), "Update myDog's "name" property to equal "Happy Coder".");' + - text: '' + testString: 'assert(/"name": "Coder"/.test(code), "Do not edit the myDog definition");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var ourDog = { + "name": "Camper", + "legs": 4, + "tails": 1, + "friends": ["everything!"] +}; + +ourDog.name = "Happy Camper"; + +// Setup +var myDog = { + "name": "Coder", + "legs": 4, + "tails": 1, + "friends": ["freeCodeCamp Campers"] +}; + +// Only change code below this line. + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-first-character-in-a-string.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-first-character-in-a-string.arabic.md new file mode 100644 index 0000000000..e332e4296b --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-first-character-in-a-string.arabic.md @@ -0,0 +1,70 @@ +--- +id: bd7123c9c549eddfaeb5bdef +title: Use Bracket Notation to Find the First Character in a String +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(firstLetterOfLastName === "L", "The firstLetterOfLastName variable should have the value of L.");' + - text: '' + testString: 'assert(code.match(/firstLetterOfLastName\s*?=\s*?lastName\[.*?\]/), "You should use bracket notation.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var firstLetterOfFirstName = ""; +var firstName = "Ada"; + +firstLetterOfFirstName = firstName[0]; + +// Setup +var firstLetterOfLastName = ""; +var lastName = "Lovelace"; + +// Only change code below this line +firstLetterOfLastName = lastName; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-last-character-in-a-string.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-last-character-in-a-string.arabic.md new file mode 100644 index 0000000000..c0f31ccf95 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-last-character-in-a-string.arabic.md @@ -0,0 +1,67 @@ +--- +id: bd7123c9c451eddfaeb5bdef +title: Use Bracket Notation to Find the Last Character in a String +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(lastLetterOfLastName === "e", "lastLetterOfLastName should be "e".");' + - text: '' + testString: 'assert(code.match(/\.length/g).length === 2, "You have to use .length to get the last letter.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var firstName = "Ada"; +var lastLetterOfFirstName = firstName[firstName.length - 1]; + +// Setup +var lastName = "Lovelace"; + +// Only change code below this line. +var lastLetterOfLastName = lastName; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-nth-character-in-a-string.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-nth-character-in-a-string.arabic.md new file mode 100644 index 0000000000..1ac925dff9 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-nth-character-in-a-string.arabic.md @@ -0,0 +1,67 @@ +--- +id: bd7123c9c450eddfaeb5bdef +title: Use Bracket Notation to Find the Nth Character in a String +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(thirdLetterOfLastName === "v", "The thirdLetterOfLastName variable should have the value of v.");' + - text: '' + testString: 'assert(code.match(/thirdLetterOfLastName\s*?=\s*?lastName\[.*?\]/), "You should use bracket notation.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var firstName = "Ada"; +var secondLetterOfFirstName = firstName[1]; + +// Setup +var lastName = "Lovelace"; + +// Only change code below this line. +var thirdLetterOfLastName = lastName; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-nth-to-last-character-in-a-string.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-nth-to-last-character-in-a-string.arabic.md new file mode 100644 index 0000000000..3f5f6d2449 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-nth-to-last-character-in-a-string.arabic.md @@ -0,0 +1,67 @@ +--- +id: bd7123c9c452eddfaeb5bdef +title: Use Bracket Notation to Find the Nth-to-Last Character in a String +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(secondToLastLetterOfLastName === "c", "secondToLastLetterOfLastName should be "c".");' + - text: '' + testString: 'assert(code.match(/\.length/g).length === 2, "You have to use .length to get the second last letter.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +var firstName = "Ada"; +var thirdToLastLetterOfFirstName = firstName[firstName.length - 3]; + +// Setup +var lastName = "Lovelace"; + +// Only change code below this line +var secondToLastLetterOfLastName = lastName; + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-conditional-logic-with-if-statements.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-conditional-logic-with-if-statements.arabic.md new file mode 100644 index 0000000000..e312cf4225 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-conditional-logic-with-if-statements.arabic.md @@ -0,0 +1,77 @@ +--- +id: cf1111c1c12feddfaeb3bdef +title: Use Conditional Logic with If Statements +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(typeof trueOrFalse === "function", "trueOrFalse should be a function");' + - text: '' + testString: 'assert(typeof trueOrFalse(true) === "string", "trueOrFalse(true) should return a string");' + - text: '' + testString: 'assert(typeof trueOrFalse(false) === "string", "trueOrFalse(false) should return a string");' + - text: '' + testString: 'assert(trueOrFalse(true) === "Yes, that was true", "trueOrFalse(true) should return "Yes, that was true"");' + - text: '' + testString: 'assert(trueOrFalse(false) === "No, that was false", "trueOrFalse(false) should return "No, that was false"");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +function ourTrueOrFalse(isItTrue) { + if (isItTrue) { + return "Yes, it's true"; + } + return "No, it's false"; +} + +// Setup +function trueOrFalse(wasThatTrue) { + + // Only change code below this line. + + + + // Only change code above this line. + +} + +// Change this value to test +trueOrFalse(true); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-multiple-conditional-ternary-operators.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-multiple-conditional-ternary-operators.arabic.md new file mode 100644 index 0000000000..7faf8e162f --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-multiple-conditional-ternary-operators.arabic.md @@ -0,0 +1,59 @@ +--- +id: 587d7b7e367417b2b2512b21 +title: Use Multiple Conditional (Ternary) Operators +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(/.+?\s*?\?\s*?.+?\s*?:\s*?.+?\s*?\?\s*?.+?\s*?:\s*?.+?/gi.test(code), "checkSign should use multiple conditional operators");' + - text: '' + testString: 'assert(checkSign(10) === "positive", "checkSign(10) should return "positive". Note that capitalization matters");' + - text: '' + testString: 'assert(checkSign(-12) === "negative", "checkSign(-12) should return "negative". Note that capitalization matters");' + - text: '' + testString: 'assert(checkSign(0) === "zero", "checkSign(0) should return "zero". Note that capitalization matters");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function checkSign(num) { + +} + +checkSign(10); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-the-conditional-ternary-operator.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-the-conditional-ternary-operator.arabic.md new file mode 100644 index 0000000000..b2e854bb5e --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-the-conditional-ternary-operator.arabic.md @@ -0,0 +1,59 @@ +--- +id: 587d7b7e367417b2b2512b24 +title: Use the Conditional (Ternary) Operator +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(/.+?\s*?\?\s*?.+?\s*?:\s*?.+?/gi.test(code), "checkEqual should use the conditional operator");' + - text: '' + testString: 'assert(checkEqual(1, 2) === false, "checkEqual(1, 2) should return false");' + - text: '' + testString: 'assert(checkEqual(1, 1) === true, "checkEqual(1, 1) should return true");' + - text: '' + testString: 'assert(checkEqual(1, -1) === false, "checkEqual(1, -1) should return false");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function checkEqual(a, b) { + +} + +checkEqual(1, 2); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-the-parseint-function-with-a-radix.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-the-parseint-function-with-a-radix.arabic.md new file mode 100644 index 0000000000..16e7c16a47 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-the-parseint-function-with-a-radix.arabic.md @@ -0,0 +1,61 @@ +--- +id: 587d7b7e367417b2b2512b22 +title: Use the parseInt Function with a Radix +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(/parseInt/g.test(code), "convertToInteger should use the parseInt() function");' + - text: '' + testString: 'assert(typeof(convertToInteger("10011")) === "number", "convertToInteger("10011") should return a number");' + - text: '' + testString: 'assert(convertToInteger("10011") === 19, "convertToInteger("10011") should return 19");' + - text: '' + testString: 'assert(convertToInteger("111001") === 57, "convertToInteger("111001") should return 57");' + - text: '' + testString: 'assert.isNaN(convertToInteger("JamesBond"), "convertToInteger("JamesBond") should return NaN");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function convertToInteger(str) { + +} + +convertToInteger("10011"); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-the-parseint-function.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-the-parseint-function.arabic.md new file mode 100644 index 0000000000..643f5da665 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/use-the-parseint-function.arabic.md @@ -0,0 +1,61 @@ +--- +id: 587d7b7e367417b2b2512b23 +title: Use the parseInt Function +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(/parseInt/g.test(code), "convertToInteger should use the parseInt() function");' + - text: '' + testString: 'assert(typeof(convertToInteger("56")) === "number", "convertToInteger("56") should return a number");' + - text: '' + testString: 'assert(convertToInteger("56") === 56, "convertToInteger("56") should return 56");' + - text: '' + testString: 'assert(convertToInteger("77") === 77, "convertToInteger("77") should return 77");' + - text: '' + testString: 'assert.isNaN(convertToInteger("JamesBond"), "convertToInteger("JamesBond") should return NaN");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function convertToInteger(str) { + +} + +convertToInteger("56"); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/using-objects-for-lookups.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/using-objects-for-lookups.arabic.md new file mode 100644 index 0000000000..c3311c0f3b --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/using-objects-for-lookups.arabic.md @@ -0,0 +1,95 @@ +--- +id: 56533eb9ac21ba0edf2244ca +title: Using Objects for Lookups +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(phoneticLookup("alpha") === "Adams", "phoneticLookup("alpha") should equal "Adams"");' + - text: '' + testString: 'assert(phoneticLookup("bravo") === "Boston", "phoneticLookup("bravo") should equal "Boston"");' + - text: '' + testString: 'assert(phoneticLookup("charlie") === "Chicago", "phoneticLookup("charlie") should equal "Chicago"");' + - text: '' + testString: 'assert(phoneticLookup("delta") === "Denver", "phoneticLookup("delta") should equal "Denver"");' + - text: '' + testString: 'assert(phoneticLookup("echo") === "Easy", "phoneticLookup("echo") should equal "Easy"");' + - text: '' + testString: 'assert(phoneticLookup("foxtrot") === "Frank", "phoneticLookup("foxtrot") should equal "Frank"");' + - text: '' + testString: 'assert(typeof phoneticLookup("") === "undefined", "phoneticLookup("") should equal undefined");' + - text: '' + testString: 'assert(code.match(/return\sresult;/), "You should not modify the return statement");' + - text: '' + testString: 'assert(!/case|switch|if/g.test(code.replace(/([/]{2}.*)|([/][*][^/*]*[*][/])/g,"")), "You should not use case, switch, or if statements"); ' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Setup +function phoneticLookup(val) { + var result = ""; + + // Only change code below this line + switch(val) { + case "alpha": + result = "Adams"; + break; + case "bravo": + result = "Boston"; + break; + case "charlie": + result = "Chicago"; + break; + case "delta": + result = "Denver"; + break; + case "echo": + result = "Easy"; + break; + case "foxtrot": + result = "Frank"; + } + + // Only change code above this line + return result; +} + +// Change this value to test +phoneticLookup("charlie"); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/word-blanks.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/word-blanks.arabic.md new file mode 100644 index 0000000000..4fdd975f37 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/word-blanks.arabic.md @@ -0,0 +1,70 @@ +--- +id: 56533eb9ac21ba0edf2244bb +title: Word Blanks +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(typeof wordBlanks("","","","") === "string", "wordBlanks("","","","") should return a string.");' + - text: '' + testString: 'assert(/\bdog\b/.test(test1) && /\bbig\b/.test(test1) && /\bran\b/.test(test1) && /\bquickly\b/.test(test1),"wordBlanks("dog", "big", "ran", "quickly") should contain all of the passed in words separated by non-word characters (and any additional words in your madlib).");' + - text: '' + testString: 'assert(/\bcat\b/.test(test2) && /\blittle\b/.test(test2) && /\bhit\b/.test(test2) && /\bslowly\b/.test(test2),"wordBlanks("cat", "little", "hit", "slowly") should contain all of the passed in words separated by non-word characters (and any additional words in your madlib).");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) { + // Your code below this line + var result = ""; + + // Your code above this line + return result; +} + +// Change the words here to test your function +wordBlanks("dog", "big", "ran", "quickly"); + +``` + +
+ + +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/write-reusable-javascript-with-functions.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/write-reusable-javascript-with-functions.arabic.md new file mode 100644 index 0000000000..e26fa189b3 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/write-reusable-javascript-with-functions.arabic.md @@ -0,0 +1,96 @@ +--- +id: 56bbb991ad1ed5201cd392cf +title: Write Reusable JavaScript with Functions +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(typeof reusableFunction === "function", "reusableFunction should be a function");' + - text: '' + testString: 'assert("Hi World" === logOutput, "reusableFunction should output "Hi World" to the dev console");' + - text: '' + testString: 'assert(/^\s*reusableFunction\(\)\s*;/m.test(code), "Call reusableFunction after you define it");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Example +function ourReusableFunction() { + console.log("Heyya, World"); +} + +ourReusableFunction(); + +// Only change code below this line + +``` + +
+ +### Before Test +
+ +```js +var logOutput = ""; +var originalConsole = console +function capture() { + var nativeLog = console.log; + console.log = function (message) { + if(message && message.trim) logOutput = message.trim(); + if(nativeLog.apply) { + nativeLog.apply(originalConsole, arguments); + } else { + var nativeMsg = Array.prototype.slice.apply(arguments).join(' '); + nativeLog(nativeMsg); + } + }; +} + +function uncapture() { + console.log = originalConsole.log; +} + +capture(); + +``` + +
+ +### After Test +
+ +```js +console.info('after the test'); +``` + +
+ +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/catch-arguments-passed-in-the-wrong-order-when-calling-a-function.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/catch-arguments-passed-in-the-wrong-order-when-calling-a-function.arabic.md new file mode 100644 index 0000000000..09e930b8b6 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/catch-arguments-passed-in-the-wrong-order-when-calling-a-function.arabic.md @@ -0,0 +1,58 @@ +--- +id: 587d7b85367417b2b2512b3a +title: Catch Arguments Passed in the Wrong Order When Calling a Function +challengeType: 1 +videoUrl: '' +localeTitle: Catch Arguments Passed in the Wrong Order When Calling a Function +--- + +## Description +
استمرار المناقشة حول وظائف الاستدعاء ، فإن الخطأ التالي الذي يجب الانتباه إليه هو عندما يتم توفير وسيطات الدالة بترتيب غير صحيح. إذا كانت الوسيطات هي أنواع مختلفة ، مثل دالة تتوقع مصفوفة وعددًا صحيحًا ، فمن المحتمل أن يؤدي ذلك إلى حدوث خطأ في وقت التشغيل. إذا كانت الوسيطات من نفس النوع (كل الأعداد الصحيحة ، على سبيل المثال) ، فإن منطق الكود لن يكون ذا معنى. تأكد من توفير جميع الحجج المطلوبة ، بالترتيب الصحيح لتجنب هذه المشاكل.
+ +## Instructions +
ترفع الدالة raiseToPower قاعدة إلى الأس. للأسف ، لا يتم استدعائه بشكل صحيح - قم بإصلاح الكود بحيث تكون قيمة power المتوقعة 8.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تحدد شفرتك power المتغيرة بحيث تساوي 2 مرفوعة إلى الطاقة الثالثة ، وليس 3 مرفوعة إلى الطاقة الثانية. + testString: 'assert(power == 8, "Your code should fix the variable power so it equals 2 raised to the 3rd power, not 3 raised to the 2nd power.");' + - text: يجب أن تستخدم التعليمة البرمجية الخاصة بك الترتيب الصحيح للوسيطات الخاصة raiseToPower وظيفة raiseToPower . + testString: 'assert(code.match(/raiseToPower\(\s*?base\s*?,\s*?exp\s*?\);/g), "Your code should use the correct order of the arguments for the raiseToPower function call.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function raiseToPower(b, e) { + return Math.pow(b, e); +} + +let base = 2; +let exp = 3; +let power = raiseToPower(exp, base); +console.log(power); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/catch-missing-open-and-closing-parenthesis-after-a-function-call.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/catch-missing-open-and-closing-parenthesis-after-a-function-call.arabic.md new file mode 100644 index 0000000000..2bc44bcbc5 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/catch-missing-open-and-closing-parenthesis-after-a-function-call.arabic.md @@ -0,0 +1,58 @@ +--- +id: 587d7b85367417b2b2512b39 +title: Catch Missing Open and Closing Parenthesis After a Function Call +challengeType: 1 +videoUrl: '' +localeTitle: الصيد المفقود وأشرطة الاختتام المفتوحة بعد استدعاء وظيفة +--- + +## Description +
عندما لا تأخذ وظيفة أو طريقة أي حجج ، قد تنسى تضمين أقواس الفتح والإغلاق (الفارغة) عند الاتصال بها. في كثير من الأحيان يتم حفظ نتيجة استدعاء دالة في متغير لاستخدام أخرى في التعليمات البرمجية. يمكن الكشف عن هذا الخطأ عن طريق تسجيل قيم المتغير (أو أنواعها) إلى وحدة التحكم ورؤية أنه يتم تعيين واحد إلى مرجع دالة ، بدلاً من القيمة المتوقعة التي ترجعها الدالة. تختلف المتغيرات في المثال التالي:
وظيفة myFunction () {
"أنت صخرة!"
}
السماح varOne = myFunction. // set to equal a a function
اترك varTwo = myFunction ()؛ // set يساوي السلسلة "You rock!"
+ +## Instructions +
قم getNine الكود بحيث يتم تعيين result المتغير إلى القيمة التي يتم إرجاعها من استدعاء الدالة getNine .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تقوم التعليمات البرمجية الخاصة بك بإصلاح result المتغيرة بحيث يتم تعيينها إلى الرقم الذي ترجع الدالة getNine . + testString: 'assert(result == 9, "Your code should fix the variable result so it is set to the number that the function getNine returns.");' + - text: يجب أن تقوم التعليمات البرمجية الخاصة بك باستدعاء الدالة getNine . + testString: 'assert(code.match(/getNine\(\)/g).length == 2, "Your code should call the getNine function.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function getNine() { + let x = 6; + let y = 3; + return x + y; +} + +let result = getNine; +console.log(result); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/catch-misspelled-variable-and-function-names.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/catch-misspelled-variable-and-function-names.arabic.md new file mode 100644 index 0000000000..9a6e9ba366 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/catch-misspelled-variable-and-function-names.arabic.md @@ -0,0 +1,60 @@ +--- +id: 587d7b84367417b2b2512b35 +title: Catch Misspelled Variable and Function Names +challengeType: 1 +videoUrl: '' +localeTitle: القبض على المتغيرات التي بها أخطاء في الأسماء والأسماء الدالة +--- + +## Description +
تعتبر أساليب console.log() و typeof هما طريقتان أساسيتان للتحقق من القيم المتوسطة وأنواع مخرجات البرنامج. الآن حان الوقت للوصول إلى الأشكال الشائعة التي تتخذها الحشرات. هناك مشكلة واحدة في بناء الجملة يمكن أن تتطابق معها الطابعات السريعة مع الخطأ الإملائي المتواضع. الأحرف المستعرضة أو المفقودة أو غير المكتوبة بطريقة خاطئة في متغير أو اسم وظيفي سوف يبحث المتصفح عن كائن غير موجود - ويشكو في شكل خطأ مرجعي. متغير جافا سكريبت وأسماء الدالة حساسة لحالة الأحرف.
+ +## Instructions +
قم netWorkingCapital الإملائيين في التعليمات البرمجية بحيث يعمل الحساب netWorkingCapital .
+ +## Tests +
+ +```yml +tests: + - text: 'تحقق من هجاء المتغيرين المستخدم في حساب netWorkingCapital ، يجب أن يظهر إخراج وحدة التحكم "صافي رأس المال العامل هو: 2".' + testString: 'assert(netWorkingCapital === 2, "Check the spelling of the two variables used in the netWorkingCapital calculation, the console output should show that "Net working capital is: 2".");' + - text: يجب ألا تكون هناك حالات من متغيرات غير صحيحة في التعليمة البرمجية. + testString: 'assert(!code.match(/recievables/g), "There should be no instances of mis-spelled variables in the code.");' + - text: يجب الإعلان عن متغير receivables واستخدامه بشكل صحيح في الشفرة. + testString: 'assert(code.match(/receivables/g).length == 2, "The receivables variable should be declared and used properly in the code.");' + - text: يجب ألا تكون هناك حالات من متغيرات غير صحيحة في التعليمة البرمجية. + testString: 'assert(!code.match(/payable;/g), "There should be no instances of mis-spelled variables in the code.");' + - text: يجب الإعلان عن متغير payables واستخدامه بشكل صحيح في الشفرة. + testString: 'assert(code.match(/payables/g).length == 2, "The payables variable should be declared and used properly in the code.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +let receivables = 10; +let payables = 8; +let netWorkingCapital = recievables - payable; +console.log(`Net working capital is: ${netWorkingCapital}`); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/catch-mixed-usage-of-single-and-double-quotes.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/catch-mixed-usage-of-single-and-double-quotes.arabic.md new file mode 100644 index 0000000000..7025d64a7a --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/catch-mixed-usage-of-single-and-double-quotes.arabic.md @@ -0,0 +1,52 @@ +--- +id: 587d7b84367417b2b2512b37 +title: Catch Mixed Usage of Single and Double Quotes +challengeType: 1 +videoUrl: '' +localeTitle: قبض على الاستخدام المختلط من أسعار مفردة ومزدوجة +--- + +## Description +
تسمح جافا سكريبت باستخدام كل من الاقتباس الفردي ("") والمزدوج ("") لإعلان سلسلة. إن تحديد أي واحد يستخدم بشكل عام يعود إلى التفضيل الشخصي ، مع بعض الاستثناءات. وجود خيارين يكونان رائعين عند وجود سلسلة أو تقلصات أخرى. جزء من النص الموجود بين علامتي اقتباس ، ولكن عليك أن تكون حريصًا على عدم إغلاق السلسلة مبكرًا ، مما يؤدي إلى حدوث خطأ في بناء الجملة. في ما يلي بعض الأمثلة لخلط علامات التنصيص:
// هذه صحيحة:
const grouchoContraction = "لقد أمضيت أمسية رائعة ، لكن هذا لم يكن كذلك."؛
const quoteInString = "قال غروشو ماركس ذات مرة" اقتبسني قائلا: "لقد تم اقتباس أسئتي".
// هذا غير صحيح:
const uhOhGroucho = 'لقد أمضيت أمسية رائعة ، لكن هذا لم يكن كذلك.'؛
بالطبع ، لا بأس من استخدام نمط واحد فقط من علامات الاقتباس. يمكنك الهروب من علامات الاقتباس داخل السلسلة باستخدام حرف الهروب الخط المائل للخلف (\):
// الاستخدام الصحيح لنفس الأسعار:
const allSameQuotes = 'لقد كان لي أمسية رائعة ، ولكن هذا لم يكن كذلك.'؛
+ +## Instructions +
أصلح السلسلة بحيث تستخدم إما علامات اقتباس مختلفة لقيمة href ، أو تهرب منها. احتفظ بعلامات الاقتباس المزدوجة حول السلسلة بأكملها.
+ +## Tests +
+ +```yml +tests: + - text: 'يجب أن تحدد شفرتك علامات الاقتباس حول قيمة href "# Home" إما بتغييرها أو الهروب منها.' + testString: 'assert(code.match(//g), "Your code should fix the quotes around the href value "#Home" by either changing or escaping them.");' + - text: يجب أن تحتفظ شفرتك بالعلامات المزدوجة حول السلسلة بأكملها. + testString: 'assert(code.match(/"

.*?<\/p>";/g), "Your code should keep the double quotes around the entire string.");' + +``` + +

+ +## Challenge Seed +
+ +
+ +```js +let innerHtml = "

Click here to return home

"; +console.log(innerHtml); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/catch-off-by-one-errors-when-using-indexing.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/catch-off-by-one-errors-when-using-indexing.arabic.md new file mode 100644 index 0000000000..2f4a330b68 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/catch-off-by-one-errors-when-using-indexing.arabic.md @@ -0,0 +1,65 @@ +--- +id: 587d7b86367417b2b2512b3b +title: Catch Off By One Errors When Using Indexing +challengeType: 1 +videoUrl: '' +localeTitle: القبض عن طريق واحدة من الأخطاء عند استخدام الفهرسة +--- + +## Description +
Off by one errors (تسمى أحيانًا OBOE) عند محاولة استهداف فهرس معين لسلسلة أو صفيف (لتقسيم شريحة أو الوصول إليها) ، أو عند التكرار فوق مؤشراتها. تبدأ فهرسة جافا سكريبت في الصفر ، وليس واحدة ، مما يعني أن الفهرس الأخير يكون دائمًا أقل من طول العنصر. إذا حاولت الوصول إلى فهرس مساوٍ للطول ، فقد يلقي البرنامج خطأ مرجع "فهرسة خارج النطاق" أو يطبع undefined . عند استخدام سلسلة أو طرق صفيف تأخذ نطاقات الفهرس كوسيطة ، فإنها تساعد على قراءة الوثائق وفهم ما إذا كانت شاملة (العنصر الموجود في الفهرس المعين هو جزء مما تم إرجاعه) أم لا. في ما يلي بعض الأمثلة على أخطاء واحدة:
let alphabet = "abcdefghijklmnopqrstuvwxyz"؛
دعونا لين = alphabet.length.
لـ (let i = 0؛ i <= len؛ i ++) {
// حلقات واحدة عدة مرات في النهاية
console.log (الأبجدية [أنا])؛
}
لـ (let j = 1؛ j <len؛ j ++) {
// يكرر مرات قليلة جدًا ويفتقد الحرف الأول في الفهرس 0
console.log (الأبجدية [ي])؛
}
لـ (let k = 0؛ k <len؛ k ++) {
// يوافق Goldilocks - وهذا هو الصحيح
console.log (الأبجدية [ك])؛
}
+ +## Instructions +
إصلاح أخطاء الفهرسة في الدالة التالية بحيث يتم طباعة كافة الأرقام من 1 إلى 5 إلى وحدة التحكم.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تقوم التعليمات البرمجية بتعيين الشرط الأولي للحلقة بحيث يبدأ في الفهرس الأول. + testString: 'assert(code.match(/i\s*?=\s*?0\s*?;/g).length == 1, "Your code should set the initial condition of the loop so it starts at the first index.");' + - text: يجب أن تقوم التعليمات البرمجية الخاصة بك بإصلاح الشرط الأولي للحلقة بحيث يبدأ الفهرس عند 0. + testString: 'assert(!code.match(/i\s?=\s*?1\s*?;/g), "Your code should fix the initial condition of the loop so that the index starts at 0.");' + - text: يجب أن تحدد شفرتك حالة المحطة الطرفية للحلقة بحيث تتوقف عند الفهرس الأخير. + testString: 'assert(code.match(/i\s*?<\s*?len\s*?;/g).length == 1, "Your code should set the terminal condition of the loop so it stops at the last index.");' + - text: يجب أن تقوم تعليماتك البرمجية بإصلاح حالة الحلقة الطرفية بحيث تتوقف عند 1 قبل الطول. + testString: 'assert(!code.match(/i\s*?<=\s*?len;/g), "Your code should fix the terminal condition of the loop so that it stops at 1 before the length.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function countToFive() { + let firstFive = "12345"; + let len = firstFive.length; + // Fix the line below + for (let i = 1; i <= len; i++) { + // Do not alter code below this line + console.log(firstFive[i]); + } +} + +countToFive(); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/catch-unclosed-parentheses-brackets-braces-and-quotes.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/catch-unclosed-parentheses-brackets-braces-and-quotes.arabic.md new file mode 100644 index 0000000000..8b5819d058 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/catch-unclosed-parentheses-brackets-braces-and-quotes.arabic.md @@ -0,0 +1,53 @@ +--- +id: 587d7b84367417b2b2512b36 +title: 'Catch Unclosed Parentheses, Brackets, Braces and Quotes' +challengeType: 1 +videoUrl: '' +localeTitle: قبض على الأقواس غير المغلقة ، بين قوسين ، الأقواس والاقتباسات +--- + +## Description +
هناك خطأ آخر في بناء الجملة يجب أن يكون على دراية بأن جميع أقواس الفتح ، الأقواس ، الأقواس المعقوفة ، وعلامات الاقتباس لها زوج إغلاق. يؤدي نسيان قطعة إلى الحدوث عند تحرير الشفرة الحالية وإدراج عناصر تحتوي على أحد أنواع الزوج. أيضًا ، توخ الحذر عند تضمين كتل التعليمات البرمجية في الآخرين ، مثل إضافة وظيفة رد اتصال كوسيطة إلى طريقة ما. هناك طريقة واحدة لتجنب هذا الخطأ بمجرد كتابة الحرف الافتتاحي ، وتضمين على الفور تطابق الإغلاق ، ثم حرك المؤشر للخلف بينهما واستمر في الترميز. لحسن الحظ ، فإن معظم برامج تحرير الشفرة الحديثة تولد النصف الثاني من الزوج تلقائيًا.
+ +## Instructions +
أصلح خطأ الزوج في الشفرة.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تعمل شفرتك على إصلاح الجزء المفقود من المصفوفة. + testString: 'assert(code.match(/myArray\s*?=\s*?\[\s*?1\s*?,\s*?2\s*?,\s*?3\s*?\];/g), "Your code should fix the missing piece of the array.");' + - text: 'يجب أن تقوم التعليمات البرمجية الخاصة بك بإصلاح الجزء المفقود من طريقة .reduce() . يجب أن يظهر إخراج وحدة التحكم أن "مجموع قيم الصفيف: 6".' + testString: 'assert(arraySum === 6, "Your code should fix the missing piece of the .reduce() method. The console output should show that "Sum of array values is: 6".");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +let myArray = [1, 2, 3; +let arraySum = myArray.reduce((previous, current => previous + current); +console.log(`Sum of array values is: ${arraySum}`); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/catch-use-of-assignment-operator-instead-of-equality-operator.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/catch-use-of-assignment-operator-instead-of-equality-operator.arabic.md new file mode 100644 index 0000000000..bb69f2238b --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/catch-use-of-assignment-operator-instead-of-equality-operator.arabic.md @@ -0,0 +1,61 @@ +--- +id: 587d7b85367417b2b2512b38 +title: Catch Use of Assignment Operator Instead of Equality Operator +challengeType: 1 +videoUrl: '' +localeTitle: قبض على استخدام مشغل التعيين بدلا من مشغل المساواة +--- + +## Description +
تعتمد البرامج المتفرعة ، أي البرامج التي تقوم بأشياء مختلفة إذا تم استيفاء شروط معينة ، على if else if else عبارات أخرى في جافا سكريبت أو غير ذلك أو else . تأخذ الحالة أحيانًا شكل اختبار ما إذا كانت النتيجة مساوية لقيمة ما. يتم نطق هذا المنطق (باللغة الإنجليزية ، على الأقل) على أنه "إذا كان x يساوي y ، ثم ..." والذي يمكن أن يترجم حرفيًا إلى تعليمة برمجية باستخدام عامل التشغيل أو = أو عامل التشغيل. هذا يؤدي إلى تدفق التحكم غير متوقع في البرنامج الخاص بك. كما تم تغطيته في التحديات السابقة ، يقوم عامل التعيين ( = ) في JavaScript بتعيين قيمة لاسم متغير. و == و === عوامل التحقق من المساواة (اختبار === الثلاثي من أجل المساواة الصارمة ، مما يعني أن القيمة والنوع هما نفس الشيء). يعيّن الرمز أدناه x إلى 2 ، والتي يتم تقييمها على أنها true . تقريبًا كل قيمة من تلقاء نفسها في جافا سكريبت يتم تقييمها إلى true ، باستثناء ما يُعرف بالقيم "الفالية": false ، و 0 ، و "" (سلسلة فارغة) ، و NaN ، و undefined ، و null .
دع x = 1؛
دعنا y = 2؛
إذا (x = y) {
// سيتم تشغيل هذا الكود لأية قيمة لـ y (ما لم يتم تعيين y في الأصل كالفلا)
} آخر {
// كتلة الكود هذا هو ما يجب تشغيله (لكن لن) في هذا المثال
}
+ +## Instructions +
أصلح الشرط بحيث يقوم البرنامج بتشغيل الفرع الصحيح ، ويتم تعيين القيمة المناسبة result .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تحدد شفرتك الشرط حتى تتحقق من المساواة ، بدلاً من استخدام الواجب. + testString: 'assert(result == "Not equal!", "Your code should fix the condition so it checks for equality, instead of using assignment.");' + - text: يمكن أن تستخدم الحالة إما == أو === لاختبار المساواة. + testString: 'assert(code.match(/x\s*?===?\s*?y/g), "The condition can use either == or === to test for equality.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +let x = 7; +let y = 9; +let result = "to come"; + +if(x = y) { + result = "Equal!"; +} else { + result = "Not equal!"; +} + +console.log(result); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/prevent-infinite-loops-with-a-valid-terminal-condition.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/prevent-infinite-loops-with-a-valid-terminal-condition.arabic.md new file mode 100644 index 0000000000..1594ec9132 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/prevent-infinite-loops-with-a-valid-terminal-condition.arabic.md @@ -0,0 +1,55 @@ +--- +id: 587d7b86367417b2b2512b3d +title: Prevent Infinite Loops with a Valid Terminal Condition +challengeType: 1 +videoUrl: '' +localeTitle: منع حلقات لا نهائية مع شرط محطة صالح +--- + +## Description +
الموضوع الأخير هو حلقة اللانهائي اللعين. الحلقات هي أدوات رائعة عندما تحتاج إلى برنامج لتشغيل كتلة التعليمات البرمجية لعدد معين من المرات أو حتى يتم استيفاء الشرط ، ولكنها تحتاج إلى حالة طرفية تنهي التكرار. من المحتمل أن تؤدي الحلقات اللانهائية إلى تجميد المتصفح أو تعطله ، وتتسبب في حدوث فشل في تنفيذ البرنامج العام ، وهو ما لا يريده أحد. كان هناك مثال حلقة لا نهائية في مقدمة هذا القسم - ليس لديها أي شرط المحطة للخروج من while حلقة داخل loopy() . لا ندعو هذه الوظيفة!
function loopy () {
احيانا صحيح) {
console.log ("Hello، world!")؛
}
}
إنها وظيفة المبرمج لضمان أن يتم الوصول في نهاية المطاف إلى حالة المحطة الطرفية ، التي تخبر البرنامج عند الخروج من شفرة التكرار. خطأ واحد هو زيادة أو إنقاص متغير عداد في الاتجاه الخاطئ من حالة المحطة الطرفية. واحد آخر هو بطريق الخطأ إعادة تعيين عداد أو فهرس متغير داخل رمز التكرار ، بدلاً من زيادة أو إنقاصه.
+ +## Instructions +
تحتوي الدالة myFunc() على حلقة لانهائية نظرًا لأن حالة المحطة الطرفية i != 4 لن يتم تقييمها أبداً إلى false (وكسر الحلقات) - سوف i بزيادة 2 لكل مسار ، والقفز مباشرة فوق 4 لأن i هو أمر غريب للبدء. إصلاح عامل مقارنة في حالة محطة حتى الحلقة يعمل فقط ل i أقل من أو يساوي 4.
+ +## Tests +
+ +```yml +tests: + - text: التعليمات البرمجية يجب أن تتغير عامل مقارنة في حالة الطرفية (الجزء الأوسط) من for حلقة. + testString: 'assert(code.match(/i\s*?<=\s*?4;/g).length == 1, "Your code should change the comparison operator in the terminal condition (the middle part) of the for loop.");' + - text: يجب أن تقوم التعليمات البرمجية الخاصة بك بإصلاح عامل المقارنة في حالة طرفية الحلقة. + testString: 'assert(!code.match(/i\s*?!=\s*?4;/g), "Your code should fix the comparison operator in the terminal condition of the loop.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function myFunc() { + for (let i = 1; i != 4; i += 2) { + console.log("Still going!"); + } +} + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/understanding-the-differences-between-the-freecodecamp-and-browser-console.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/understanding-the-differences-between-the-freecodecamp-and-browser-console.arabic.md new file mode 100644 index 0000000000..b29ca64586 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/understanding-the-differences-between-the-freecodecamp-and-browser-console.arabic.md @@ -0,0 +1,62 @@ +--- +id: 587d7b83367417b2b2512b37 +title: Understanding the Differences between the freeCodeCamp and Browser Console +challengeType: 1 +videoUrl: '' +localeTitle: فهم الاختلافات بين freeCodeCamp و Browser Console +--- + +## Description +
قد تكون لاحظت أن بعض تحديات JavaScript freeCodeCamp تتضمن وحدة التحكم الخاصة بهم. تعمل وحدة التحكم هذه بشكل مختلف قليلاً عن وحدة تحكم المستعرض التي استخدمتها في التحدي الأخير. يتمثل التحدي التالي في إبراز بعض الاختلافات بين وحدة التحكم freeCodeCamp ووحدة تحكم المستعرض. أولا ، وحدة تحكم المتصفح. عندما تقوم بتحميل وتشغيل ملف جافا سكريبت عادي في متصفحك ، ستقوم عبارات console.log() بطباعة ما تطلبه بالضبط للطباعة إلى وحدة تحكم المستعرض بالضبط عدد المرات التي طلبتها. في محرر النص داخل المتصفح ، تكون العملية مختلفة قليلاً ويمكن أن تكون مربكة في البداية. تشغيل القيم التي تم تمريرها إلى console.log() في كتلة محرر النص ، كل مجموعة من الاختبارات بالإضافة إلى وقت آخر لأية استدعاءات دالة موجودة في التعليمات البرمجية. وهذا يفسح المجال لبعض السلوكيات المثيرة للاهتمام وقد يقوم برحلتك في البداية ، لأن القيمة المسجلة التي تتوقع أن ترى مرة واحدة فقط قد تطبع مرات أكثر اعتمادًا على عدد الاختبارات والقيم التي يتم تمريرها إلى تلك الاختبارات. إذا كنت ترغب في رؤية مخرجاتك الفردية فقط ولا داعي للقلق بشأن تشغيل الدورات الاختبارية ، فيمكنك استخدام console.clear() .
+ +## Instructions +
استخدم console.log() لطباعة المتغيرات في التعليمة البرمجية في المكان المحدد.
+ +## Tests +
+ +```yml +tests: + - text: استخدم console.log() لطباعة outputTwo المتغير. في وحدة تحكم المتصفح لديك ، يجب أن تطبع قيمة المتغير مرتين. + testString: 'assert(code.match(/console\.log\(outputTwo\)/g), "Use console.log() to print the outputTwo variable. In your Browser Console this should print out the value of the variable two times.");' + - text: استخدم console.log() لطباعة متغير outputOne . + testString: 'assert(code.match(/console\.log\(outputOne\)/g), "Use console.log() to print the outputOne variable.");' + - text: استخدم console.clear() لتعديل الإخراج الخاص بك بحيث يتم إخراج outputOne فقط مرة واحدة. + testString: 'assert(code.match(/^(\s*console.clear\(\);?\s*)$/gm), "Use console.clear() to modify your output so that outputOne variable only outputs once.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +// Open your browser console +let outputTwo = "This will print to the browser console 2 times"; +// Use console.log() to print the outputTwo variable + + +let outputOne = "Try to get this to log only once to the browser console"; +// Use console.clear() in the next line to print the outputOne only once + + +// Use console.log() to print the outputOne variable + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/use-caution-when-reinitializing-variables-inside-a-loop.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/use-caution-when-reinitializing-variables-inside-a-loop.arabic.md new file mode 100644 index 0000000000..72c5b37045 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/use-caution-when-reinitializing-variables-inside-a-loop.arabic.md @@ -0,0 +1,71 @@ +--- +id: 587d7b86367417b2b2512b3c +title: Use Caution When Reinitializing Variables Inside a Loop +challengeType: 1 +videoUrl: '' +localeTitle: استخدام الحذر عند Reinitializing متغيرات داخل حلقة +--- + +## Description +
في بعض الأحيان يكون من الضروري حفظ المعلومات أو زيادة العدادات أو إعادة تعيين المتغيرات داخل حلقة. وتتمثل إحدى المشكلات المحتملة في ضرورة إعادة تهيئة المتغيرات ، وليس العكس ، أو العكس. هذا أمر خطير بشكل خاص إذا قمت بإعادة تعيين المتغير الذي يتم استخدامه لحالة المحطة عن طريق الخطأ ، مما تسبب في حلقة لا نهائية. يمكن لقيم الطباعة المتغيرة مع كل دورة من الحلقات باستخدام console.log() الكشف عن سلوك عربات التي تجرها الدواب المتعلقة بإعادة الضبط أو الفشل في إعادة تعيين متغير.
+ +## Instructions +
من المفترض أن تقوم الدالة التالية بإنشاء مصفوفة ثنائية الأبعاد مع صفوف m وأعمدة n من الأصفار. لسوء الحظ ، فإنه لا ينتج الإخراج المتوقع لأنه لا تتم إعادة تهيئة متغير row (إعادة تعيين صفيف فارغ) في الحلقة الخارجية. قم بإصلاح الكود بحيث يقوم بإرجاع صفيف 3x2 الصحيح من الأصفار ، والذي يشبه [[0, 0], [0, 0], [0, 0]] .
+ +## Tests +
+ +```yml +tests: + - text: يجب أن يقوم matrix بتعيين متغير matrix على صفيف يحتوي على 3 صفوف من عمودين من الأصفار لكل منهما. + testString: 'assert(JSON.stringify(matrix) == "[[0,0],[0,0],[0,0]]", "Your code should set the matrix variable to an array holding 3 rows of 2 columns of zeroes each.");' + - text: يجب أن يكون متغير matrix 3 صفوف. + testString: 'assert(matrix.length == 3, "The matrix variable should have 3 rows.");' + - text: يجب أن يحتوي متغير matrix على عمودين في كل صف. + testString: 'assert(matrix[0].length == 2 && matrix[1].length === 2 && matrix[2].length === 2, "The matrix variable should have 2 columns in each row.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function zeroArray(m, n) { + // Creates a 2-D array with m rows and n columns of zeroes + let newArray = []; + let row = []; + for (let i = 0; i < m; i++) { + // Adds the m-th row into newArray + + for (let j = 0; j < n; j++) { + // Pushes n zeroes into the current row to create the columns + row.push(0); + } + // Pushes the current row, which now has n zeroes in it, to the array + newArray.push(row); + } + return newArray; +} + +let matrix = zeroArray(3, 2); +console.log(matrix); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/use-the-javascript-console-to-check-the-value-of-a-variable.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/use-the-javascript-console-to-check-the-value-of-a-variable.arabic.md new file mode 100644 index 0000000000..36ca826dbe --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/use-the-javascript-console-to-check-the-value-of-a-variable.arabic.md @@ -0,0 +1,56 @@ +--- +id: 587d7b83367417b2b2512b33 +title: Use the JavaScript Console to Check the Value of a Variable +challengeType: 1 +videoUrl: '' +localeTitle: استخدم وحدة تحكم جافا سكريبت للتحقق من قيمة المتغير +--- + +## Description +
يحتوي كل من Chrome و Firefox على وحدات تحكم جافا سكريبت ممتازة ، تُعرف أيضًا باسم DevTools ، لتصحيح أخطاء جافا سكريبت. يمكنك العثور على أدوات مطوري البرامج في قائمة Chrome أو وحدة تحكم الويب في قائمة FireFox. إذا كنت تستخدم متصفحًا مختلفًا أو هاتفًا جوالًا ، فنحن نوصي بشدة بالتبديل إلى مكتبي Firefox أو Chrome. من المحتمل أن تكون طريقة console.log() ، التي "تطبع" مخرجات ما داخل أقواسها إلى وحدة التحكم ، أداة التصحيح الأكثر فائدة. يمكن وضعه في النقاط الاستراتيجية في التعليمات البرمجية الخاصة بك تظهر لك القيم المتوسطة للمتغيرات. من الجيد أن يكون لديك فكرة عن ما يجب أن يكون عليه المخرج قبل النظر إلى ما هو عليه. وجود نقاط تحقق لرؤية حالة الحسابات الخاصة بك في جميع أنحاء التعليمات البرمجية الخاصة بك سيساعد على تضييق نطاق المشكلة. في ما يلي مثال لطباعة "Hello world!" إلى وحدة التحكم: console.log('Hello world!');
+ +## Instructions +
استخدم الأسلوب console.log() لطباعة قيمة المتغير a المكان الذي تمت الإشارة إليه في التعليمة البرمجية.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تستخدم التعليمات البرمجية الخاصة بك console.log() للتحقق من قيمة المتغير a . + testString: 'assert(code.match(/console\.log\(a\)/g), "Your code should use console.log() to check the value of the variable a.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +let a = 5; +let b = 1; +a++; +// Add your code below this line + + +let sumAB = a + b; +console.log(sumAB); + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/use-typeof-to-check-the-type-of-a-variable.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/use-typeof-to-check-the-type-of-a-variable.arabic.md new file mode 100644 index 0000000000..f5c30bf542 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/debugging/use-typeof-to-check-the-type-of-a-variable.arabic.md @@ -0,0 +1,56 @@ +--- +id: 587d7b84367417b2b2512b34 +title: Use typeof to Check the Type of a Variable +challengeType: 1 +videoUrl: '' +localeTitle: استخدم typeof للتحقق من نوع المتغير +--- + +## Description +
يمكنك استخدام typeof للتحقق من بنية البيانات أو نوع المتغير. هذا مفيد في تصحيح الأخطاء عند العمل مع أنواع بيانات متعددة. إذا كنت تعتقد أنك تضيف رقمين ، لكن أحدهما عبارة عن سلسلة ، فيمكن أن تكون النتائج غير متوقعة. يمكن أن تكمن أخطاء الكتابة في العمليات الحسابية أو المكالمات الوظيفية. كن حذرًا خصوصًا عند الوصول إلى البيانات الخارجية والعمل بها في شكل كائن ترميز كائنات جافا سكريبت (JSON). فيما يلي بعض الأمثلة باستخدام typeof :
console.log (typeof "") ؛ // مخرجات "سلسلة"
console.log (typeof 0)؛ // outputs "number"
console.log (typeof [])؛ // outputs "object"
console.log (typeof {})؛ // outputs "object"
يتعرف JavaScript على ستة أنواع من البيانات البدائية (غير القابلة للتغيير): Boolean و Null و Undefined و Number و String و Symbol (جديد مع ES6) ونوع واحد للعناصر القابلة للتغيير: Object . لاحظ أنه في JavaScript ، تعد المصفوفات نوعًا من الكائنات تقنيًا.
+ +## Instructions +
إضافة جهازي console.log() للتحقق من typeof كل من المتغيرات seven three في التعليمات البرمجية.
+ +## Tests +
+ +```yml +tests: + - text: يجب أن تستخدم التعليمات البرمجية الخاصة بك typeof في جهازي console.log() للتحقق من نوع المتغيرات. + testString: 'assert(code.match(/console\.log\(typeof[\( ].*\)?\)/g).length == 2, "Your code should use typeof in two console.log() statements to check the type of the variables.");' + - text: يجب أن تستخدم التعليمات البرمجية الخاصة بك typeof للتحقق من نوع المتغير seven . + testString: 'assert(code.match(/typeof[\( ]seven\)?/g), "Your code should use typeof to check the type of the variable seven.");' + - text: يجب أن تستخدم التعليمات البرمجية الخاصة بك typeof للتحقق من نوع المتغير three . + testString: 'assert(code.match(/typeof[\( ]three\)?/g), "Your code should use typeof to check the type of the variable three.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +let seven = 7; +let three = "3"; +console.log(seven + three); +// Add your code below this line + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/compare-scopes-of-the-var-and-let-keywords.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/compare-scopes-of-the-var-and-let-keywords.arabic.md new file mode 100644 index 0000000000..1470445820 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/compare-scopes-of-the-var-and-let-keywords.arabic.md @@ -0,0 +1,62 @@ +--- +id: 587d7b87367417b2b2512b40 +title: Compare Scopes of the var and let Keywords +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'getUserInput => assert(!getUserInput("index").match(/var/g),"var does not exist in code.");' + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/(i\s*=\s*).*\s*.*\s*.*\1("|")block\s*scope\2/g), "The variable i declared in the if statement should equal "block scope".");' + - text: '' + testString: 'assert(checkScope() === "function scope", "checkScope() should return "function scope"");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +function checkScope() { +"use strict"; + var i = "function scope"; + if (true) { + i = "block scope"; + console.log("Block scope i is: ", i); + } + console.log("Function scope i is: ", i); + return i; +} + +``` + +
+ + + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/create-an-export-fallback-with-export-default.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/create-an-export-fallback-with-export-default.arabic.md new file mode 100644 index 0000000000..93eb9b1bc1 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/create-an-export-fallback-with-export-default.arabic.md @@ -0,0 +1,59 @@ +--- +id: 587d7b8c367417b2b2512b58 +title: Create an Export Fallback with export default +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/export\s+default\s+function\s+subtract\(x,y\)\s+{return\s+x\s-\s+y;}/g), "Proper used of export fallback.");' + +``` + +
+ +## Challenge Seed +
+ +
+ +```js +"use strict"; +function subtract(x,y) {return x - y;} + +``` + +
+ +### Before Test +
+ +```js +window.exports = function(){}; + +``` + +
+ + +
+ +## Solution +
+ +```js +// solution required +``` +
diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/create-strings-using-template-literals.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/create-strings-using-template-literals.arabic.md new file mode 100644 index 0000000000..868f751b40 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/create-strings-using-template-literals.arabic.md @@ -0,0 +1,73 @@ +--- +id: 587d7b8a367417b2b2512b4e +title: Create Strings using Template Literals +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
+ +```yml +tests: + - text: '' + testString: 'assert(typeof makeList(result.failure) === "object" && resultDisplayArray.length === 3, "resultDisplayArray is a list containing result failure messages.");' + - text: '' + testString: 'assert(makeList(result.failure).every((v, i) => v === `
  • ${result.failure[i]}
  • ` || v === `
  • ${result.failure[i]}
  • `), "resultDisplayArray is the desired output.");' + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/`.*`/g), "Template strings were not used");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +const result = { + success: ["max-length", "no-amd", "prefer-arrow-functions"], + failure: ["no-var", "var-on-top", "linebreak"], + skipped: ["id-blacklist", "no-dup-keys"] +}; +function makeList(arr) { + "use strict"; + + // change code below this line + const resultDisplayArray = null; + // change code above this line + + return resultDisplayArray; +} +/** + * makeList(result.failure) should return: + * [ `
  • no-var
  • `, + * `
  • var-on-top
  • `, + * `
  • linebreak
  • ` ] + **/ +const resultDisplayArray = makeList(result.failure); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/declare-a-read-only-variable-with-the-const-keyword.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/declare-a-read-only-variable-with-the-const-keyword.arabic.md new file mode 100644 index 0000000000..76fa76c9d5 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/declare-a-read-only-variable-with-the-const-keyword.arabic.md @@ -0,0 +1,68 @@ +--- +id: 587d7b87367417b2b2512b41 +title: Declare a Read-Only Variable with the const Keyword +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'getUserInput => assert(!getUserInput("index").match(/var/g),"var does not exist in your code.");' + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/(const SENTENCE)/g), "SENTENCE should be a constant variable declared with const.");' + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/(let i)/g), "i should be declared with let.");' + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/console\.log\(\s*SENTENCE\s*\)\s*;?/g), "console.log should be adjusted to print the variable SENTENCE.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function printManyTimes(str) { + "use strict"; + + // change code below this line + + var sentence = str + " is cool!"; + for(var i = 0; i < str.length; i+=2) { + console.log(sentence); + } + + // change code above this line + +} +printManyTimes("freeCodeCamp"); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/explore-differences-between-the-var-and-let-keywords.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/explore-differences-between-the-var-and-let-keywords.arabic.md new file mode 100644 index 0000000000..cdeff18f7a --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/explore-differences-between-the-var-and-let-keywords.arabic.md @@ -0,0 +1,62 @@ +--- +id: 587d7b87367417b2b2512b3f +title: Explore Differences Between the var and let Keywords +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'getUserInput => assert(!getUserInput("index").match(/var/g),"var does not exist in code.");' + - text: '' + testString: 'assert(catName === "Oliver", "catName should be Oliver.");' + - text: '' + testString: 'assert(quote === "Oliver says Meow!", "quote should be "Oliver says Meow!"");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +var catName; +var quote; +function catTalk() { + "use strict"; + + catName = "Oliver"; + quote = catName + " says Meow!"; + +} +catTalk(); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/import-a-default-export.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/import-a-default-export.arabic.md new file mode 100644 index 0000000000..1e0db2de17 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/import-a-default-export.arabic.md @@ -0,0 +1,63 @@ +--- +id: 587d7b8d367417b2b2512b59 +title: Import a Default Export +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/import\s+subtract\s+from\s+"math_functions"/g), "Properly imports export default method.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +"use strict"; +subtract(7,4); + +``` + +
    + +### Before Test +
    + +```js +window.require = function(str) { +if (str === 'math_functions') { +return function(a, b) { +return a - b; +}}}; + +``` + +
    + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/mutate-an-array-declared-with-const.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/mutate-an-array-declared-with-const.arabic.md new file mode 100644 index 0000000000..828e7bc546 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/mutate-an-array-declared-with-const.arabic.md @@ -0,0 +1,64 @@ +--- +id: 587d7b87367417b2b2512b42 +title: Mutate an Array Declared with const +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/const/g), "Do not replace const keyword.");' + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/const\s+s/g), "s should be a constant variable (by using const).");' + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/const\s+s\s*=\s*\[\s*5\s*,\s*7\s*,\s*2\s*\]\s*;?/g), "Do not change the original array declaration.");' + - text: '' + testString: 'assert.deepEqual(s, [2, 5, 7], "s should be equal to [2, 5, 7].");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +const s = [5, 7, 2]; +function editInPlace() { + "use strict"; + // change code below this line + + // s = [2, 5, 7]; <- this is invalid + + // change code above this line +} +editInPlace(); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/prevent-object-mutation.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/prevent-object-mutation.arabic.md new file mode 100644 index 0000000000..6d90b53561 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/prevent-object-mutation.arabic.md @@ -0,0 +1,71 @@ +--- +id: 598f48a36c8c40764b4e52b3 +title: Prevent Object Mutation +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/const/g), "Do not replace const keyword.");' + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/const\s+MATH_CONSTANTS/g), "MATH_CONSTANTS should be a constant variable (by using const).");' + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/const\s+MATH_CONSTANTS\s+=\s+{\s+PI:\s+3.14\s+};/g), "Do not change original MATH_CONSTANTS.");' + - text: '' + testString: 'assert(PI === 3.14, "PI equals 3.14.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function freezeObj() { + "use strict"; + const MATH_CONSTANTS = { + PI: 3.14 + }; + // change code below this line + + + // change code above this line + try { + MATH_CONSTANTS.PI = 99; + } catch( ex ) { + console.log(ex); + } + return MATH_CONSTANTS.PI; +} +const PI = freezeObj(); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/set-default-parameters-for-your-functions.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/set-default-parameters-for-your-functions.arabic.md new file mode 100644 index 0000000000..a8a2f6f0c3 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/set-default-parameters-for-your-functions.arabic.md @@ -0,0 +1,60 @@ +--- +id: 587d7b88367417b2b2512b46 +title: Set Default Parameters for Your Functions +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(increment(5, 2) === 7, "The result of increment(5, 2) should be 7.");' + - text: '' + testString: 'assert(increment(5) === 6, "The result of increment(5) should be 6.");' + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/value\s*=\s*1/g), "default parameter 1 was used for value.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +const increment = (function() { + "use strict"; + return function increment(number, value) { + return number + value; + }; +})(); +console.log(increment(5, 2)); // returns 7 +console.log(increment(5)); // returns 6 + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/understand-the-differences-between-import-and-require.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/understand-the-differences-between-import-and-require.arabic.md new file mode 100644 index 0000000000..e80ee544d6 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/understand-the-differences-between-import-and-require.arabic.md @@ -0,0 +1,63 @@ +--- +id: 587d7b8c367417b2b2512b55 +title: Understand the Differences Between import and require +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/import\s+\{\s*capitalizeString\s*\}\s+from\s+("|")string_functions\1/g), "valid import statement");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +"use strict"; +capitalizeString("hello!"); + +``` + +
    + +### Before Test +
    + +```js +window.require = function (str) { +if (str === 'string_functions') { +return { +capitalizeString: str => str.toUpperCase() +}}}; + +``` + +
    + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use--to-import-everything-from-a-file.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use--to-import-everything-from-a-file.arabic.md new file mode 100644 index 0000000000..cf023221ab --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use--to-import-everything-from-a-file.arabic.md @@ -0,0 +1,63 @@ +--- +id: 587d7b8c367417b2b2512b57 +title: Use * to Import Everything from a File +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(code.match(/import\s+\*\s+as\s+[a-zA-Z0-9_$]+\s+from\s*"\s*capitalize_strings\s*"\s*;/gi), "Properly uses import * as syntax.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +"use strict"; + +``` + +
    + +### Before Test +
    + +```js +window.require = function(str) { +if (str === 'capitalize_strings') { +return { +capitalize: str => str.toUpperCase(), +lowercase: str => str.toLowerCase() +}}}; + +``` + +
    + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-arrow-functions-to-write-concise-anonymous-functions.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-arrow-functions-to-write-concise-anonymous-functions.arabic.md new file mode 100644 index 0000000000..fcc7a29645 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-arrow-functions-to-write-concise-anonymous-functions.arabic.md @@ -0,0 +1,60 @@ +--- +id: 587d7b87367417b2b2512b43 +title: Use Arrow Functions to Write Concise Anonymous Functions +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'getUserInput => assert(!getUserInput("index").match(/var/g), "User did replace var keyword.");' + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/const\s+magic/g), "magic should be a constant variable (by using const).");' + - text: '' + testString: 'assert(typeof magic === "function", "magic is a function.");' + - text: '' + testString: 'assert(magic().getDate() == new Date().getDate(), "magic() returns correct date.");' + - text: '' + testString: 'getUserInput => assert(!getUserInput("index").match(/function/g), "function keyword was not used.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +var magic = function() { + "use strict"; + return new Date(); +}; + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-class-syntax-to-define-a-constructor-function.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-class-syntax-to-define-a-constructor-function.arabic.md new file mode 100644 index 0000000000..4cc4b37ad9 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-class-syntax-to-define-a-constructor-function.arabic.md @@ -0,0 +1,64 @@ +--- +id: 587d7b8b367417b2b2512b53 +title: Use class Syntax to Define a Constructor Function +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(typeof Vegetable === "function" && typeof Vegetable.constructor === "function", "Vegetable should be a class with a defined constructor method.");' + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/class/g),"class keyword was used.");' + - text: '' + testString: 'assert(() => {const a = new Vegetable("apple"); return typeof a === "object";},"Vegetable can be instantiated.");' + - text: '' + testString: 'assert(carrot.name=="carrot","carrot.name should return carrot.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function makeClass() { + "use strict"; + /* Alter code below this line */ + + /* Alter code above this line */ + return Vegetable; +} +const Vegetable = makeClass(); +const carrot = new Vegetable('carrot'); +console.log(carrot.name); // => should be 'carrot' + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-arrays.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-arrays.arabic.md new file mode 100644 index 0000000000..fdbfe14f69 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-arrays.arabic.md @@ -0,0 +1,61 @@ +--- +id: 587d7b89367417b2b2512b4b +title: Use Destructuring Assignment to Assign Variables from Arrays +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(a === 6, "Value of a should be 6, after swapping.");' + - text: '' + testString: 'assert(b === 8, "Value of b should be 8, after swapping.");' + - text: '' + testString: '// assert(/\[\s*(\w)\s*,\s*(\w)\s*\]\s*=\s*\[\s*\2\s*,\s*\1\s*\]/g.test(code), "Use array destructuring to swap a and b.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let a = 8, b = 6; +(() => { + "use strict"; + // change code below this line + + // change code above this line +})(); +console.log(a); // should be 6 +console.log(b); // should be 8 + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-nested-objects.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-nested-objects.arabic.md new file mode 100644 index 0000000000..e091ff2208 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-nested-objects.arabic.md @@ -0,0 +1,64 @@ +--- +id: 587d7b89367417b2b2512b4a +title: Use Destructuring Assignment to Assign Variables from Nested Objects +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(getMaxOfTmrw(LOCAL_FORECAST) === 84.6, "maxOfTomorrow equals 84.6");' + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/\{\s*tomorrow\s*:\s*\{\s*max\s*:\s*maxOfTomorrow\s*\}\s*\}\s*=\s*forecast/g),"nested destructuring was used");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +const LOCAL_FORECAST = { + today: { min: 72, max: 83 }, + tomorrow: { min: 73.3, max: 84.6 } +}; + +function getMaxOfTmrw(forecast) { + "use strict"; + // change code below this line + const maxOfTomorrow = undefined; // change this line + // change code above this line + return maxOfTomorrow; +} + +console.log(getMaxOfTmrw(LOCAL_FORECAST)); // should be 84.6 + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-objects.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-objects.arabic.md new file mode 100644 index 0000000000..ec967430cc --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-objects.arabic.md @@ -0,0 +1,64 @@ +--- +id: 587d7b89367417b2b2512b49 +title: Use Destructuring Assignment to Assign Variables from Objects +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(getTempOfTmrw(AVG_TEMPERATURES) === 79, "getTempOfTmrw(AVG_TEMPERATURES) should be 79");' + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/\{\s*tomorrow\s*:\s*tempOfTomorrow\s*}\s*=\s*avgTemperatures/g),"destructuring with reassignment was used");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +const AVG_TEMPERATURES = { + today: 77.5, + tomorrow: 79 +}; + +function getTempOfTmrw(avgTemperatures) { + "use strict"; + // change code below this line + const tempOfTomorrow = undefined; // change this line + // change code above this line + return tempOfTomorrow; +} + +console.log(getTempOfTmrw(AVG_TEMPERATURES)); // should be 79 + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-pass-an-object-as-a-functions-parameters.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-pass-an-object-as-a-functions-parameters.arabic.md new file mode 100644 index 0000000000..83227b97d7 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-pass-an-object-as-a-functions-parameters.arabic.md @@ -0,0 +1,73 @@ +--- +id: 587d7b8a367417b2b2512b4d +title: Use Destructuring Assignment to Pass an Object as a Function's Parameters +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(typeof stats === "object", "stats should be an object.");' + - text: '' + testString: 'assert(half(stats) === 28.015, "half(stats) should be 28.015");' + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/\(\s*\{\s*\w+\s*,\s*\w+\s*\}\s*\)/g), "Destructuring was used.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +const stats = { + max: 56.78, + standard_deviation: 4.34, + median: 34.54, + mode: 23.87, + min: -0.75, + average: 35.85 +}; +const half = (function() { + "use strict"; // do not change this line + + // change code below this line + return function half(stats) { + // use function argument destructuring + return (stats.max + stats.min) / 2.0; + }; + // change code above this line + +})(); +console.log(stats); // should be object +console.log(half(stats)); // should be 28.015 + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-operator-to-reassign-array-elements.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-operator-to-reassign-array-elements.arabic.md new file mode 100644 index 0000000000..c7b95604f1 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-operator-to-reassign-array-elements.arabic.md @@ -0,0 +1,63 @@ +--- +id: 587d7b8a367417b2b2512b4c +title: Use Destructuring Assignment with the Rest Operator to Reassign Array Elements +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(arr.every((v, i) => v === i + 3) && arr.length === 8,"arr should be [3,4,5,6,7,8,9,10]");' + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/\[\s*\w*\s*,\s*\w*\s*,\s*...\w+\s*\]/g),"Destructuring should be used.");' + - text: '' + testString: 'getUserInput => assert(!getUserInput("index").match(/slice/g), "Array.slice() should not be used.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +const source = [1,2,3,4,5,6,7,8,9,10]; +function removeFirstTwo(list) { + "use strict"; + // change code below this line + arr = list; // change this + // change code above this line + return arr; +} +const arr = removeFirstTwo(source); +console.log(arr); // should be [3,4,5,6,7,8,9,10] +console.log(source); // should be [1,2,3,4,5,6,7,8,9,10]; + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-export-to-reuse-a-code-block.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-export-to-reuse-a-code-block.arabic.md new file mode 100644 index 0000000000..5d185fa9dc --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-export-to-reuse-a-code-block.arabic.md @@ -0,0 +1,62 @@ +--- +id: 587d7b8c367417b2b2512b56 +title: Use export to Reuse a Code Block +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/export\s+const\s+foo\s*=\s*"bar"/g), "foo is exported.");' + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/export\s+const\s+bar\s*=\s*"foo"/g), "bar is exported.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +"use strict"; +const foo = "bar"; +const bar = "foo"; + +``` + +
    + +### Before Test +
    + +```js +window.exports = function(){}; + +``` + +
    + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-getters-and-setters-to-control-access-to-an-object.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-getters-and-setters-to-control-access-to-an-object.arabic.md new file mode 100644 index 0000000000..36d82ebab5 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-getters-and-setters-to-control-access-to-an-object.arabic.md @@ -0,0 +1,64 @@ +--- +id: 587d7b8c367417b2b2512b54 +title: Use getters and setters to Control Access to an Object +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(typeof Thermostat === "function" && typeof Thermostat.constructor === "function","Thermostat should be a class with a defined constructor method.");' + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/class/g),"class keyword was used.");' + - text: '' + testString: 'assert(() => {const t = new Thermostat(32); return typeof t === "object" && t.temperature === 0;}, "Thermostat can be instantiated.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function makeClass() { + "use strict"; + /* Alter code below this line */ + + /* Alter code above this line */ + return Thermostat; +} +const Thermostat = makeClass(); +const thermos = new Thermostat(76); // setting in Fahrenheit scale +let temp = thermos.temperature; // 24.44 in C +thermos.temperature = 26; +temp = thermos.temperature; // 26 in C + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-the-rest-operator-with-function-parameters.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-the-rest-operator-with-function-parameters.arabic.md new file mode 100644 index 0000000000..0a40532394 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-the-rest-operator-with-function-parameters.arabic.md @@ -0,0 +1,64 @@ +--- +id: 587d7b88367417b2b2512b47 +title: Use the Rest Operator with Function Parameters +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(sum(0,1,2) === 3, "The result of sum(0,1,2) should be 3");' + - text: '' + testString: 'assert(sum(1,2,3,4) === 10, "The result of sum(1,2,3,4) should be 10");' + - text: '' + testString: 'assert(sum(5) === 5, "The result of sum(5) should be 5");' + - text: '' + testString: 'assert(sum() === 0, "The result of sum() should be 0");' + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/function\s+sum\s*\(\s*...args\s*\)\s*{/g), "The sum function uses the ... spread operator on the args parameter.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +const sum = (function() { + "use strict"; + return function sum(x, y, z) { + const args = [ x, y, z ]; + return args.reduce((a, b) => a + b, 0); + }; +})(); +console.log(sum(1, 2, 3)); // 6 + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-the-spread-operator-to-evaluate-arrays-in-place.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-the-spread-operator-to-evaluate-arrays-in-place.arabic.md new file mode 100644 index 0000000000..f771ea8a25 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-the-spread-operator-to-evaluate-arrays-in-place.arabic.md @@ -0,0 +1,59 @@ +--- +id: 587d7b89367417b2b2512b48 +title: Use the Spread Operator to Evaluate Arrays In-Place +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(arr2.every((v, i) => v === arr1[i]), "arr2 is correct copy of arr1.");' + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/\[\s*...arr1\s*\]/g),"... spread operator was used to duplicate arr1.");' + - text: '' + testString: 'assert((arr1, arr2) => {arr1.push("JUN"); return arr2.length < arr1.length},"arr2 remains unchanged when arr1 is changed.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +const arr1 = ['JAN', 'FEB', 'MAR', 'APR', 'MAY']; +let arr2; +(function() { + "use strict"; + arr2 = []; // change this line +})(); +console.log(arr2); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/write-arrow-functions-with-parameters.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/write-arrow-functions-with-parameters.arabic.md new file mode 100644 index 0000000000..e7389c2956 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/write-arrow-functions-with-parameters.arabic.md @@ -0,0 +1,62 @@ +--- +id: 587d7b88367417b2b2512b44 +title: Write Arrow Functions with Parameters +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'getUserInput => assert(!getUserInput("index").match(/var/g), "User did replace var keyword.");' + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/const\s+myConcat/g), "myConcat should be a constant variable (by using const).");' + - text: '' + testString: 'assert(typeof myConcat === "function", "myConcat should be a function");' + - text: '' + testString: 'assert(() => { const a = myConcat([1], [2]); return a[0] == 1 && a[1] == 2; }, "myConcat() returns the correct array");' + - text: '' + testString: 'getUserInput => assert(!getUserInput("index").match(/function/g), "function keyword was not used.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +var myConcat = function(arr1, arr2) { + "use strict"; + return arr1.concat(arr2); +}; +// test your code +console.log(myConcat([1, 2], [3, 4, 5])); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/write-concise-declarative-functions-with-es6.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/write-concise-declarative-functions-with-es6.arabic.md new file mode 100644 index 0000000000..cfaa001dc3 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/write-concise-declarative-functions-with-es6.arabic.md @@ -0,0 +1,63 @@ +--- +id: 587d7b8b367417b2b2512b50 +title: Write Concise Declarative Functions with ES6 +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(!getUserInput("index").match(/function/),"Traditional function expression was not used.");' + - text: '' + testString: 'assert(typeof bicycle.setGear === "function" && getUserInput("index").match(/setGear\s*\(.+\)\s*\{/), "setGear is a declarative function.");' + - text: '' + testString: 'assert((new bicycle.setGear(48)).gear === 48, "bicycle.setGear(48) changes the gear value to 48.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +// change code below this line +const bicycle = { + gear: 2, + setGear: function(newGear) { + "use strict"; + this.gear = newGear; + } +}; +// change code above this line +bicycle.setGear(3); +console.log(bicycle.gear); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/write-concise-object-literal-declarations-using-simple-fields.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/write-concise-object-literal-declarations-using-simple-fields.arabic.md new file mode 100644 index 0000000000..c3e894e6f1 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/write-concise-object-literal-declarations-using-simple-fields.arabic.md @@ -0,0 +1,61 @@ +--- +id: 587d7b8a367417b2b2512b4f +title: Write Concise Object Literal Declarations Using Simple Fields +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(() => {const res={name:"Zodiac Hasbro",age:56,gender:"male"}; const person=createPerson("Zodiac Hasbro", 56, "male"); return Object.keys(person).every(k => person[k] === res[k]);}, "the output is {name: "Zodiac Hasbro", age: 56, gender: "male"}.");' + - text: '' + testString: 'getUserInput => assert(!getUserInput("index").match(/:/g), "No : were used.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +const createPerson = (name, age, gender) => { + "use strict"; + // change code below this line + return { + name: name, + age: age, + gender: gender + }; + // change code above this line +}; +console.log(createPerson("Zodiac Hasbro", 56, "male")); // returns a proper object + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/write-higher-order-arrow-functions.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/write-higher-order-arrow-functions.arabic.md new file mode 100644 index 0000000000..16a83c81ae --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/write-higher-order-arrow-functions.arabic.md @@ -0,0 +1,69 @@ +--- +id: 587d7b88367417b2b2512b45 +title: Write Higher Order Arrow Functions +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/const\s+squaredIntegers/g), "squaredIntegers should be a constant variable (by using const).");' + - text: '' + testString: 'assert(Array.isArray(squaredIntegers), "squaredIntegers should be an array");' + - text: '' + testString: 'assert.deepStrictEqual(squaredIntegers, [16, 1764, 36], "squaredIntegers should be [16, 1764, 36]");' + - text: '' + testString: 'getUserInput => assert(!getUserInput("index").match(/function/g), "function keyword was not used.");' + - text: '' + testString: 'getUserInput => assert(!getUserInput("index").match(/(for)|(while)/g), "loop should not be used");' + - text: '' + testString: 'getUserInput => assert(getUserInput("index").match(/map|filter|reduce/g), "map, filter, or reduce should be used");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +const realNumberArray = [4, 5.6, -9.8, 3.14, 42, 6, 8.34, -2]; +const squareList = (arr) => { + "use strict"; + // change code below this line + const squaredIntegers = arr; + // change code above this line + return squaredIntegers; +}; +// test your code +const squaredIntegers = squareList(realNumberArray); +console.log(squaredIntegers); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/add-elements-to-the-end-of-an-array-using-concat-instead-of-push.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/add-elements-to-the-end-of-an-array-using-concat-instead-of-push.arabic.md new file mode 100644 index 0000000000..6a289f45d6 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/add-elements-to-the-end-of-an-array-using-concat-instead-of-push.arabic.md @@ -0,0 +1,65 @@ +--- +id: 587d7da9367417b2b2512b67 +title: Add Elements to the End of an Array Using concat Instead of push +challengeType: 1 +videoUrl: '' +localeTitle: إضافة عناصر إلى نهاية صفيف باستخدام concat بدلاً من الضغط +--- + +## Description +
    البرمجة الوظيفية هي كل شيء عن إنشاء واستخدام وظائف غير متحولة. قدم التحدي الأخير طريقة concat كطريقة لدمج المصفوفات في صف جديد دون تحوير المصفوفات الأصلية. قارن concat إلى طريقة push . يضيف Push عنصرًا إلى نهاية الصفيف نفسه الذي يطلق عليه ، والذي يحول ذلك الصفيف. إليك مثال على ذلك:
    var arr = [1، 2، 3]؛
    arr.push ([4، 5، 6])؛
    // arr يتم تغييرها إلى [1 ، 2 ، 3 ، [4 ، 5 ، 6]]
    // ليس طريقة البرمجة الوظيفية
    يوفر Concat طريقة لإضافة عناصر جديدة إلى نهاية صفيف بدون أي تأثيرات جانبية متحولة.
    + +## Instructions +
    تغيير الدالة nonMutatingPush بحيث يستخدم concat لإضافة newItem إلى نهاية original بدلاً من push . يجب على الدالة إرجاع صفيف.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن تستخدم التعليمات البرمجية الخاصة بك طريقة concat . + testString: 'assert(code.match(/\.concat/g), "Your code should use the concat method.");' + - text: يجب ألا تستخدم شفرتك طريقة push . + testString: 'assert(!code.match(/\.push/g), "Your code should not use the push method.");' + - text: يجب أن لا تتغير الصفيف first . + testString: 'assert(JSON.stringify(first) === JSON.stringify([1, 2, 3]), "The first array should not change.");' + - text: لا يجب تغيير الصفيف second . + testString: 'assert(JSON.stringify(second) === JSON.stringify([4, 5]), "The second array should not change.");' + - text: 'nonMutatingPush([1, 2, 3], [4, 5]) [1, 2, 3, 4, 5] .' + testString: 'assert(JSON.stringify(nonMutatingPush([1, 2, 3], [4, 5])) === JSON.stringify([1, 2, 3, 4, 5]), "nonMutatingPush([1, 2, 3], [4, 5]) should return [1, 2, 3, 4, 5].");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function nonMutatingPush(original, newItem) { + // Add your code below this line + return original.push(newItem); + + // Add your code above this line +} +var first = [1, 2, 3]; +var second = [4, 5]; +nonMutatingPush(first, second); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/apply-functional-programming-to-convert-strings-to-url-slugs.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/apply-functional-programming-to-convert-strings-to-url-slugs.arabic.md new file mode 100644 index 0000000000..9f7d28cfa4 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/apply-functional-programming-to-convert-strings-to-url-slugs.arabic.md @@ -0,0 +1,69 @@ +--- +id: 587d7dab367417b2b2512b6d +title: Apply Functional Programming to Convert Strings to URL Slugs +challengeType: 1 +videoUrl: '' +localeTitle: تطبيق برمجة وظيفية لتحويل السلاسل إلى Slug URL +--- + +## Description +
    غطت التحديات الأخيرة عدة عدد من صفيفات السلسلة والصفيف المفيدة التي تتبع مبادئ البرمجة الوظيفية. لقد تعلمنا أيضًا عن reduce ، وهي طريقة قوية تستخدم لتقليل المشكلات إلى نماذج أبسط. من متوسطات الحوسبة إلى الفرز ، يمكن تحقيق أي عملية صفيف بتطبيقها. أذكر أن map filter هي حالات خاصة من reduce . دعونا ندمج ما تعلمناه لحل مشكلة عملية. تحتوي العديد من مواقع إدارة المحتوى (CMS) على عناوين وظيفة تتم إضافتها إلى جزء من عنوان URL لأغراض بسيطة للإشارة المرجعية. على سبيل المثال ، إذا كتبت منشورًا متوسطًا بعنوان "Stop Using Reduce" ، فمن المحتمل أن يكون لعنوان URL شكل من أشكال سلسلة العنوان فيه ("... / stop-using-reduction"). ربما تكون قد لاحظت هذا بالفعل على موقع freeCodeCamp.
    + +## Instructions +
    املأ وظيفة urlSlug بحيث يحول title سلسلة ويعيد الإصدار urlSlug لعنوان URL. يمكنك استخدام أي من الطرق المغطاة في هذا القسم ، ولا تستخدم replace . فيما يلي المتطلبات: الإدخال عبارة عن سلسلة تحتوي على مسافات وكلمات ذات عناوين مكتوبة. الإخراج عبارة عن سلسلة تحتوي على مسافات بين الكلمات التي تم استبدالها بواصلة ( - ) يجب أن يكون الإخراج جميع الأحرف ذات الأحجام المنخفضة. يجب ألا يحتوي الإخراج على أية مسافات
    + +## Tests +
    + +```yml +tests: + - text: يجب ألا يتغير متغير globalTitle . + testString: 'assert(globalTitle === "Winter Is Coming", "The globalTitle variable should not change.");' + - text: يجب ألا تستخدم شفرتك طريقة replace لهذا التحدي. + testString: 'assert(!code.match(/\.replace/g), "Your code should not use the replace method for this challenge.");' + - text: يجب أن ترجع urlSlug("Winter Is Coming") "winter-is-coming" . + testString: 'assert(urlSlug("Winter Is Coming") === "winter-is-coming", "urlSlug("Winter Is Coming") should return "winter-is-coming".");' + - text: يجب أن ترجع urlSlug(" Winter Is Coming") "winter-is-coming" . + testString: 'assert(urlSlug(" Winter Is Coming") === "winter-is-coming", "urlSlug(" Winter Is  Coming") should return "winter-is-coming".");' + - text: urlSlug("A Mind Needs Books Like A Sword Needs A Whetstone") "a-mind-needs-books-like-a-sword-needs-a-whetstone" . + testString: 'assert(urlSlug("A Mind Needs Books Like A Sword Needs A Whetstone") === "a-mind-needs-books-like-a-sword-needs-a-whetstone", "urlSlug("A Mind Needs Books Like A Sword Needs A Whetstone") should return "a-mind-needs-books-like-a-sword-needs-a-whetstone".");' + - text: يجب أن ترجع urlSlug("Hold The Door") "hold-the-door" . + testString: 'assert(urlSlug("Hold The Door") === "hold-the-door", "urlSlug("Hold The Door") should return "hold-the-door".");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +// the global variable +var globalTitle = "Winter Is Coming"; + +// Add your code below this line +function urlSlug(title) { + + +} +// Add your code above this line + +var winterComing = urlSlug(globalTitle); // Should be "winter-is-coming" + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/avoid-mutations-and-side-effects-using-functional-programming.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/avoid-mutations-and-side-effects-using-functional-programming.arabic.md new file mode 100644 index 0000000000..e34173e1b7 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/avoid-mutations-and-side-effects-using-functional-programming.arabic.md @@ -0,0 +1,62 @@ +--- +id: 587d7b8e367417b2b2512b5e +title: Avoid Mutations and Side Effects Using Functional Programming +challengeType: 1 +videoUrl: '' +localeTitle: تجنب الطفرات والآثار الجانبية باستخدام البرمجة الوظيفية +--- + +## Description +
    إذا لم تكن قد برزت بالفعل ، كانت المشكلة في التحدي السابق مع استدعاء splice في وظيفة tabClose() . لسوء الحظ ، يغير splice الصفيف الأصلي الذي يتم استدعاؤه ، لذلك استعملت المكالمة الثانية له مصفوفة معدلة ، وأعطت نتائج غير متوقعة. هذا مثال صغير لنمط أكبر بكثير - تقوم باستدعاء وظيفة على متغير أو صفيف أو كائن ، وتقوم الوظيفة بتغيير المتغير أو شيء ما في الكائن. أحد المبادئ الأساسية للبرمجة الوظيفية هو عدم تغيير الأشياء. التغييرات تؤدي إلى البق. من السهل منع الأخطاء مع العلم أن وظائفك لا تغير أي شيء ، بما في ذلك وسائط الدالة أو أي متغير عالمي. لم يكن للمثال السابق أي عمليات معقدة ولكن طريقة splice غيرت الصفيف الأصلي ، وأدت إلى خلل. أذكر أنه في البرمجة الوظيفية ، وتغيير أو تغيير الأمور يسمى mutation ، ويسمى النتيجة side effect . من الناحية المثالية ، ينبغي أن تكون pure function ، بمعنى أنها لا تسبب أي آثار جانبية. دعونا نحاول إتقان هذا الانضباط وعدم تغيير أي متغير أو كائن في الكود.
    + +## Instructions +
    ملء رمز لوظيفة incrementer بحيث تقوم بإرجاع قيمة المتغير العالمي fixedValue بنسبة واحد.
    + +## Tests +
    + +```yml +tests: + - text: لا يجب أن تقوم الدالة incrementer بتغيير قيمة fixedValue . + testString: 'assert(fixedValue === 4, "Your function incrementer should not change the value of fixedValue.");' + - text: يجب أن ترجع الدالة incrementer الخاص بك قيمة أكبر من قيمة fixedValue . + testString: 'assert(newValue === 5, "Your incrementer function should return a value that is one larger than the fixedValue value.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +// the global variable +var fixedValue = 4; + +function incrementer () { + // Add your code below this line + + + // Add your code above this line +} + +var newValue = incrementer(); // Should equal 5 +console.log(fixedValue); // Should print 4 + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/combine-an-array-into-a-string-using-the-join-method.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/combine-an-array-into-a-string-using-the-join-method.arabic.md new file mode 100644 index 0000000000..57c0867ed2 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/combine-an-array-into-a-string-using-the-join-method.arabic.md @@ -0,0 +1,65 @@ +--- +id: 587d7daa367417b2b2512b6c +title: Combine an Array into a String Using the join Method +challengeType: 1 +videoUrl: '' +localeTitle: دمج صفيف في سلسلة باستخدام طريقة الانضمام +--- + +## Description +
    على join يستخدم طريقة للانضمام إلى عناصر من مجموعة معا لخلق سلسلة. يستغرق وسيطة عن المحدد الذي يتم استخدامه لفصل عناصر الصفيف في السلسلة. إليك مثال على ذلك:
    var arr = ["Hello"، "World"]؛
    var str = arr.join ("")؛
    // يعين str إلى "Hello World"
    + +## Instructions +
    استخدم طريقة join (من بين آخرين) داخل الدالة sentensify لإنشاء جملة من الكلمات في str السلسلة. يجب على الدالة إرجاع سلسلة. على سبيل المثال ، سيتم تحويل "I-like-Star-Wars" إلى "I like Star Wars". لهذا التحدي ، لا تستخدم طريقة replace .
    + +## Tests +
    + +```yml +tests: + - text: يجب استخدام التعليمات البرمجية لل join الأسلوب. + testString: 'assert(code.match(/\.join/g), "Your code should use the join method.");' + - text: يجب ألا تستخدم الشفرة طريقة replace . + testString: 'assert(!code.match(/\.replace/g), "Your code should not use the replace method.");' + - text: sentensify("May-the-force-be-with-you") يجب إرجاع سلسلة. + testString: 'assert(typeof sentensify("May-the-force-be-with-you") === "string", "sentensify("May-the-force-be-with-you") should return a string.");' + - text: sentensify("May-the-force-be-with-you") يجب أن ترجع "May the force be with you" . + testString: 'assert(sentensify("May-the-force-be-with-you") === "May the force be with you", "sentensify("May-the-force-be-with-you") should return "May the force be with you".");' + - text: sentensify("The.force.is.strong.with.this.one") يجب أن ترجع "The force is strong with this one" . + testString: 'assert(sentensify("The.force.is.strong.with.this.one") === "The force is strong with this one", "sentensify("The.force.is.strong.with.this.one") should return "The force is strong with this one".");' + - text: 'sentensify("There,has,been,an,awakening") يجب أن تعود "There has been an awakening" .' + testString: 'assert(sentensify("There,has,been,an,awakening") === "There has been an awakening", "sentensify("There,has,been,an,awakening") should return "There has been an awakening".");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function sentensify(str) { + // Add your code below this line + + + // Add your code above this line +} +sentensify("May-the-force-be-with-you"); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/combine-two-arrays-using-the-concat-method.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/combine-two-arrays-using-the-concat-method.arabic.md new file mode 100644 index 0000000000..306f514c48 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/combine-two-arrays-using-the-concat-method.arabic.md @@ -0,0 +1,63 @@ +--- +id: 587d7da9367417b2b2512b66 +title: Combine Two Arrays Using the concat Method +challengeType: 1 +videoUrl: '' +localeTitle: الجمع بين اثنين من المصفوفات باستخدام طريقة concat +--- + +## Description +
    يعني Concatenation للانضمام إلى العناصر من طرف إلى آخر. تقدم JavaScript طريقة concat لكل من السلاسل والمصفوفات التي تعمل بنفس الطريقة. بالنسبة إلى المصفوفات ، يتم استدعاء هذه الطريقة على واحد ، ثم يتم توفير مجموعة أخرى كوسيطة concat ، والتي يتم إضافتها إلى نهاية الصفيف الأول. تقوم بإرجاع صفيف جديد ولا يتم تغيير أي من المصفوفات الأصلية. إليك مثال على ذلك:
    [1 ، 2 ، 3] .concat ([4 ، 5 ، 6]) ؛
    // إرجاع مصفوفة جديدة [1 ، 2 ، 3 ، 4 ، 5 ، 6]
    + +## Instructions +
    استخدام concat الأسلوب في nonMutatingConcat وظيفة لسلسلة attach إلى نهاية original . يجب أن تقوم الدالة بإرجاع الصفيف المتسلسل.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن تستخدم التعليمات البرمجية الخاصة بك طريقة concat . + testString: 'assert(code.match(/\.concat/g), "Your code should use the concat method.");' + - text: يجب أن لا تتغير الصفيف first . + testString: 'assert(JSON.stringify(first) === JSON.stringify([1, 2, 3]), "The first array should not change.");' + - text: لا يجب تغيير الصفيف second . + testString: 'assert(JSON.stringify(second) === JSON.stringify([4, 5]), "The second array should not change.");' + - text: 'nonMutatingConcat([1, 2, 3], [4, 5]) [1, 2, 3, 4, 5] .' + testString: 'assert(JSON.stringify(nonMutatingConcat([1, 2, 3], [4, 5])) === JSON.stringify([1, 2, 3, 4, 5]), "nonMutatingConcat([1, 2, 3], [4, 5]) should return [1, 2, 3, 4, 5].");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function nonMutatingConcat(original, attach) { + // Add your code below this line + + + // Add your code above this line +} +var first = [1, 2, 3]; +var second = [4, 5]; +nonMutatingConcat(first, second); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/implement-map-on-a-prototype.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/implement-map-on-a-prototype.arabic.md new file mode 100644 index 0000000000..2bc2953e07 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/implement-map-on-a-prototype.arabic.md @@ -0,0 +1,65 @@ +--- +id: 587d7b8f367417b2b2512b62 +title: Implement map on a Prototype +challengeType: 1 +videoUrl: '' +localeTitle: تنفيذ الخريطة على نموذج أولي +--- + +## Description +
    كما رأيت من تطبيق Array.prototype.map() ، أو ببساطة map() وقت سابق ، فإن طريقة map ترجع مصفوفة بنفس الطول Array.prototype.map() تم الاتصال به. كما أنه لا يغير الصفيف الأصلي ، طالما أن وظيفة رد الاتصال لا. بعبارة أخرى ، map هي وظيفة نقية ، ويعتمد ناتجها فقط على مدخلاته. بالإضافة إلى ذلك ، فإنه يأخذ وظيفة أخرى كحجة لها. فإنه يعلمنا الكثير عن map لمحاولة تنفيذ نسخة منه أن يتصرف تماما مثل Array.prototype.map() مع for حلقة أو Array.prototype.forEach() . ملاحظة: يسمح للوظيفة النقية بتغيير المتغيرات المحلية المحددة في نطاقها ، على الرغم من أنه من الأفضل تجنب ذلك أيضًا.
    + +## Instructions +
    اكتب Array.prototype.myMap() الخاص بك ، والتي يجب أن تتصرف تمامًا مثل Array.prototype.map() . يمكنك استخدام حلقة for أو طريقة forEach .
    + +## Tests +
    + +```yml +tests: + - text: 'يجب أن تساوي new_s [46, 130, 196, 10] .' + testString: 'assert(JSON.stringify(new_s) === JSON.stringify([46, 130, 196, 10]), "new_s should equal [46, 130, 196, 10].");' + - text: يجب ألا تستخدم شفرتك طريقة map . + testString: 'assert(!code.match(/\.map/g), "Your code should not use the map method.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +// the global Array +var s = [23, 65, 98, 5]; + +Array.prototype.myMap = function(callback){ + var newArray = []; + // Add your code below this line + + // Add your code above this line + return newArray; + +}; + +var new_s = s.myMap(function(item){ + return item * 2; +}); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/implement-the-filter-method-on-a-prototype.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/implement-the-filter-method-on-a-prototype.arabic.md new file mode 100644 index 0000000000..5491097542 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/implement-the-filter-method-on-a-prototype.arabic.md @@ -0,0 +1,65 @@ +--- +id: 587d7b8f367417b2b2512b64 +title: Implement the filter Method on a Prototype +challengeType: 1 +videoUrl: '' +localeTitle: تنفيذ مرشح طريقة على النموذج +--- + +## Description +
    من شأنه أن يعلمنا الكثير عن طريقة filter إذا حاولنا تنفيذ إصدار منه يتصرف تمامًا مثل Array.prototype.filter() . يمكن استخدام حلقة for أو Array.prototype.forEach() . ملاحظة: يسمح للوظيفة النقية بتغيير المتغيرات المحلية المحددة في نطاقها ، على الرغم من أنه من الأفضل تجنب ذلك أيضًا.
    + +## Instructions +
    اكتب Array.prototype.myFilter() الخاص بك ، والتي يجب أن تتصرف تمامًا مثل Array.prototype.filter() . يمكنك استخدام حلقة for أو الأسلوب Array.prototype.forEach() .
    + +## Tests +
    + +```yml +tests: + - text: 'يجب أن تساوي new_s [23, 65, 5] .' + testString: 'assert(JSON.stringify(new_s) === JSON.stringify([23, 65, 5]), "new_s should equal [23, 65, 5].");' + - text: يجب ألا تستخدم الشفرة طريقة filter . + testString: 'assert(!code.match(/\.filter/g), "Your code should not use the filter method.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +// the global Array +var s = [23, 65, 98, 5]; + +Array.prototype.myFilter = function(callback){ + var newArray = []; + // Add your code below this line + + // Add your code above this line + return newArray; + +}; + +var new_s = s.myFilter(function(item){ + return item % 2 === 1; +}); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/introduction-to-currying-and-partial-application.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/introduction-to-currying-and-partial-application.arabic.md new file mode 100644 index 0000000000..33da10e4c5 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/introduction-to-currying-and-partial-application.arabic.md @@ -0,0 +1,61 @@ +--- +id: 587d7dab367417b2b2512b70 +title: Introduction to Currying and Partial Application +challengeType: 1 +videoUrl: '' +localeTitle: مقدمة في التجلي والتطبيق الجزئي +--- + +## Description +
    إن arity الوظيفة هو عدد الحجج التي يتطلبها. تعني وظيفة Currying دالة تحويل دالة N arity إلى N دالتي arity 1. وبعبارة أخرى ، فإنها تعيد هيكلة إحدى الدالتين بحيث تأخذ إحدى الحجة ، ثم ترجع دالة أخرى تأخذ الحجة التالية ، وهكذا. إليك مثال على ذلك:
    // غير بالكاري وظيفة
    وظيفة غير مضمنة (x، y) {
    ارجع x + y؛
    }

    // وظيفة الكاري
    الوظيفة curried (x) {
    وظيفة الإرجاع (y) {
    ارجع x + y؛
    }
    }
    curried (1) (2) // Returns 3
    هذا مفيد في البرنامج الخاص بك إذا كنت لا تستطيع توفير جميع الوسائط إلى وظيفة في وقت واحد. يمكنك حفظ كل استدعاء دالة في متغير ، والذي سيحافظ على مرجع الدالة المرتجعة الذي يأخذ الوسيطة التالية عندما تكون متاحة. في ما يلي مثال على ذلك باستخدام وظيفة curried في المثال أعلاه:
    // استدعاء وظيفة بالكاري في أجزاء:
    var funcForY = curried (1)؛
    console.log (funcForY (2))؛ // المطبوعات 3
    وبالمثل ، يمكن وصف partial application على أنه تطبيق عدد قليل من الوسيطات على إحدى الوظائف في وقت ما وإرجاع وظيفة أخرى يتم تطبيقها على مزيد من الوسيطات. إليك مثال على ذلك:
    // وظيفة محايدة
    وظيفة غير متحيزة (x، y، z) {
    ارجع x + y + z؛
    }
    var partialFn = impartial.bind (هذا ، 1 ، 2) ؛
    partialFn (10)؛ // إرجاع 13
    + +## Instructions +
    املأ جسم وظيفة add بحيث يستخدم currying لإضافة المعلمات x و y و z .
    + +## Tests +
    + +```yml +tests: + - text: add(10)(20)(30) يجب أن ترجع 60 . + testString: 'assert(add(10)(20)(30) === 60, "add(10)(20)(30) should return 60.");' + - text: add(1)(2)(3) يجب أن ترجع 6 . + testString: 'assert(add(1)(2)(3) === 6, "add(1)(2)(3) should return 6.");' + - text: add(11)(22)(33) يجب أن ترجع 66 . + testString: 'assert(add(11)(22)(33) === 66, "add(11)(22)(33) should return 66.");' + - text: يجب أن تتضمن شفرتك عبارة نهائية تُرجع x + y + z . + testString: 'assert(code.match(/[xyz]\s*?\+\s*?[xyz]\s*?\+\s*?[xyz]/g), "Your code should include a final statement that returns x + y + z.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function add(x) { + // Add your code below this line + + + // Add your code above this line +} +add(10)(20)(30); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/learn-about-functional-programming.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/learn-about-functional-programming.arabic.md new file mode 100644 index 0000000000..9f3da9bdad --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/learn-about-functional-programming.arabic.md @@ -0,0 +1,79 @@ +--- +id: 587d7b8d367417b2b2512b5b +title: Learn About Functional Programming +challengeType: 1 +videoUrl: '' +localeTitle: تعرف على برمجة وظيفية +--- + +## Description +
    البرمجة الوظيفية هي أسلوب برمجة حيث الحلول عبارة عن وظائف بسيطة ومعزولة دون أي آثار جانبية خارج نطاق الوظيفة. INPUT -> PROCESS -> OUTPUT البرمجة الوظيفية INPUT -> PROCESS -> OUTPUT حول: 1) وظائف معزولة - لا يوجد اعتماد على حالة البرنامج ، والذي يتضمن متغيرات عامة قابلة للتغيير 2) وظائف نقية - نفس المدخلات تعطي دائما نفس الناتج 3) يتم التحكم بعناية بالوظائف ذات الآثار الجانبية المحدودة - أي تغييرات ، أو طفرات ، إلى حالة البرنامج خارج الوظيفة
    + +## Instructions +
    أعضاء freeCodeCamp يحدث أن يحب الشاي. في محرر رمز، و prepareTea و getTea يتم تعريف وظائف بالفعل بالنسبة لك. استدعاء وظيفة getTea للحصول على 40 كوب من الشاي للفريق ، وتخزينها في متغير tea4TeamFCC .
    + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(tea4TeamFCC.length === 40, "The tea4TeamFCC variable should hold 40 cups of tea for the team.");' + - text: يجب أن يعقد المتغير tea4TeamFCC أكواب الشاي الأخضر. + testString: 'assert(tea4TeamFCC[0] === "greenTea", "The tea4TeamFCC variable should hold cups of green tea.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +/** + * A long process to prepare tea. + * @return {string} A cup of tea. + **/ +const prepareTea = () => 'greenTea'; + +/** + * Get given number of cups of tea. + * @param {number} numOfCups Number of required cups of tea. + * @return {Array} Given amount of tea cups. + **/ +const getTea = (numOfCups) => { + const teaCups = []; + + for(let cups = 1; cups <= numOfCups; cups += 1) { + const teaCup = prepareTea(); + teaCups.push(teaCup); + } + + return teaCups; +}; + +// Add your code below this line + +const tea4TeamFCC = null; // :( + +// Add your code above this line + +console.log(tea4TeamFCC); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/pass-arguments-to-avoid-external-dependence-in-a-function.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/pass-arguments-to-avoid-external-dependence-in-a-function.arabic.md new file mode 100644 index 0000000000..1011edf8ac --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/pass-arguments-to-avoid-external-dependence-in-a-function.arabic.md @@ -0,0 +1,64 @@ +--- +id: 587d7b8e367417b2b2512b5f +title: Pass Arguments to Avoid External Dependence in a Function +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(fixedValue === 4, "Your function incrementer should not change the value of fixedValue.");' + - text: '' + testString: 'assert(code.match(/function\s+?incrementer\s*?\(.+?\)/g), "Your incrementer function should take a parameter.");' + - text: '' + testString: 'assert(newValue === 5, "Your incrementer function should return a value that is one larger than the fixedValue value.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +// the global variable +var fixedValue = 4; + +// Add your code below this line +function incrementer () { + + + // Add your code above this line +} + +var newValue = incrementer(fixedValue); // Should equal 5 +console.log(fixedValue); // Should print 4 + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/refactor-global-variables-out-of-functions.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/refactor-global-variables-out-of-functions.arabic.md new file mode 100644 index 0000000000..b7cf2a2a4c --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/refactor-global-variables-out-of-functions.arabic.md @@ -0,0 +1,86 @@ +--- +id: 587d7b8f367417b2b2512b60 +title: Refactor Global Variables Out of Functions +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(JSON.stringify(bookList) === JSON.stringify(["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"]), "bookList should not change and still equal ["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"].");' + - text: '' + testString: 'assert(JSON.stringify(newBookList) === JSON.stringify(["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae", "A Brief History of Time"]), "newBookList should equal ["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae", "A Brief History of Time"].");' + - text: '' + testString: 'assert(JSON.stringify(newerBookList) === JSON.stringify(["The Hound of the Baskervilles", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"]), "newerBookList should equal ["The Hound of the Baskervilles", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"].");' + - text: '' + testString: 'assert(JSON.stringify(newestBookList) === JSON.stringify(["The Hound of the Baskervilles", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae", "A Brief History of Time"]), "newestBookList should equal ["The Hound of the Baskervilles", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae", "A Brief History of Time"].");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +// the global variable +var bookList = ["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"]; + +/* This function should add a book to the list and return the list */ +// New parameters should come before the bookName one + +// Add your code below this line +function add (bookName) { + + return bookList.push(bookName); + + // Add your code above this line +} + +/* This function should remove a book from the list and return the list */ +// New parameters should come before the bookName one + +// Add your code below this line +function remove (bookName) { + if (bookList.indexOf(bookName) >= 0) { + + return bookList.splice(0, 1, bookName); + + // Add your code above this line + } +} + +var newBookList = add(bookList, 'A Brief History of Time'); +var newerBookList = remove(bookList, 'On The Electrodynamics of Moving Bodies'); +var newestBookList = remove(add(bookList, 'A Brief History of Time'), 'On The Electrodynamics of Moving Bodies'); + +console.log(bookList); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/remove-elements-from-an-array-using-slice-instead-of-splice.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/remove-elements-from-an-array-using-slice-instead-of-splice.arabic.md new file mode 100644 index 0000000000..a1068d19f9 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/remove-elements-from-an-array-using-slice-instead-of-splice.arabic.md @@ -0,0 +1,62 @@ +--- +id: 9d7123c8c441eeafaeb5bdef +title: Remove Elements from an Array Using slice Instead of splice +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(code.match(/\.slice/g), "Your code should use the slice method.");' + - text: '' + testString: 'assert(!code.match(/\.splice/g), "Your code should not use the splice method.");' + - text: '' + testString: 'assert(JSON.stringify(inputCities) === JSON.stringify(["Chicago", "Delhi", "Islamabad", "London", "Berlin"]), "The inputCities array should not change.");' + - text: '' + testString: 'assert(JSON.stringify(nonMutatingSplice(["Chicago", "Delhi", "Islamabad", "London", "Berlin"])) === JSON.stringify(["Chicago", "Delhi", "Islamabad"]), "nonMutatingSplice(["Chicago", "Delhi", "Islamabad", "London", "Berlin"]) should return ["Chicago", "Delhi", "Islamabad"].");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function nonMutatingSplice(cities) { + // Add your code below this line + return cities.splice(3); + + // Add your code above this line +} +var inputCities = ["Chicago", "Delhi", "Islamabad", "London", "Berlin"]; +nonMutatingSplice(inputCities); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/return-a-sorted-array-without-changing-the-original-array.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/return-a-sorted-array-without-changing-the-original-array.arabic.md new file mode 100644 index 0000000000..cfaadf561d --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/return-a-sorted-array-without-changing-the-original-array.arabic.md @@ -0,0 +1,62 @@ +--- +id: 587d7da9367417b2b2512b6a +title: Return a Sorted Array Without Changing the Original Array +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +
    استخدم طريقة sort في الدالة nonMutatingSort لفرز عناصر صفيف بترتيب تصاعدي. يجب أن ترجع الدالة صفيفًا جديدًا ولا يتم globalArray متغير globalArray .
    + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(code.match(/\.sort/g), "Your code should use the sort method.");' + - text: '' + testString: 'assert(code.match(/\.concat/g), "Your code should use the concat method.");' + - text: يجب ألا يتغير متغير globalArray . + testString: 'assert(JSON.stringify(globalArray) === JSON.stringify([5, 6, 3, 2, 9]), "The globalArray variable should not change.");' + - text: '' + testString: 'assert(JSON.stringify(nonMutatingSort(globalArray)) === JSON.stringify([2, 3, 5, 6, 9]), "nonMutatingSort(globalArray) should return [2, 3, 5, 6, 9].");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +var globalArray = [5, 6, 3, 2, 9]; +function nonMutatingSort(arr) { + // Add your code below this line + + + // Add your code above this line +} +nonMutatingSort(globalArray); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/return-part-of-an-array-using-the-slice-method.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/return-part-of-an-array-using-the-slice-method.arabic.md new file mode 100644 index 0000000000..f6eb2749a8 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/return-part-of-an-array-using-the-slice-method.arabic.md @@ -0,0 +1,64 @@ +--- +id: 587d7b90367417b2b2512b65 +title: Return Part of an Array Using the slice Method +challengeType: 1 +videoUrl: '' +localeTitle: عودة جزء من صفيف باستخدام طريقة شريحة +--- + +## Description +
    ترجع طريقة slice نسخة من عناصر معينة لصفيف. يمكن أن يستغرق الأمر اثنين من الحجج ، الأول يعطي مؤشر من أين تبدأ شريحة ، والثاني هو مؤشر لمكان إنهاء الشريحة (وهو غير شامل). إذا لم يتم توفير الوسيطات ، فسيكون الإعداد الافتراضي هو البدء في بداية المصفوفة حتى النهاية ، وهي طريقة سهلة لعمل نسخة من الصفيف بأكمله. لا تقوم طريقة slice بتحويل الصفيف الأصلي ، بل تقوم بإرجاع واحدة جديدة. إليك مثال على ذلك:
    var arr = ["Cat"، "Dog"، "Tiger"، "Zebra"]؛
    var newArray = arr.slice (1، 3)؛
    // يعين NewArray to ["Dog"، "Tiger"]
    + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: يجب أن تستخدم شفرتك طريقة slice . + testString: 'assert(code.match(/\.slice/g), "Your code should use the slice method.");' + - text: '' + testString: 'assert(JSON.stringify(inputAnim) === JSON.stringify(["Cat", "Dog", "Tiger", "Zebra", "Ant"]), "The inputAnim variable should not change.");' + - text: '' + testString: 'assert(JSON.stringify(sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 1, 3)) === JSON.stringify(["Dog", "Tiger"]), "sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 1, 3) should return ["Dog", "Tiger"].");' + - text: 'sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 0, 1) يجب أن تعود ["Cat"] .' + testString: 'assert(JSON.stringify(sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 0, 1)) === JSON.stringify(["Cat"]), "sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 0, 1) should return ["Cat"].");' + - text: 'sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 1, 4) يجب أن تعود ["Dog", "Tiger", "Zebra"] .' + testString: 'assert(JSON.stringify(sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 1, 4)) === JSON.stringify(["Dog", "Tiger", "Zebra"]), "sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 1, 4) should return ["Dog", "Tiger", "Zebra"].");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function sliceArray(anim, beginSlice, endSlice) { + // Add your code below this line + + + // Add your code above this line +} +var inputAnim = ["Cat", "Dog", "Tiger", "Zebra", "Ant"]; +sliceArray(inputAnim, 1, 3); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/sort-an-array-alphabetically-using-the-sort-method.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/sort-an-array-alphabetically-using-the-sort-method.arabic.md new file mode 100644 index 0000000000..70e6dce5e6 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/sort-an-array-alphabetically-using-the-sort-method.arabic.md @@ -0,0 +1,61 @@ +--- +id: 587d7da9367417b2b2512b69 +title: Sort an Array Alphabetically using the sort Method +challengeType: 1 +videoUrl: '' +localeTitle: فرز صفيف أبجديا باستخدام طريقة الفرز +--- + +## Description +
    يقوم أسلوب sort بفرز عناصر المصفوفة وفقًا لوظيفة رد الاتصال. فمثلا:
    function ascendingOrder (arr) {
    return arr.sort (function (a، b) {
    عودة a - b؛
    })؛
    }
    تصاعدي ([1 ، 5 ، 2 ، 3 ، 4]) ؛
    // إرجاع [1 ، 2 ، 3 ، 4 ، 5]

    function reverseAlpha (arr) {
    return arr.sort (function (a، b) {
    ارجع <b؛
    })؛
    }
    reverseAlpha (['l'، 'h'، 'z'، 'b'، 's'])؛
    // Returns ['z'، 's'، 'l'، 'h'، 'b']
    ملاحظة: يتم تشجيعه على توفير وظيفة رد اتصال لتحديد كيفية فرز عناصر المصفوفة. طريقة الفرز الافتراضية لجافا سكريبت هي عن طريق سلسلة قيمة نقطة Unicode ، والتي قد ترجع نتائج غير متوقعة.
    + +## Instructions +
    استخدم طريقة sort في الدالة alphabeticalOrder لفرز عناصر arr حسب الترتيب الأبجدي.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن تستخدم التعليمات البرمجية الخاصة بك طريقة sort . + testString: 'assert(code.match(/\.sort/g), "Your code should use the sort method.");' + - text: 'alphabeticalOrder(["a", "d", "c", "a", "z", "g"]) يجب أن ترجع ["a", "a", "c", "d", "g", "z"] .' + testString: 'assert(JSON.stringify(alphabeticalOrder(["a", "d", "c", "a", "z", "g"])) === JSON.stringify(["a", "a", "c", "d", "g", "z"]), "alphabeticalOrder(["a", "d", "c", "a", "z", "g"]) should return ["a", "a", "c", "d", "g", "z"].");' + - text: 'alphabeticalOrder(["x", "h", "a", "m", "n", "m"]) يجب أن ترجع ["a", "h", "m", "m", "n", "x"] .' + testString: 'assert(JSON.stringify(alphabeticalOrder(["x", "h", "a", "m", "n", "m"])) === JSON.stringify(["a", "h", "m", "m", "n", "x"]), "alphabeticalOrder(["x", "h", "a", "m", "n", "m"]) should return ["a", "h", "m", "m", "n", "x"].");' + - text: 'alphabeticalOrder(["a", "a", "a", "a", "x", "t"]) يجب أن ترجع ["a", "a", "a", "a", "t", "x"] .' + testString: 'assert(JSON.stringify(alphabeticalOrder(["a", "a", "a", "a", "x", "t"])) === JSON.stringify(["a", "a", "a", "a", "t", "x"]), "alphabeticalOrder(["a", "a", "a", "a", "x", "t"]) should return ["a", "a", "a", "a", "t", "x"].");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function alphabeticalOrder(arr) { + // Add your code below this line + + + // Add your code above this line +} +alphabeticalOrder(["a", "d", "c", "a", "z", "g"]); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/split-a-string-into-an-array-using-the-split-method.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/split-a-string-into-an-array-using-the-split-method.arabic.md new file mode 100644 index 0000000000..be73ac0100 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/split-a-string-into-an-array-using-the-split-method.arabic.md @@ -0,0 +1,61 @@ +--- +id: 587d7daa367417b2b2512b6b +title: Split a String into an Array Using the split Method +challengeType: 1 +videoUrl: '' +localeTitle: تقسيم سلسلة في صفيف باستخدام طريقة الانقسام +--- + +## Description +
    split طريقة الانقسام إلى سلسلة في صفيف من السلاسل. يتطلب الأمر حجة للمُحدد ، والتي يمكن أن تكون حرفًا تستخدم لتجزئة السلسلة أو التعبير العادي. على سبيل المثال ، إذا كان المحدد مساحة ، تحصل على صفيف من الكلمات ، وإذا كان المحدد عبارة عن سلسلة فارغة ، فستحصل على مصفوفة لكل حرف في السلسلة. في ما يلي مثالان يقومان بتقسيم سلسلة واحدة بمسافات ، ثم آخر بالأرقام باستخدام تعبير عادي:
    var str = "Hello World"؛
    var bySpace = str.split ("")؛
    // Sets bySpace to ["Hello"، "World"]

    var otherString = "How9are7you2today" ؛
    var byDigits = otherString.split (/ \ d /)؛
    // Sets byDigits to ["How"، "are"، "you"، "today"]
    بما أن الجمل غير قابلة للتغيير ، فإن طريقة split تجعل من السهل العمل معهم.
    + +## Instructions +
    استخدم طريقة split داخل الدالة splitify لتقسيم str إلى صفيف من الكلمات. يجب أن ترجع الدالة الصفيف. لاحظ أنه لا يتم دائمًا فصل الكلمات عن مسافات ، ويجب ألا يحتوي الصفيف على علامات ترقيم.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن تستخدم التعليمات البرمجية الخاصة بك طريقة split . + testString: 'assert(code.match(/\.split/g), "Your code should use the split method.");' + - text: 'splitify("Hello World,I-am code") يجب أن تعرض ["Hello", "World", "I", "am", "code"] .' + testString: 'assert(JSON.stringify(splitify("Hello World,I-am code")) === JSON.stringify(["Hello", "World", "I", "am", "code"]), "splitify("Hello World,I-am code") should return ["Hello", "World", "I", "am", "code"].");' + - text: 'splitify("Earth-is-our home") يجب أن تعود ["Earth", "is", "our", "home"] .' + testString: 'assert(JSON.stringify(splitify("Earth-is-our home")) === JSON.stringify(["Earth", "is", "our", "home"]), "splitify("Earth-is-our home") should return ["Earth", "is", "our", "home"].");' + - text: 'splitify("This.is.a-sentence") يجب أن ترجع ["This", "is", "a", "sentence"] .' + testString: 'assert(JSON.stringify(splitify("This.is.a-sentence")) === JSON.stringify(["This", "is", "a", "sentence"]), "splitify("This.is.a-sentence") should return ["This", "is", "a", "sentence"].");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function splitify(str) { + // Add your code below this line + + + // Add your code above this line +} +splitify("Hello World,I-am code"); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/understand-functional-programming-terminology.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/understand-functional-programming-terminology.arabic.md new file mode 100644 index 0000000000..bdd352c640 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/understand-functional-programming-terminology.arabic.md @@ -0,0 +1,94 @@ +--- +id: 587d7b8e367417b2b2512b5c +title: Understand Functional Programming Terminology +challengeType: 1 +videoUrl: '' +localeTitle: فهم البرمجة الوظيفية المصطلحات +--- + +## Description +
    كان فريق لجنة الاتصالات الفيدرالية قد تأرجح المزاج ويريد الآن نوعين من الشاي: الشاي الأخضر والشاي الأسود. حقائق عامة: تقلبات مزاج العميل شائعة جدًا. باستخدام هذه المعلومات ، سنحتاج إلى إعادة النظر في وظيفة getTea من التحدي الأخير للتعامل مع طلبات الشاي المختلفة. يمكننا تعديل getTea لقبول وظيفة كمعلمة لتكون قادرة على تغيير نوع الشاي الذي تقوم بإعداده. وهذا يجعل getTea أكثر مرونة ، ويعطي للمبرمج مزيدًا من التحكم عند تغيير طلبات العميل. لكن أولاً ، دعونا نغطي بعض المصطلحات الفنية: Callbacks هي الوظائف التي يتم تمريرها أو تمريرها إلى وظيفة أخرى لتحديد طلب هذه الوظيفة. ربما تكون قد شاهدتهم مروراً بطرق أخرى ، على سبيل المثال في filter ، تخبر وظيفة معاودة الاتصال JavaScript عن كيفية تصفية مصفوفة. تدعى الدالات التي يمكن تعيينها لمتغير ، يتم تمريرها إلى دالة أخرى ، أو يتم إرجاعها من دالة أخرى تمامًا مثل أي قيمة عادية أخرى ، وظائف first class . في JavaScript ، تعد جميع الوظائف من وظائف first class . تسمى الدالات التي تأخذ دالة كوسيطة ، أو ترجع دالة كقيمة إرجاع ، وظائف higher order . عندما يتم تمرير الوظائف إلى وظيفة أخرى أو يتم إرجاعها من وظيفة أخرى ، فإن تلك الوظائف التي يتم تمريرها أو إعادتها يمكن أن تسمى lambda .
    + +## Instructions +
    إعداد 27 أكواب من الشاي الأخضر و 13 أكواب من الشاي الأسود وتخزينها في tea4GreenTeamFCC و tea4BlackTeamFCC المتغيرات، على التوالي. لاحظ أن وظيفة getTea قد تم تعديلها بحيث تأخذ الآن وظيفة كالوسيطة الأولى. ملاحظة: يتم توفير البيانات (عدد أكواب الشاي) كوسيطة أخيرة. سنناقش هذا أكثر في الدروس اللاحقة.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن tea4GreenTeamFCC المتغير tea4GreenTeamFCC على 27 كوب شاي أخضر للفريق. + testString: 'assert(tea4GreenTeamFCC.length === 27, "The tea4GreenTeamFCC variable should hold 27 cups of green tea for the team.");' + - text: يجب أن يحتفظ المتغير tea4GreenTeamFCC من الشاي الأخضر. + testString: 'assert(tea4GreenTeamFCC[0] === "greenTea", "The tea4GreenTeamFCC variable should hold cups of green tea.");' + - text: يجب أن يحتفظ المتغير tea4BlackTeamFCC 13 كوب من الشاي الأسود. + testString: 'assert(tea4BlackTeamFCC.length === 13, "The tea4BlackTeamFCC variable should hold 13 cups of black tea.");' + - text: يجب أن يحتفظ المتغير tea4BlackTeamFCC الشاي الأسود. + testString: 'assert(tea4BlackTeamFCC[0] === "blackTea", "The tea4BlackTeamFCC variable should hold cups of black tea.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +/** + * A long process to prepare green tea. + * @return {string} A cup of green tea. + **/ +const prepareGreenTea = () => 'greenTea'; + +/** + * A long process to prepare black tea. + * @return {string} A cup of black tea. + **/ +const prepareBlackTea = () => 'blackTea'; + +/** + * Get given number of cups of tea. + * @param {function():string} prepareTea The type of tea preparing function. + * @param {number} numOfCups Number of required cups of tea. + * @return {Array} Given amount of tea cups. + **/ +const getTea = (prepareTea, numOfCups) => { + const teaCups = []; + + for(let cups = 1; cups <= numOfCups; cups += 1) { + const teaCup = prepareTea(); + teaCups.push(teaCup); + } + + return teaCups; +}; + +// Add your code below this line + +const tea4GreenTeamFCC = null; // :( +const tea4BlackTeamFCC = null; // :( + +// Add your code above this line + +console.log( + tea4GreenTeamFCC, + tea4BlackTeamFCC +); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/understand-the-hazards-of-using-imperative-code.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/understand-the-hazards-of-using-imperative-code.arabic.md new file mode 100644 index 0000000000..372a76fc73 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/understand-the-hazards-of-using-imperative-code.arabic.md @@ -0,0 +1,87 @@ +--- +id: 587d7b8e367417b2b2512b5d +title: Understand the Hazards of Using Imperative Code +challengeType: 1 +videoUrl: '' +localeTitle: فهم مخاطر استخدام الرمز الاحتمالي +--- + +## Description +
    البرمجة الوظيفية هي عادة جيدة. إنه يحافظ على سهولة إدارة التعليمة البرمجية ، ويوفر لك من الأخطاء الخداعية. ولكن قبل أن نصل إلى هناك ، فلننظر إلى مقاربة حتمية للبرمجة لإلقاء الضوء على المواضع التي قد تواجهك فيها. في اللغة الإنجليزية (والعديد من اللغات الأخرى) ، يتم استخدام الفعل الحتمي لإعطاء الأوامر. وبالمثل ، فإن أسلوبًا إلزاميًا في البرمجة هو أسلوب يمنح الكمبيوتر مجموعة من العبارات لتنفيذ مهمة ما. غالبًا ما تؤدي العبارات إلى تغيير حالة البرنامج ، مثل تحديث المتغيرات العامة. المثال الكلاسيكي هو كتابة حلقة for والتي تعطي اتجاهات دقيقة لتكرارها فوق مؤشرات الصفيف. وفي المقابل ، تعد البرمجة الوظيفية شكلاً من أشكال البرمجة التعريفية. تخبر الكمبيوتر بما تريد القيام به عن طريق استدعاء طريقة أو وظيفة. تقدم JavaScript العديد من الطرق المحددة مسبقًا التي تتعامل مع المهام الشائعة ، لذا لا تحتاج إلى كتابة طريقة أداء الكمبيوتر لها. على سبيل المثال، بدلا من استخدام for حلقة المذكورة أعلاه، يمكن استدعاء map الطريقة التي يعالج تفاصيل بالتكرار عبر صفيف. يساعد هذا في تجنب الأخطاء الدلالية ، مثل "Off By One Errors" التي تمت تغطيتها في قسم التصحيح. فكر في السيناريو: أنت تتصفح الويب في متصفحك وتريد تتبع علامات التبويب التي فتحتها. دعونا نحاول هذا النموذج باستخدام بعض التعليمات البرمجية بسيطة وجوه المنحى. يتكون كائن إطار من علامات التبويب ، وعادة ما يكون لديك أكثر من نافذة مفتوحة. يتم الاحتفاظ بعناوين كل موقع مفتوح في كل كائن نافذة في مصفوفة. بعد العمل في المستعرض (فتح علامات تبويب جديدة ، ودمج النوافذ ، وعلامات الإغلاق) ، تريد طباعة علامات التبويب التي لا تزال مفتوحة. تتم إزالة علامات التبويب المغلقة من الصفيف وتضاف علامات التبويب الجديدة (للبساطة) إلى نهايتها. يعرض محرر التعليمة البرمجية تطبيقًا لهذه الوظيفة بوظائف tabOpen() و tabClose() و join() . تعتبر tabs الصفائف جزءًا من كائن الإطار الذي يخزن اسم الصفحات المفتوحة.

    تعليمات

    قم بتشغيل الكود في المحرر. إنها تستخدم طريقة لها آثار جانبية في البرنامج ، مما يتسبب في إخراج غير صحيح. يجب أن تكون القائمة النهائية لعلامات التبويب المفتوحة ['FB', 'Gitter', 'Reddit', 'Twitter', 'Medium', 'new tab', 'Netflix', 'YouTube', 'Vine', 'GMail', 'Work mail', 'Docs', 'freeCodeCamp', 'new tab'] ولكن الإخراج سيكون مختلفًا بعض الشيء. اعمل من خلال الشفرة واكتشف ما إذا كان يمكنك معرفة المشكلة ، ثم تقدم إلى التحدي التالي لمعرفة المزيد.

    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(true, "Move ahead to understand the error.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +// tabs is an array of titles of each site open within the window +var Window = function(tabs) { + this.tabs = tabs; // we keep a record of the array inside the object +}; + +// When you join two windows into one window +Window.prototype.join = function (otherWindow) { + this.tabs = this.tabs.concat(otherWindow.tabs); + return this; +}; + +// When you open a new tab at the end +Window.prototype.tabOpen = function (tab) { + this.tabs.push('new tab'); // let's open a new tab for now + return this; +}; + +// When you close a tab +Window.prototype.tabClose = function (index) { + var tabsBeforeIndex = this.tabs.splice(0, index); // get the tabs before the tab + var tabsAfterIndex = this.tabs.splice(index); // get the tabs after the tab + + this.tabs = tabsBeforeIndex.concat(tabsAfterIndex); // join them together + return this; + }; + +// Let's create three browser windows +var workWindow = new Window(['GMail', 'Inbox', 'Work mail', 'Docs', 'freeCodeCamp']); // Your mailbox, drive, and other work sites +var socialWindow = new Window(['FB', 'Gitter', 'Reddit', 'Twitter', 'Medium']); // Social sites +var videoWindow = new Window(['Netflix', 'YouTube', 'Vimeo', 'Vine']); // Entertainment sites + +// Now perform the tab opening, closing, and other operations +var finalTabs = socialWindow + .tabOpen() // Open a new tab for cat memes + .join(videoWindow.tabClose(2)) // Close third tab in video window, and join + .join(workWindow.tabClose(1).tabOpen()); + +alert(finalTabs.tabs); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/use-the-every-method-to-check-that-every-element-in-an-array-meets-a-criteria.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/use-the-every-method-to-check-that-every-element-in-an-array-meets-a-criteria.arabic.md new file mode 100644 index 0000000000..1fbb4450d6 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/use-the-every-method-to-check-that-every-element-in-an-array-meets-a-criteria.arabic.md @@ -0,0 +1,61 @@ +--- +id: 587d7dab367417b2b2512b6e +title: Use the every Method to Check that Every Element in an Array Meets a Criteria +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(code.match(/\.every/g), "Your code should use the every method.");' + - text: '' + testString: 'assert(!checkPositive([1, 2, 3, -4, 5]), "checkPositive([1, 2, 3, -4, 5]) should return false.");' + - text: '' + testString: 'assert(checkPositive([1, 2, 3, 4, 5]), "checkPositive([1, 2, 3, 4, 5]) should return true.");' + - text: '' + testString: 'assert(!checkPositive([1, -2, 3, -4, 5]), "checkPositive([1, -2, 3, -4, 5]) should return false.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function checkPositive(arr) { + // Add your code below this line + + + // Add your code above this line +} +checkPositive([1, 2, 3, -4, 5]); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/use-the-filter-method-to-extract-data-from-an-array.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/use-the-filter-method-to-extract-data-from-an-array.arabic.md new file mode 100644 index 0000000000..8c6a100e43 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/use-the-filter-method-to-extract-data-from-an-array.arabic.md @@ -0,0 +1,175 @@ +--- +id: 587d7b8f367417b2b2512b63 +title: Use the filter Method to Extract Data from an Array +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(watchList[0].Title === "Inception" && watchList[4].Director == "James Cameron", "The watchList variable should not change.");' + - text: '' + testString: 'assert(code.match(/\.filter/g), "Your code should use the filter method.");' + - text: '' + testString: 'assert(!code.match(/for\s*?\(.+?\)/g), "Your code should not use a for loop.");' + - text: '' + testString: 'assert.deepEqual(filteredList, [{"title": "Inception","rating": "8.8"},{"title": "Interstellar","rating": "8.6"},{"title": "The Dark Knight","rating": "9.0"},{"title": "Batman Begins","rating": "8.3"}], "filteredList should equal [{"title": "Inception","rating": "8.8"},{"title": "Interstellar","rating": "8.6"},{"title": "The Dark Knight","rating": "9.0"},{"title": "Batman Begins","rating": "8.3"}].");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +// the global variable +var watchList = [ + { + "Title": "Inception", + "Year": "2010", + "Rated": "PG-13", + "Released": "16 Jul 2010", + "Runtime": "148 min", + "Genre": "Action, Adventure, Crime", + "Director": "Christopher Nolan", + "Writer": "Christopher Nolan", + "Actors": "Leonardo DiCaprio, Joseph Gordon-Levitt, Ellen Page, Tom Hardy", + "Plot": "A thief, who steals corporate secrets through use of dream-sharing technology, is given the inverse task of planting an idea into the mind of a CEO.", + "Language": "English, Japanese, French", + "Country": "USA, UK", + "Awards": "Won 4 Oscars. Another 143 wins & 198 nominations.", + "Poster": "http://ia.media-imdb.com/images/M/MV5BMjAxMzY3NjcxNF5BMl5BanBnXkFtZTcwNTI5OTM0Mw@@._V1_SX300.jpg", + "Metascore": "74", + "imdbRating": "8.8", + "imdbVotes": "1,446,708", + "imdbID": "tt1375666", + "Type": "movie", + "Response": "True" + }, + { + "Title": "Interstellar", + "Year": "2014", + "Rated": "PG-13", + "Released": "07 Nov 2014", + "Runtime": "169 min", + "Genre": "Adventure, Drama, Sci-Fi", + "Director": "Christopher Nolan", + "Writer": "Jonathan Nolan, Christopher Nolan", + "Actors": "Ellen Burstyn, Matthew McConaughey, Mackenzie Foy, John Lithgow", + "Plot": "A team of explorers travel through a wormhole in space in an attempt to ensure humanity's survival.", + "Language": "English", + "Country": "USA, UK", + "Awards": "Won 1 Oscar. Another 39 wins & 132 nominations.", + "Poster": "http://ia.media-imdb.com/images/M/MV5BMjIxNTU4MzY4MF5BMl5BanBnXkFtZTgwMzM4ODI3MjE@._V1_SX300.jpg", + "Metascore": "74", + "imdbRating": "8.6", + "imdbVotes": "910,366", + "imdbID": "tt0816692", + "Type": "movie", + "Response": "True" + }, + { + "Title": "The Dark Knight", + "Year": "2008", + "Rated": "PG-13", + "Released": "18 Jul 2008", + "Runtime": "152 min", + "Genre": "Action, Adventure, Crime", + "Director": "Christopher Nolan", + "Writer": "Jonathan Nolan (screenplay), Christopher Nolan (screenplay), Christopher Nolan (story), David S. Goyer (story), Bob Kane (characters)", + "Actors": "Christian Bale, Heath Ledger, Aaron Eckhart, Michael Caine", + "Plot": "When the menace known as the Joker wreaks havoc and chaos on the people of Gotham, the caped crusader must come to terms with one of the greatest psychological tests of his ability to fight injustice.", + "Language": "English, Mandarin", + "Country": "USA, UK", + "Awards": "Won 2 Oscars. Another 146 wins & 142 nominations.", + "Poster": "http://ia.media-imdb.com/images/M/MV5BMTMxNTMwODM0NF5BMl5BanBnXkFtZTcwODAyMTk2Mw@@._V1_SX300.jpg", + "Metascore": "82", + "imdbRating": "9.0", + "imdbVotes": "1,652,832", + "imdbID": "tt0468569", + "Type": "movie", + "Response": "True" + }, + { + "Title": "Batman Begins", + "Year": "2005", + "Rated": "PG-13", + "Released": "15 Jun 2005", + "Runtime": "140 min", + "Genre": "Action, Adventure", + "Director": "Christopher Nolan", + "Writer": "Bob Kane (characters), David S. Goyer (story), Christopher Nolan (screenplay), David S. Goyer (screenplay)", + "Actors": "Christian Bale, Michael Caine, Liam Neeson, Katie Holmes", + "Plot": "After training with his mentor, Batman begins his fight to free crime-ridden Gotham City from the corruption that Scarecrow and the League of Shadows have cast upon it.", + "Language": "English, Urdu, Mandarin", + "Country": "USA, UK", + "Awards": "Nominated for 1 Oscar. Another 15 wins & 66 nominations.", + "Poster": "http://ia.media-imdb.com/images/M/MV5BNTM3OTc0MzM2OV5BMl5BanBnXkFtZTYwNzUwMTI3._V1_SX300.jpg", + "Metascore": "70", + "imdbRating": "8.3", + "imdbVotes": "972,584", + "imdbID": "tt0372784", + "Type": "movie", + "Response": "True" + }, + { + "Title": "Avatar", + "Year": "2009", + "Rated": "PG-13", + "Released": "18 Dec 2009", + "Runtime": "162 min", + "Genre": "Action, Adventure, Fantasy", + "Director": "James Cameron", + "Writer": "James Cameron", + "Actors": "Sam Worthington, Zoe Saldana, Sigourney Weaver, Stephen Lang", + "Plot": "A paraplegic marine dispatched to the moon Pandora on a unique mission becomes torn between following his orders and protecting the world he feels is his home.", + "Language": "English, Spanish", + "Country": "USA, UK", + "Awards": "Won 3 Oscars. Another 80 wins & 121 nominations.", + "Poster": "http://ia.media-imdb.com/images/M/MV5BMTYwOTEwNjAzMl5BMl5BanBnXkFtZTcwODc5MTUwMw@@._V1_SX300.jpg", + "Metascore": "83", + "imdbRating": "7.9", + "imdbVotes": "876,575", + "imdbID": "tt0499549", + "Type": "movie", + "Response": "True" + } +]; + +// Add your code below this line + +var filteredList; + +// Add your code above this line + +console.log(filteredList); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/use-the-map-method-to-extract-data-from-an-array.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/use-the-map-method-to-extract-data-from-an-array.arabic.md new file mode 100644 index 0000000000..c88ee66f21 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/use-the-map-method-to-extract-data-from-an-array.arabic.md @@ -0,0 +1,178 @@ +--- +id: 587d7b8f367417b2b2512b61 +title: Use the map Method to Extract Data from an Array +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(watchList[0].Title === "Inception" && watchList[4].Director == "James Cameron", "The watchList variable should not change.");' + - text: '' + testString: 'assert(!code.match(/for\s*?\(.+?\)/g), "Your code should not use a for loop.");' + - text: '' + testString: 'assert(code.match(/\.map/g), "Your code should use the map method.");' + - text: '' + testString: 'assert(JSON.stringify(rating) === JSON.stringify([{"title":"Inception","rating":"8.8"},{"title":"Interstellar","rating":"8.6"},{"title":"The Dark Knight","rating":"9.0"},{"title":"Batman Begins","rating":"8.3"},{"title":"Avatar","rating":"7.9"}]), "rating should equal [{"title":"Inception","rating":"8.8"},{"title":"Interstellar","rating":"8.6"},{"title":"The Dark Knight","rating":"9.0"},{"title":"Batman Begins","rating":"8.3"},{"title":"Avatar","rating":"7.9"}].");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +// the global variable +var watchList = [ + { + "Title": "Inception", + "Year": "2010", + "Rated": "PG-13", + "Released": "16 Jul 2010", + "Runtime": "148 min", + "Genre": "Action, Adventure, Crime", + "Director": "Christopher Nolan", + "Writer": "Christopher Nolan", + "Actors": "Leonardo DiCaprio, Joseph Gordon-Levitt, Ellen Page, Tom Hardy", + "Plot": "A thief, who steals corporate secrets through use of dream-sharing technology, is given the inverse task of planting an idea into the mind of a CEO.", + "Language": "English, Japanese, French", + "Country": "USA, UK", + "Awards": "Won 4 Oscars. Another 143 wins & 198 nominations.", + "Poster": "http://ia.media-imdb.com/images/M/MV5BMjAxMzY3NjcxNF5BMl5BanBnXkFtZTcwNTI5OTM0Mw@@._V1_SX300.jpg", + "Metascore": "74", + "imdbRating": "8.8", + "imdbVotes": "1,446,708", + "imdbID": "tt1375666", + "Type": "movie", + "Response": "True" + }, + { + "Title": "Interstellar", + "Year": "2014", + "Rated": "PG-13", + "Released": "07 Nov 2014", + "Runtime": "169 min", + "Genre": "Adventure, Drama, Sci-Fi", + "Director": "Christopher Nolan", + "Writer": "Jonathan Nolan, Christopher Nolan", + "Actors": "Ellen Burstyn, Matthew McConaughey, Mackenzie Foy, John Lithgow", + "Plot": "A team of explorers travel through a wormhole in space in an attempt to ensure humanity's survival.", + "Language": "English", + "Country": "USA, UK", + "Awards": "Won 1 Oscar. Another 39 wins & 132 nominations.", + "Poster": "http://ia.media-imdb.com/images/M/MV5BMjIxNTU4MzY4MF5BMl5BanBnXkFtZTgwMzM4ODI3MjE@._V1_SX300.jpg", + "Metascore": "74", + "imdbRating": "8.6", + "imdbVotes": "910,366", + "imdbID": "tt0816692", + "Type": "movie", + "Response": "True" + }, + { + "Title": "The Dark Knight", + "Year": "2008", + "Rated": "PG-13", + "Released": "18 Jul 2008", + "Runtime": "152 min", + "Genre": "Action, Adventure, Crime", + "Director": "Christopher Nolan", + "Writer": "Jonathan Nolan (screenplay), Christopher Nolan (screenplay), Christopher Nolan (story), David S. Goyer (story), Bob Kane (characters)", + "Actors": "Christian Bale, Heath Ledger, Aaron Eckhart, Michael Caine", + "Plot": "When the menace known as the Joker wreaks havoc and chaos on the people of Gotham, the caped crusader must come to terms with one of the greatest psychological tests of his ability to fight injustice.", + "Language": "English, Mandarin", + "Country": "USA, UK", + "Awards": "Won 2 Oscars. Another 146 wins & 142 nominations.", + "Poster": "http://ia.media-imdb.com/images/M/MV5BMTMxNTMwODM0NF5BMl5BanBnXkFtZTcwODAyMTk2Mw@@._V1_SX300.jpg", + "Metascore": "82", + "imdbRating": "9.0", + "imdbVotes": "1,652,832", + "imdbID": "tt0468569", + "Type": "movie", + "Response": "True" + }, + { + "Title": "Batman Begins", + "Year": "2005", + "Rated": "PG-13", + "Released": "15 Jun 2005", + "Runtime": "140 min", + "Genre": "Action, Adventure", + "Director": "Christopher Nolan", + "Writer": "Bob Kane (characters), David S. Goyer (story), Christopher Nolan (screenplay), David S. Goyer (screenplay)", + "Actors": "Christian Bale, Michael Caine, Liam Neeson, Katie Holmes", + "Plot": "After training with his mentor, Batman begins his fight to free crime-ridden Gotham City from the corruption that Scarecrow and the League of Shadows have cast upon it.", + "Language": "English, Urdu, Mandarin", + "Country": "USA, UK", + "Awards": "Nominated for 1 Oscar. Another 15 wins & 66 nominations.", + "Poster": "http://ia.media-imdb.com/images/M/MV5BNTM3OTc0MzM2OV5BMl5BanBnXkFtZTYwNzUwMTI3._V1_SX300.jpg", + "Metascore": "70", + "imdbRating": "8.3", + "imdbVotes": "972,584", + "imdbID": "tt0372784", + "Type": "movie", + "Response": "True" + }, + { + "Title": "Avatar", + "Year": "2009", + "Rated": "PG-13", + "Released": "18 Dec 2009", + "Runtime": "162 min", + "Genre": "Action, Adventure, Fantasy", + "Director": "James Cameron", + "Writer": "James Cameron", + "Actors": "Sam Worthington, Zoe Saldana, Sigourney Weaver, Stephen Lang", + "Plot": "A paraplegic marine dispatched to the moon Pandora on a unique mission becomes torn between following his orders and protecting the world he feels is his home.", + "Language": "English, Spanish", + "Country": "USA, UK", + "Awards": "Won 3 Oscars. Another 80 wins & 121 nominations.", + "Poster": "http://ia.media-imdb.com/images/M/MV5BMTYwOTEwNjAzMl5BMl5BanBnXkFtZTcwODc5MTUwMw@@._V1_SX300.jpg", + "Metascore": "83", + "imdbRating": "7.9", + "imdbVotes": "876,575", + "imdbID": "tt0499549", + "Type": "movie", + "Response": "True" + } +]; + +// Add your code below this line + +var rating = []; +for(var i=0; i < watchList.length; i++){ + rating.push({title: watchList[i]["Title"], rating: watchList[i]["imdbRating"]}); +} + +// Add your code above this line + +console.log(rating); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/use-the-reduce-method-to-analyze-data.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/use-the-reduce-method-to-analyze-data.arabic.md new file mode 100644 index 0000000000..642e8d394b --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/use-the-reduce-method-to-analyze-data.arabic.md @@ -0,0 +1,175 @@ +--- +id: 587d7da9367417b2b2512b68 +title: Use the reduce Method to Analyze Data +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(watchList[0].Title === "Inception" && watchList[4].Director == "James Cameron", "The watchList variable should not change.");' + - text: '' + testString: 'assert(code.match(/\.reduce/g), "Your code should use the reduce method.");' + - text: '' + testString: 'assert(averageRating == 8.675, "The averageRating should equal 8.675.");' + - text: '' + testString: 'assert(!code.match(/for\s*?\(.*\)/g), "Your code should not use a for loop.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +// the global variable +var watchList = [ + { + "Title": "Inception", + "Year": "2010", + "Rated": "PG-13", + "Released": "16 Jul 2010", + "Runtime": "148 min", + "Genre": "Action, Adventure, Crime", + "Director": "Christopher Nolan", + "Writer": "Christopher Nolan", + "Actors": "Leonardo DiCaprio, Joseph Gordon-Levitt, Ellen Page, Tom Hardy", + "Plot": "A thief, who steals corporate secrets through use of dream-sharing technology, is given the inverse task of planting an idea into the mind of a CEO.", + "Language": "English, Japanese, French", + "Country": "USA, UK", + "Awards": "Won 4 Oscars. Another 143 wins & 198 nominations.", + "Poster": "http://ia.media-imdb.com/images/M/MV5BMjAxMzY3NjcxNF5BMl5BanBnXkFtZTcwNTI5OTM0Mw@@._V1_SX300.jpg", + "Metascore": "74", + "imdbRating": "8.8", + "imdbVotes": "1,446,708", + "imdbID": "tt1375666", + "Type": "movie", + "Response": "True" + }, + { + "Title": "Interstellar", + "Year": "2014", + "Rated": "PG-13", + "Released": "07 Nov 2014", + "Runtime": "169 min", + "Genre": "Adventure, Drama, Sci-Fi", + "Director": "Christopher Nolan", + "Writer": "Jonathan Nolan, Christopher Nolan", + "Actors": "Ellen Burstyn, Matthew McConaughey, Mackenzie Foy, John Lithgow", + "Plot": "A team of explorers travel through a wormhole in space in an attempt to ensure humanity's survival.", + "Language": "English", + "Country": "USA, UK", + "Awards": "Won 1 Oscar. Another 39 wins & 132 nominations.", + "Poster": "http://ia.media-imdb.com/images/M/MV5BMjIxNTU4MzY4MF5BMl5BanBnXkFtZTgwMzM4ODI3MjE@._V1_SX300.jpg", + "Metascore": "74", + "imdbRating": "8.6", + "imdbVotes": "910,366", + "imdbID": "tt0816692", + "Type": "movie", + "Response": "True" + }, + { + "Title": "The Dark Knight", + "Year": "2008", + "Rated": "PG-13", + "Released": "18 Jul 2008", + "Runtime": "152 min", + "Genre": "Action, Adventure, Crime", + "Director": "Christopher Nolan", + "Writer": "Jonathan Nolan (screenplay), Christopher Nolan (screenplay), Christopher Nolan (story), David S. Goyer (story), Bob Kane (characters)", + "Actors": "Christian Bale, Heath Ledger, Aaron Eckhart, Michael Caine", + "Plot": "When the menace known as the Joker wreaks havoc and chaos on the people of Gotham, the caped crusader must come to terms with one of the greatest psychological tests of his ability to fight injustice.", + "Language": "English, Mandarin", + "Country": "USA, UK", + "Awards": "Won 2 Oscars. Another 146 wins & 142 nominations.", + "Poster": "http://ia.media-imdb.com/images/M/MV5BMTMxNTMwODM0NF5BMl5BanBnXkFtZTcwODAyMTk2Mw@@._V1_SX300.jpg", + "Metascore": "82", + "imdbRating": "9.0", + "imdbVotes": "1,652,832", + "imdbID": "tt0468569", + "Type": "movie", + "Response": "True" + }, + { + "Title": "Batman Begins", + "Year": "2005", + "Rated": "PG-13", + "Released": "15 Jun 2005", + "Runtime": "140 min", + "Genre": "Action, Adventure", + "Director": "Christopher Nolan", + "Writer": "Bob Kane (characters), David S. Goyer (story), Christopher Nolan (screenplay), David S. Goyer (screenplay)", + "Actors": "Christian Bale, Michael Caine, Liam Neeson, Katie Holmes", + "Plot": "After training with his mentor, Batman begins his fight to free crime-ridden Gotham City from the corruption that Scarecrow and the League of Shadows have cast upon it.", + "Language": "English, Urdu, Mandarin", + "Country": "USA, UK", + "Awards": "Nominated for 1 Oscar. Another 15 wins & 66 nominations.", + "Poster": "http://ia.media-imdb.com/images/M/MV5BNTM3OTc0MzM2OV5BMl5BanBnXkFtZTYwNzUwMTI3._V1_SX300.jpg", + "Metascore": "70", + "imdbRating": "8.3", + "imdbVotes": "972,584", + "imdbID": "tt0372784", + "Type": "movie", + "Response": "True" + }, + { + "Title": "Avatar", + "Year": "2009", + "Rated": "PG-13", + "Released": "18 Dec 2009", + "Runtime": "162 min", + "Genre": "Action, Adventure, Fantasy", + "Director": "James Cameron", + "Writer": "James Cameron", + "Actors": "Sam Worthington, Zoe Saldana, Sigourney Weaver, Stephen Lang", + "Plot": "A paraplegic marine dispatched to the moon Pandora on a unique mission becomes torn between following his orders and protecting the world he feels is his home.", + "Language": "English, Spanish", + "Country": "USA, UK", + "Awards": "Won 3 Oscars. Another 80 wins & 121 nominations.", + "Poster": "http://ia.media-imdb.com/images/M/MV5BMTYwOTEwNjAzMl5BMl5BanBnXkFtZTcwODc5MTUwMw@@._V1_SX300.jpg", + "Metascore": "83", + "imdbRating": "7.9", + "imdbVotes": "876,575", + "imdbID": "tt0499549", + "Type": "movie", + "Response": "True" + } +]; + +// Add your code below this line + +var averageRating; + +// Add your code above this line + +console.log(averageRating); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/use-the-some-method-to-check-that-any-elements-in-an-array-meet-a-criteria.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/use-the-some-method-to-check-that-any-elements-in-an-array-meet-a-criteria.arabic.md new file mode 100644 index 0000000000..da1492f257 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/functional-programming/use-the-some-method-to-check-that-any-elements-in-an-array-meet-a-criteria.arabic.md @@ -0,0 +1,61 @@ +--- +id: 587d7dab367417b2b2512b6f +title: Use the some Method to Check that Any Elements in an Array Meet a Criteria +challengeType: 1 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(code.match(/\.some/g), "Your code should use the some method.");' + - text: '' + testString: 'assert(checkPositive([1, 2, 3, -4, 5]), "checkPositive([1, 2, 3, -4, 5]) should return true.");' + - text: '' + testString: 'assert(checkPositive([1, 2, 3, 4, 5]), "checkPositive([1, 2, 3, 4, 5]) should return true.");' + - text: '' + testString: 'assert(!checkPositive([-1, -2, -3, -4, -5]), "checkPositive([-1, -2, -3, -4, -5]) should return false.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function checkPositive(arr) { + // Add your code below this line + + + // Add your code above this line +} +checkPositive([1, 2, 3, -4, 5]); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/arguments-optional.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/arguments-optional.arabic.md new file mode 100644 index 0000000000..fcea3bf44c --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/arguments-optional.arabic.md @@ -0,0 +1,63 @@ +--- +id: a97fd23d9b809dac9921074f +title: Arguments Optional +isRequired: true +challengeType: 5 +guideUrl: 'https://arabic.freecodecamp.org/guide/certificates/arguments-optional' +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert.deepEqual(addTogether(2, 3), 5, "addTogether(2, 3) should return 5.");' + - text: '' + testString: 'assert.deepEqual(addTogether(2)(3), 5, "addTogether(2)(3) should return 5.");' + - text: '' + testString: 'assert.isUndefined(addTogether("http://bit.ly/IqT6zt"), "addTogether("http://bit.ly/IqT6zt") should return undefined.");' + - text: '' + testString: 'assert.isUndefined(addTogether(2, "3"), "addTogether(2, "3") should return undefined.");' + - text: '' + testString: 'assert.isUndefined(addTogether(2)([3]), "addTogether(2)([3]) should return undefined.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function addTogether() { + return false; +} + +addTogether(2,3); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/binary-agents.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/binary-agents.arabic.md new file mode 100644 index 0000000000..8cd78bda61 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/binary-agents.arabic.md @@ -0,0 +1,56 @@ +--- +id: a8d97bd4c764e91f9d2bda01 +title: Binary Agents +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert.deepEqual(binaryAgent("01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111"), "Aren"t bonfires fun!?", "binaryAgent("01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111") should return "Aren't bonfires fun!?"");' + - text: '' + testString: 'assert.deepEqual(binaryAgent("01001001 00100000 01101100 01101111 01110110 01100101 00100000 01000110 01110010 01100101 01100101 01000011 01101111 01100100 01100101 01000011 01100001 01101101 01110000 00100001"), "I love FreeCodeCamp!", "binaryAgent("01001001 00100000 01101100 01101111 01110110 01100101 00100000 01000110 01110010 01100101 01100101 01000011 01101111 01100100 01100101 01000011 01100001 01101101 01110000 00100001") should return "I love FreeCodeCamp!"");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function binaryAgent(str) { + return str; +} + +binaryAgent("01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111"); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/convert-html-entities.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/convert-html-entities.arabic.md new file mode 100644 index 0000000000..c36974151a --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/convert-html-entities.arabic.md @@ -0,0 +1,67 @@ +--- +id: a6b0bb188d873cb2c8729495 +title: Convert HTML Entities +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert.match(convertHTML("Dolce & Gabbana"), /Dolce & Gabbana/, "convertHTML("Dolce & Gabbana") should return Dolce &​amp; Gabbana.");' + - text: '' + testString: 'assert.match(convertHTML("Hamburgers < Pizza < Tacos"), /Hamburgers < Pizza < Tacos/, "convertHTML("Hamburgers < Pizza < Tacos") should return Hamburgers &​lt; Pizza &​lt; Tacos.");' + - text: '' + testString: 'assert.match(convertHTML("Sixty > twelve"), /Sixty > twelve/, "convertHTML("Sixty > twelve") should return Sixty &​gt; twelve.");' + - text: '' + testString: 'assert.match(convertHTML("Stuff in "quotation marks""), /Stuff in "quotation marks"/, "convertHTML('Stuff in "quotation marks"') should return Stuff in &​quot;quotation marks&​quot;.");' + - text: '' + testString: 'assert.match(convertHTML("Schindler"s List"), /Schindler's List/, "convertHTML("Schindler's List") should return Schindler&​apos;s List.");' + - text: '' + testString: 'assert.match(convertHTML("<>"), /<>/, "convertHTML("<>") should return &​lt;&​gt;.");' + - text: '' + testString: 'assert.strictEqual(convertHTML("abc"), "abc", "convertHTML("abc") should return abc.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function convertHTML(str) { + // :) + return str; +} + +convertHTML("Dolce & Gabbana"); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/diff-two-arrays.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/diff-two-arrays.arabic.md new file mode 100644 index 0000000000..2375f3a146 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/diff-two-arrays.arabic.md @@ -0,0 +1,84 @@ +--- +id: a5de63ebea8dbee56860f4f2 +title: Diff Two Arrays +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(typeof diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]) === "object", "diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]) should return an array.");' + - text: '' + testString: 'assert.sameMembers(diffArray(["diorite", "andesite", "grass", "dirt", "pink wool", "dead shrub"], ["diorite", "andesite", "grass", "dirt", "dead shrub"]), ["pink wool"], "["diorite", "andesite", "grass", "dirt", "pink wool", "dead shrub"], ["diorite", "andesite", "grass", "dirt", "dead shrub"] should return ["pink wool"].");' + - text: '' + testString: 'assert(diffArray(["diorite", "andesite", "grass", "dirt", "pink wool", "dead shrub"], ["diorite", "andesite", "grass", "dirt", "dead shrub"]).length === 1, "["diorite", "andesite", "grass", "dirt", "pink wool", "dead shrub"], ["diorite", "andesite", "grass", "dirt", "dead shrub"] should return an array with one item.");' + - text: '' + testString: 'assert.sameMembers(diffArray(["andesite", "grass", "dirt", "pink wool", "dead shrub"], ["diorite", "andesite", "grass", "dirt", "dead shrub"]), ["diorite", "pink wool"], "["andesite", "grass", "dirt", "pink wool", "dead shrub"], ["diorite", "andesite", "grass", "dirt", "dead shrub"] should return ["diorite", "pink wool"].");' + - text: '' + testString: 'assert(diffArray(["andesite", "grass", "dirt", "pink wool", "dead shrub"], ["diorite", "andesite", "grass", "dirt", "dead shrub"]).length === 2, "["andesite", "grass", "dirt", "pink wool", "dead shrub"], ["diorite", "andesite", "grass", "dirt", "dead shrub"] should return an array with two items.");' + - text: '' + testString: 'assert.sameMembers(diffArray(["andesite", "grass", "dirt", "dead shrub"], ["andesite", "grass", "dirt", "dead shrub"]), [], "["andesite", "grass", "dirt", "dead shrub"], ["andesite", "grass", "dirt", "dead shrub"] should return [].");' + - text: '' + testString: 'assert(diffArray(["andesite", "grass", "dirt", "dead shrub"], ["andesite", "grass", "dirt", "dead shrub"]).length === 0, "["andesite", "grass", "dirt", "dead shrub"], ["andesite", "grass", "dirt", "dead shrub"] should return an empty array.");' + - text: '' + testString: 'assert.sameMembers(diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]), [4], "[1, 2, 3, 5], [1, 2, 3, 4, 5] should return [4].");' + - text: '' + testString: 'assert(diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]).length === 1, "[1, 2, 3, 5], [1, 2, 3, 4, 5] should return an array with one item.");' + - text: '' + testString: 'assert.sameMembers(diffArray([1, "calf", 3, "piglet"], [1, "calf", 3, 4]), ["piglet", 4], "[1, "calf", 3, "piglet"], [1, "calf", 3, 4] should return ["piglet", 4].");' + - text: '' + testString: 'assert(diffArray([1, "calf", 3, "piglet"], [1, "calf", 3, 4]).length === 2, "[1, "calf", 3, "piglet"], [1, "calf", 3, 4] should return an array with two items.");' + - text: '' + testString: 'assert.sameMembers(diffArray([], ["snuffleupagus", "cookie monster", "elmo"]), ["snuffleupagus", "cookie monster", "elmo"], "[], ["snuffleupagus", "cookie monster", "elmo"] should return ["snuffleupagus", "cookie monster", "elmo"].");' + - text: 'يجب أن ترجع [], ["snuffleupagus", "cookie monster", "elmo"] صفيفًا يحتوي على ثلاثة عناصر.' + testString: 'assert(diffArray([], ["snuffleupagus", "cookie monster", "elmo"]).length === 3, "[], ["snuffleupagus", "cookie monster", "elmo"] should return an array with three items.");' + - text: '[1, "calf", 3, "piglet"], [7, "filly"] يجب أن تعود [1, "calf", 3, "piglet", 7, "filly"] .' + testString: 'assert.sameMembers(diffArray([1, "calf", 3, "piglet"], [7, "filly"]), [1, "calf", 3, "piglet", 7, "filly"], "[1, "calf", 3, "piglet"], [7, "filly"] should return [1, "calf", 3, "piglet", 7, "filly"].");' + - text: '[1, "calf", 3, "piglet"], [7, "filly"] يجب أن يعرض مصفوفة تحتوي على ستة عناصر.' + testString: 'assert(diffArray([1, "calf", 3, "piglet"], [7, "filly"]).length === 6, "[1, "calf", 3, "piglet"], [7, "filly"] should return an array with six items.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function diffArray(arr1, arr2) { + var newArr = []; + // Same, same; but different. + return newArr; +} + +diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/dna-pairing.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/dna-pairing.arabic.md new file mode 100644 index 0000000000..87755c478a --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/dna-pairing.arabic.md @@ -0,0 +1,59 @@ +--- +id: afd15382cdfb22c9efe8b7de +title: DNA Pairing +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: الحمض النووي الاقتران +--- + +## Description +
    يفتقد حبل الحمض النووي عنصر الإقران. تأخذ كل حرف ، والحصول على زوجها ، وإرجاع النتائج كصفيف 2D. أزواج القاعدة هي زوج من AT و CG. تطابق العنصر المفقود مع الحرف المتوفر. قم بإرجاع الحرف المتوفر كعنصر الأول في كل صفيف. على سبيل المثال ، بالنسبة إلى مدخل GCG ، أرجع [["" G "،" C "] ، [" C "،" G "] ، [" G "،" C "]] يتم إقران الحرف وزوجه في صفيف ، ويتم تجميع جميع المصفوفات في صفيف تغليف واحد. تذكر استخدام Read-Search-Ask إذا واجهتك مشكلة. حاول إقران البرنامج. اكتب الكود الخاص بك.
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: 'يجب أن يعيد pairElement("ATCGA") [["A","T"],["T","A"],["C","G"],["G","C"],["A","T"]] .' + testString: 'assert.deepEqual(pairElement("ATCGA"),[["A","T"],["T","A"],["C","G"],["G","C"],["A","T"]], "pairElement("ATCGA") should return [["A","T"],["T","A"],["C","G"],["G","C"],["A","T"]].");' + - text: 'يجب أن يعيد pairElement("TTGAG") [["T","A"],["T","A"],["G","C"],["A","T"],["G","C"]] .' + testString: 'assert.deepEqual(pairElement("TTGAG"),[["T","A"],["T","A"],["G","C"],["A","T"],["G","C"]], "pairElement("TTGAG") should return [["T","A"],["T","A"],["G","C"],["A","T"],["G","C"]].");' + - text: 'يجب أن تعيد pairElement("CTCTA") [["C","G"],["T","A"],["C","G"],["T","A"],["A","T"]] .' + testString: 'assert.deepEqual(pairElement("CTCTA"),[["C","G"],["T","A"],["C","G"],["T","A"],["A","T"]], "pairElement("CTCTA") should return [["C","G"],["T","A"],["C","G"],["T","A"],["A","T"]].");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function pairElement(str) { + return str; +} + +pairElement("GCG"); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/drop-it.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/drop-it.arabic.md new file mode 100644 index 0000000000..7a0dfad58d --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/drop-it.arabic.md @@ -0,0 +1,66 @@ +--- +id: a5deed1811a43193f9f1c841 +title: Drop it +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: أسقطها +--- + +## Description +
    بالنظر إلى صفيف arr ، قم بالتمرير عبر كل عنصر بدءًا من العنصر الأول (مؤشر 0) وإزالته إلى أن تعود الدالة func إلى true عند تمرير العنصر المتكرر عبرها. ثم أعد بقية المصفوفة بمجرد استيفاء الشرط ، وإلا ، يجب إرجاع arr كصفيف فارغ. تذكر استخدام Read-Search-Ask إذا واجهتك مشكلة. حاول إقران البرنامج. اكتب الكود الخاص بك.
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: 'dropElements([1, 2, 3, 4], function(n) {return n >= 3;}) return [3, 4] .' + testString: 'assert.deepEqual(dropElements([1, 2, 3, 4], function(n) {return n >= 3;}), [3, 4], "dropElements([1, 2, 3, 4], function(n) {return n >= 3;}) should return [3, 4].");' + - text: 'dropElements([0, 1, 0, 1], function(n) {return n === 1;}) بإرجاع [1, 0, 1] .' + testString: 'assert.deepEqual(dropElements([0, 1, 0, 1], function(n) {return n === 1;}), [1, 0, 1], "dropElements([0, 1, 0, 1], function(n) {return n === 1;}) should return [1, 0, 1].");' + - text: 'dropElements([1, 2, 3], function(n) {return n > 0;}) return [1, 2, 3] .' + testString: 'assert.deepEqual(dropElements([1, 2, 3], function(n) {return n > 0;}), [1, 2, 3], "dropElements([1, 2, 3], function(n) {return n > 0;}) should return [1, 2, 3].");' + - text: 'dropElements([1, 2, 3, 4], function(n) {return n > 5;}) return [] .' + testString: 'assert.deepEqual(dropElements([1, 2, 3, 4], function(n) {return n > 5;}), [], "dropElements([1, 2, 3, 4], function(n) {return n > 5;}) should return [].");' + - text: 'dropElements([1, 2, 3, 7, 4], function(n) {return n > 3;}) يجب أن تعود [7, 4] .' + testString: 'assert.deepEqual(dropElements([1, 2, 3, 7, 4], function(n) {return n > 3;}), [7, 4], "dropElements([1, 2, 3, 7, 4], function(n) {return n > 3;}) should return [7, 4].");' + - text: 'dropElements([1, 2, 3, 9, 2], function(n) {return n > 2;}) يجب أن تعود [3, 9, 2] .' + testString: 'assert.deepEqual(dropElements([1, 2, 3, 9, 2], function(n) {return n > 2;}), [3, 9, 2], "dropElements([1, 2, 3, 9, 2], function(n) {return n > 2;}) should return [3, 9, 2].");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function dropElements(arr, func) { + // Drop them elements. + return arr; +} + +dropElements([1, 2, 3], function(n) {return n < 3; }); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/everything-be-true.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/everything-be-true.arabic.md new file mode 100644 index 0000000000..f2c0e0f329 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/everything-be-true.arabic.md @@ -0,0 +1,72 @@ +--- +id: a10d2431ad0c6a099a4b8b52 +title: Everything Be True +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: كل شيء يكون حقيقة +--- + +## Description +
    تحقق مما إذا كان المسند (الوسيطة الثانية) صحيحًا في جميع عناصر المجموعة (الوسيطة الأولى). بمعنى آخر ، يتم منحك مجموعة من الكائنات. المسند pre ستكون خاصية الكائن وتحتاج للعودة true إذا قيمتها truthy . خلاف ذلك ، تعود false . في JavaScript ، القيم truthy هي القيم التي تترجم إلى true عند تقييمها في سياق Boolean. تذكر ، يمكنك الوصول إلى خصائص الكائن من خلال أي نقطة ترقيم أو [] تدوين. تذكر استخدام Read-Search-Ask إذا واجهتك مشكلة. حاول إقران البرنامج. اكتب الكود الخاص بك.
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: 'truthCheck([{"user": "Tinky-Winky", "sex": "male"}, {"user": "Dipsy", "sex": "male"}, {"user": "Laa-Laa", "sex": "female"}, {"user": "Po", "sex": "female"}], "sex") يجب أن تعود إلى true.' + testString: 'assert.strictEqual(truthCheck([{"user": "Tinky-Winky", "sex": "male"}, {"user": "Dipsy", "sex": "male"}, {"user": "Laa-Laa", "sex": "female"}, {"user": "Po", "sex": "female"}], "sex"), true, "truthCheck([{"user": "Tinky-Winky", "sex": "male"}, {"user": "Dipsy", "sex": "male"}, {"user": "Laa-Laa", "sex": "female"}, {"user": "Po", "sex": "female"}], "sex") should return true.");' + - text: 'truthCheck([{"user": "Tinky-Winky", "sex": "male"}, {"user": "Dipsy"}, {"user": "Laa-Laa", "sex": "female"}, {"user": "Po", "sex": "female"}], "sex") يجب أن تعرض خطأ.' + testString: 'assert.strictEqual(truthCheck([{"user": "Tinky-Winky", "sex": "male"}, {"user": "Dipsy"}, {"user": "Laa-Laa", "sex": "female"}, {"user": "Po", "sex": "female"}], "sex"), false, "truthCheck([{"user": "Tinky-Winky", "sex": "male"}, {"user": "Dipsy"}, {"user": "Laa-Laa", "sex": "female"}, {"user": "Po", "sex": "female"}], "sex") should return false.");' + - text: 'truthCheck([{"user": "Tinky-Winky", "sex": "male", "age": 0}, {"user": "Dipsy", "sex": "male", "age": 3}, {"user": "Laa-Laa", "sex": "female", "age": 5}, {"user": "Po", "sex": "female", "age": 4}], "age") يجب أن ترجع false.' + testString: 'assert.strictEqual(truthCheck([{"user": "Tinky-Winky", "sex": "male", "age": 2}, {"user": "Dipsy", "sex": "male", "age": 0}, {"user": "Laa-Laa", "sex": "female", "age": 5}, {"user": "Po", "sex": "female", "age": 4}], "age"), false, "truthCheck([{"user": "Tinky-Winky", "sex": "male", "age": 0}, {"user": "Dipsy", "sex": "male", "age": 3}, {"user": "Laa-Laa", "sex": "female", "age": 5}, {"user": "Po", "sex": "female", "age": 4}], "age") should return false.");' + - text: 'truthCheck([{"name": "Pete", "onBoat": true}, {"name": "Repeat", "onBoat": true}, {"name": "FastFoward", "onBoat": null}], "onBoat") يجب أن تعرض خطأ' + testString: 'assert.strictEqual(truthCheck([{"name": "Pete", "onBoat": true}, {"name": "Repeat", "onBoat": true}, {"name": "FastFoward", "onBoat": null}], "onBoat"), false, "truthCheck([{"name": "Pete", "onBoat": true}, {"name": "Repeat", "onBoat": true}, {"name": "FastFoward", "onBoat": null}], "onBoat") should return false");' + - text: '' + testString: 'assert.strictEqual(truthCheck([{"name": "Pete", "onBoat": true}, {"name": "Repeat", "onBoat": true, "alias": "Repete"}, {"name": "FastFoward", "onBoat": true}], "onBoat"), true, "truthCheck([{"name": "Pete", "onBoat": true}, {"name": "Repeat", "onBoat": true, "alias": "Repete"}, {"name": "FastFoward", "onBoat": true}], "onBoat") should return true");' + - text: '' + testString: 'assert.strictEqual(truthCheck([{"single": "yes"}], "single"), true, "truthCheck([{"single": "yes"}], "single") should return true");' + - text: '' + testString: 'assert.strictEqual(truthCheck([{"single": ""}, {"single": "double"}], "single"), false, "truthCheck([{"single": ""}, {"single": "double"}], "single") should return false");' + - text: '' + testString: 'assert.strictEqual(truthCheck([{"single": "double"}, {"single": undefined}], "single"), false, "truthCheck([{"single": "double"}, {"single": undefined}], "single") should return false");' + - text: '' + testString: 'assert.strictEqual(truthCheck([{"single": "double"}, {"single": NaN}], "single"), false, "truthCheck([{"single": "double"}, {"single": NaN}], "single") should return false");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function truthCheck(collection, pre) { + // Is everyone being true? + return pre; +} + +truthCheck([{"user": "Tinky-Winky", "sex": "male"}, {"user": "Dipsy", "sex": "male"}, {"user": "Laa-Laa", "sex": "female"}, {"user": "Po", "sex": "female"}], "sex"); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/make-a-person.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/make-a-person.arabic.md new file mode 100644 index 0000000000..281965fc08 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/make-a-person.arabic.md @@ -0,0 +1,81 @@ +--- +id: a2f1d72d9b908d0bd72bb9f6 +title: Make a Person +challengeType: 5 +videoUrl: '' +localeTitle: اصنع شخصا +--- + +## Description +undefined + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: يجب أن ترجع Object.keys(bob).length 6. + testString: 'assert.deepEqual(Object.keys(bob).length, 6, "Object.keys(bob).length should return 6.");' + - text: '' + testString: 'assert.deepEqual(bob instanceof Person, true, "bob instanceof Person should return true.");' + - text: يجب أن يقوم bob.firstName بإرجاع غير معرفة. + testString: 'assert.deepEqual(bob.firstName, undefined, "bob.firstName should return undefined.");' + - text: يجب أن يقوم bob.lastName بإرجاع undefined. + testString: 'assert.deepEqual(bob.lastName, undefined, "bob.lastName should return undefined.");' + - text: يجب أن يقوم bob.getFirstName() بإرجاع "Bob". + testString: 'assert.deepEqual(bob.getFirstName(), "Bob", "bob.getFirstName() should return "Bob".");' + - text: يجب أن يقوم bob.getLastName() بإرجاع "Ross". + testString: 'assert.deepEqual(bob.getLastName(), "Ross", "bob.getLastName() should return "Ross".");' + - text: يجب أن يقوم bob.getFullName() بإرجاع "Bob Ross". + testString: 'assert.deepEqual(bob.getFullName(), "Bob Ross", "bob.getFullName() should return "Bob Ross".");' + - text: يجب أن يقوم bob.getFullName() بإرجاع "Haskell Ross" بعد bob.setFirstName("Haskell") . + testString: 'assert.strictEqual((function () { bob.setFirstName("Haskell"); return bob.getFullName(); })(), "Haskell Ross", "bob.getFullName() should return "Haskell Ross" after bob.setFirstName("Haskell").");' + - text: يجب أن يقوم bob.getFullName() بإرجاع "Haskell Curry" بعد bob.setLastName("Curry") . + testString: 'assert.strictEqual((function () { var _bob=new Person("Haskell Ross"); _bob.setLastName("Curry"); return _bob.getFullName(); })(), "Haskell Curry", "bob.getFullName() should return "Haskell Curry" after bob.setLastName("Curry").");' + - text: يجب أن يقوم bob.getFullName() بإرجاع "Haskell Curry" بعد bob.setFullName("Haskell Curry") . + testString: 'assert.strictEqual((function () { bob.setFullName("Haskell Curry"); return bob.getFullName(); })(), "Haskell Curry", "bob.getFullName() should return "Haskell Curry" after bob.setFullName("Haskell Curry").");' + - text: يجب أن يقوم bob.getFirstName() بإرجاع "Haskell" بعد bob.setFullName("Haskell Curry") . + testString: 'assert.strictEqual((function () { bob.setFullName("Haskell Curry"); return bob.getFirstName(); })(), "Haskell", "bob.getFirstName() should return "Haskell" after bob.setFullName("Haskell Curry").");' + - text: '' + testString: 'assert.strictEqual((function () { bob.setFullName("Haskell Curry"); return bob.getLastName(); })(), "Curry", "bob.getLastName() should return "Curry" after bob.setFullName("Haskell Curry").");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +var Person = function(firstAndLast) { + // Complete the method below and implement the others similarly + this.getFullName = function() { + return ""; + }; + return firstAndLast; +}; + +var bob = new Person('Bob Ross'); +bob.getFullName(); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/map-the-debris.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/map-the-debris.arabic.md new file mode 100644 index 0000000000..31ba6bbe5e --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/map-the-debris.arabic.md @@ -0,0 +1,57 @@ +--- +id: af4afb223120f7348cdfc9fd +title: Map the Debris +challengeType: 5 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert.deepEqual(orbitalPeriod([{name : "sputnik", avgAlt : 35873.5553}]), [{name: "sputnik", orbitalPeriod: 86400}], "orbitalPeriod([{name : "sputnik", avgAlt : 35873.5553}]) should return [{name: "sputnik", orbitalPeriod: 86400}].");' + - text: '' + testString: 'assert.deepEqual(orbitalPeriod([{name: "iss", avgAlt: 413.6}, {name: "hubble", avgAlt: 556.7}, {name: "moon", avgAlt: 378632.553}]), [{name : "iss", orbitalPeriod: 5557}, {name: "hubble", orbitalPeriod: 5734}, {name: "moon", orbitalPeriod: 2377399}], "orbitalPeriod([{name: "iss", avgAlt: 413.6}, {name: "hubble", avgAlt: 556.7}, {name: "moon", avgAlt: 378632.553}]) should return [{name : "iss", orbitalPeriod: 5557}, {name: "hubble", orbitalPeriod: 5734}, {name: "moon", orbitalPeriod: 2377399}].");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function orbitalPeriod(arr) { + var GM = 398600.4418; + var earthRadius = 6367.4447; + return arr; +} + +orbitalPeriod([{name : "sputnik", avgAlt : 35873.5553}]); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/missing-letters.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/missing-letters.arabic.md new file mode 100644 index 0000000000..243b572bd8 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/missing-letters.arabic.md @@ -0,0 +1,62 @@ +--- +id: af7588ade1100bde429baf20 +title: Missing letters +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert.deepEqual(fearNotLetter("abce"), "d", "fearNotLetter("abce") should return "d".");' + - text: '' + testString: 'assert.deepEqual(fearNotLetter("abcdefghjklmno"), "i", "fearNotLetter("abcdefghjklmno") should return "i".");' + - text: '' + testString: 'assert.deepEqual(fearNotLetter("stvwx"), "u", "fearNotLetter("stvwx") should return "u".");' + - text: '' + testString: 'assert.deepEqual(fearNotLetter("bcdf"), "e", "fearNotLetter("bcdf") should return "e".");' + - text: '' + testString: 'assert.isUndefined(fearNotLetter("abcdefghijklmnopqrstuvwxyz"), "fearNotLetter("abcdefghijklmnopqrstuvwxyz") should return undefined.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function fearNotLetter(str) { + return str; +} + +fearNotLetter("abce"); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/pig-latin.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/pig-latin.arabic.md new file mode 100644 index 0000000000..6c58c15cb4 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/pig-latin.arabic.md @@ -0,0 +1,66 @@ +--- +id: aa7697ea2477d1316795783b +title: Pig Latin +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert.deepEqual(translatePigLatin("california"), "aliforniacay", "translatePigLatin("california") should return "aliforniacay".");' + - text: '' + testString: 'assert.deepEqual(translatePigLatin("paragraphs"), "aragraphspay", "translatePigLatin("paragraphs") should return "aragraphspay".");' + - text: '' + testString: 'assert.deepEqual(translatePigLatin("glove"), "oveglay", "translatePigLatin("glove") should return "oveglay".");' + - text: '' + testString: 'assert.deepEqual(translatePigLatin("algorithm"), "algorithmway", "translatePigLatin("algorithm") should return "algorithmway".");' + - text: '' + testString: 'assert.deepEqual(translatePigLatin("eight"), "eightway", "translatePigLatin("eight") should return "eightway".");' + - text: '' + testString: 'assert.deepEqual(translatePigLatin("schwartz"), "artzschway", "Should handle words where the first vowel comes in the end of the word.");' + - text: '' + testString: 'assert.deepEqual(translatePigLatin("rhythm"), "rhythmay", "Should handle words without vowels.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function translatePigLatin(str) { + return str; +} + +translatePigLatin("consonant"); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/search-and-replace.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/search-and-replace.arabic.md new file mode 100644 index 0000000000..d8f197d02f --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/search-and-replace.arabic.md @@ -0,0 +1,62 @@ +--- +id: a0b5010f579e69b815e7c5d6 +title: Search and Replace +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert.deepEqual(myReplace("Let us go to the store", "store", "mall"), "Let us go to the mall", "myReplace("Let us go to the store", "store", "mall") should return "Let us go to the mall".");' + - text: '' + testString: 'assert.deepEqual(myReplace("He is Sleeping on the couch", "Sleeping", "sitting"), "He is Sitting on the couch", "myReplace("He is Sleeping on the couch", "Sleeping", "sitting") should return "He is Sitting on the couch".");' + - text: '' + testString: 'assert.deepEqual(myReplace("This has a spellngi error", "spellngi", "spelling"), "This has a spelling error", "myReplace("This has a spellngi error", "spellngi", "spelling") should return "This has a spelling error".");' + - text: '' + testString: 'assert.deepEqual(myReplace("His name is Tom", "Tom", "john"), "His name is John", "myReplace("His name is Tom", "Tom", "john") should return "His name is John".");' + - text: '' + testString: 'assert.deepEqual(myReplace("Let us get back to more Coding", "Coding", "algorithms"), "Let us get back to more Algorithms", "myReplace("Let us get back to more Coding", "Coding", "algorithms") should return "Let us get back to more Algorithms".");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function myReplace(str, before, after) { + return str; +} + +myReplace("A quick brown fox jumped over the lazy dog", "jumped", "leaped"); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/seek-and-destroy.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/seek-and-destroy.arabic.md new file mode 100644 index 0000000000..de26b6bf5e --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/seek-and-destroy.arabic.md @@ -0,0 +1,65 @@ +--- +id: a39963a4c10bc8b4d4f06d7e +title: Seek and Destroy +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert.deepEqual(destroyer([1, 2, 3, 1, 2, 3], 2, 3), [1, 1], "destroyer([1, 2, 3, 1, 2, 3], 2, 3) should return [1, 1].");' + - text: '' + testString: 'assert.deepEqual(destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3), [1, 5, 1], "destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3) should return [1, 5, 1].");' + - text: '' + testString: 'assert.deepEqual(destroyer([3, 5, 1, 2, 2], 2, 3, 5), [1], "destroyer([3, 5, 1, 2, 2], 2, 3, 5) should return [1].");' + - text: '' + testString: 'assert.deepEqual(destroyer([2, 3, 2, 3], 2, 3), [], "destroyer([2, 3, 2, 3], 2, 3) should return [].");' + - text: '' + testString: 'assert.deepEqual(destroyer(["tree", "hamburger", 53], "tree", 53), ["hamburger"], "destroyer(["tree", "hamburger", 53], "tree", 53) should return ["hamburger"].");' + - text: '' + testString: 'assert.deepEqual(destroyer(["possum", "trollo", 12, "safari", "hotdog", 92, 65, "grandma", "bugati", "trojan", "yacht"], "yacht", "possum", "trollo", "safari", "hotdog", "grandma", "bugati", "trojan"), [12,92,65], "destroyer(["possum", "trollo", 12, "safari", "hotdog", 92, 65, "grandma", "bugati", "trojan", "yacht"], "yacht", "possum", "trollo", "safari", "hotdog", "grandma", "bugati", "trojan") should return [12,92,65].");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function destroyer(arr) { + // Remove all the values + return arr; +} + +destroyer([1, 2, 3, 1, 2, 3], 2, 3); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/smallest-common-multiple.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/smallest-common-multiple.arabic.md new file mode 100644 index 0000000000..7de0fdc98c --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/smallest-common-multiple.arabic.md @@ -0,0 +1,65 @@ +--- +id: ae9defd7acaf69703ab432ea +title: Smallest Common Multiple +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert.deepEqual(typeof smallestCommons([1, 5]), "number", "smallestCommons([1, 5]) should return a number.");' + - text: '' + testString: 'assert.deepEqual(smallestCommons([1, 5]), 60, "smallestCommons([1, 5]) should return 60.");' + - text: '' + testString: 'assert.deepEqual(smallestCommons([5, 1]), 60, "smallestCommons([5, 1]) should return 60.");' + - text: '' + testString: 'assert.deepEqual(smallestCommons([2, 10]), 2520, "smallestCommons([2, 10]) should return 2520.");' + - text: '' + testString: 'assert.deepEqual(smallestCommons([1, 13]), 360360, "smallestCommons([1, 13]) should return 360360.");' + - text: '' + testString: 'assert.deepEqual(smallestCommons([23, 18]), 6056820, "smallestCommons([23, 18]) should return 6056820.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function smallestCommons(arr) { + return arr; +} + + +smallestCommons([1,5]); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sorted-union.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sorted-union.arabic.md new file mode 100644 index 0000000000..7d35d9e589 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sorted-union.arabic.md @@ -0,0 +1,60 @@ +--- +id: a105e963526e7de52b219be9 +title: Sorted Union +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert.deepEqual(uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]), [1, 3, 2, 5, 4], "uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]) should return [1, 3, 2, 5, 4].");' + - text: '' + testString: 'assert.deepEqual(uniteUnique([1, 3, 2], [1, [5]], [2, [4]]), [1, 3, 2, [5], [4]], "uniteUnique([1, 3, 2], [1, [5]], [2, [4]]) should return [1, 3, 2, [5], [4]].");' + - text: '' + testString: 'assert.deepEqual(uniteUnique([1, 2, 3], [5, 2, 1]), [1, 2, 3, 5], "uniteUnique([1, 2, 3], [5, 2, 1]) should return [1, 2, 3, 5].");' + - text: '' + testString: 'assert.deepEqual(uniteUnique([1, 2, 3], [5, 2, 1, 4], [2, 1], [6, 7, 8]), [1, 2, 3, 5, 4, 6, 7, 8], "uniteUnique([1, 2, 3], [5, 2, 1, 4], [2, 1], [6, 7, 8]) should return [1, 2, 3, 5, 4, 6, 7, 8].");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function uniteUnique(arr) { + return arr; +} + +uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/spinal-tap-case.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/spinal-tap-case.arabic.md new file mode 100644 index 0000000000..ecaf77f733 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/spinal-tap-case.arabic.md @@ -0,0 +1,64 @@ +--- +id: a103376db3ba46b2d50db289 +title: Spinal Tap Case +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert.deepEqual(spinalCase("This Is Spinal Tap"), "this-is-spinal-tap", "spinalCase("This Is Spinal Tap") should return "this-is-spinal-tap".");' + - text: يجب أن تعود spinalCase("thisIsSpinal Tap") "this-is-spinal-tap" . + testString: 'assert.strictEqual(spinalCase("thisIsSpinalTap"), "this-is-spinal-tap", "spinalCase("thisIsSpinalTap") should return "this-is-spinal-tap".");' + - text: spinalCase("The_Andy_ Griffith_Show") بإرجاع "the-andy-griffith-show" . + testString: 'assert.strictEqual(spinalCase("The_Andy_Griffith_Show"), "the-andy-griffith-show", "spinalCase("The_Andy_Griffith_Show") should return "the-andy-griffith-show".");' + - text: spinalCase("Teletubbies say Eh-oh") "teletubbies-say-eh-oh" . + testString: 'assert.strictEqual(spinalCase("Teletubbies say Eh-oh"), "teletubbies-say-eh-oh", "spinalCase("Teletubbies say Eh-oh") should return "teletubbies-say-eh-oh".");' + - text: يجب أن تعود spinalCase("AllThe-small Things") "all-the-small-things" . + testString: 'assert.strictEqual(spinalCase("AllThe-small Things"), "all-the-small-things", "spinalCase("AllThe-small Things") should return "all-the-small-things".");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function spinalCase(str) { + // "It's such a fine line between stupid, and clever." + // --David St. Hubbins + return str; +} + +spinalCase('This Is Spinal Tap'); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/steamroller.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/steamroller.arabic.md new file mode 100644 index 0000000000..600fedc896 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/steamroller.arabic.md @@ -0,0 +1,62 @@ +--- +id: ab306dbdcc907c7ddfc30830 +title: Steamroller +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: أجاز +--- + +## Description +
    تسطيح مجموعة متداخلة. يجب عليك حساب مستويات مختلفة من التعشيش. تذكر استخدام Read-Search-Ask إذا واجهتك مشكلة. حاول إقران البرنامج. اكتب الكود الخاص بك.
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: 'steamrollArray([[["a"]], [["b"]]]) ["a", "b"] .' + testString: 'assert.deepEqual(steamrollArray([[["a"]], [["b"]]]), ["a", "b"], "steamrollArray([[["a"]], [["b"]]]) should return ["a", "b"].");' + - text: 'steamrollArray([1, [2], [3, [[4]]]]) يجب أن تعود [1, 2, 3, 4] .' + testString: 'assert.deepEqual(steamrollArray([1, [2], [3, [[4]]]]), [1, 2, 3, 4], "steamrollArray([1, [2], [3, [[4]]]]) should return [1, 2, 3, 4].");' + - text: 'steamrollArray([1, [], [3, [[4]]]]) يجب أن تعود [1, 3, 4] .' + testString: 'assert.deepEqual(steamrollArray([1, [], [3, [[4]]]]), [1, 3, 4], "steamrollArray([1, [], [3, [[4]]]]) should return [1, 3, 4].");' + - text: 'steamrollArray([1, {}, [3, [[4]]]]) [1, {}, 3, 4] .' + testString: 'assert.deepEqual(steamrollArray([1, {}, [3, [[4]]]]), [1, {}, 3, 4], "steamrollArray([1, {}, [3, [[4]]]]) should return [1, {}, 3, 4].");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function steamrollArray(arr) { + // I'm a steamroller, baby + return arr; +} + +steamrollArray([1, [2], [3, [[4]]]]); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sum-all-numbers-in-a-range.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sum-all-numbers-in-a-range.arabic.md new file mode 100644 index 0000000000..1642c79e54 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sum-all-numbers-in-a-range.arabic.md @@ -0,0 +1,62 @@ +--- +id: a3566b1109230028080c9345 +title: Sum All Numbers in a Range +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(typeof sumAll([1, 4]) === "number", "sumAll([1, 4]) should return a number.");' + - text: '' + testString: 'assert.deepEqual(sumAll([1, 4]), 10, "sumAll([1, 4]) should return 10.");' + - text: '' + testString: 'assert.deepEqual(sumAll([4, 1]), 10, "sumAll([4, 1]) should return 10.");' + - text: '' + testString: 'assert.deepEqual(sumAll([5, 10]), 45, "sumAll([5, 10]) should return 45.");' + - text: '' + testString: 'assert.deepEqual(sumAll([10, 5]), 45, "sumAll([10, 5]) should return 45.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function sumAll(arr) { + return 1; +} + +sumAll([1, 4]); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sum-all-odd-fibonacci-numbers.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sum-all-odd-fibonacci-numbers.arabic.md new file mode 100644 index 0000000000..14107fa9b9 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sum-all-odd-fibonacci-numbers.arabic.md @@ -0,0 +1,64 @@ +--- +id: a5229172f011153519423690 +title: Sum All Odd Fibonacci Numbers +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(typeof sumFibs(1) === "number", "sumFibs(1) should return a number.");' + - text: '' + testString: 'assert(sumFibs(1000) === 1785, "sumFibs(1000) should return 1785.");' + - text: '' + testString: 'assert(sumFibs(4000000) === 4613732, "sumFibs(4000000) should return 4613732.");' + - text: '' + testString: 'assert(sumFibs(4) === 5, "sumFibs(4) should return 5.");' + - text: '' + testString: 'assert(sumFibs(75024) === 60696, "sumFibs(75024) should return 60696.");' + - text: '' + testString: 'assert(sumFibs(75025) === 135721, "sumFibs(75025) should return 135721.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function sumFibs(num) { + return num; +} + +sumFibs(4); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sum-all-primes.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sum-all-primes.arabic.md new file mode 100644 index 0000000000..2517a2a63f --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sum-all-primes.arabic.md @@ -0,0 +1,59 @@ +--- +id: a3bfc1673c0526e06d3ac698 +title: Sum All Primes +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: مجموع كل الأعداد +--- + +## Description +
    اجمع جميع الأعداد الأولية حتى وتضم الرقم المقدم. يتم تعريف رقم أولي على أنه رقم أكبر من واحد ويكون له مقسومان فقط ، واحد و نفسه. على سبيل المثال ، الرقم 2 هو رقم أولي لأنه قابل للقسمة على واحد فقط والثاني. قد لا يكون الرقم المقدم رئيسًا. تذكر استخدام Read-Search-Ask إذا واجهتك مشكلة. حاول إقران البرنامج. اكتب الكود الخاص بك.
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يقوم sumPrimes(10) بإرجاع رقم. + testString: 'assert.deepEqual(typeof sumPrimes(10), "number", "sumPrimes(10) should return a number.");' + - text: sumPrimes(10) يجب أن ترجع 17. + testString: 'assert.deepEqual(sumPrimes(10), 17, "sumPrimes(10) should return 17.");' + - text: sumPrimes(977) يجب إرجاع 73156. + testString: 'assert.deepEqual(sumPrimes(977), 73156, "sumPrimes(977) should return 73156.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function sumPrimes(num) { + return num; +} + +sumPrimes(10); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/wherefore-art-thou.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/wherefore-art-thou.arabic.md new file mode 100644 index 0000000000..534277223e --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/wherefore-art-thou.arabic.md @@ -0,0 +1,71 @@ +--- +id: a8e512fbe388ac2f9198f0fa +title: Wherefore art thou +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: ولهذا السبب انت الفن +--- + +## Description +
    قم بعمل وظيفة تبحث من خلال مجموعة من الكائنات (الوسيطة الأولى) وتقوم بإرجاع مصفوفة بكافة الكائنات التي لها أزواج قيم وأسماء متطابقة (وسيطة ثانية). يجب أن يكون كل اسم وقيمة زوج كائن المصدر موجودًا في الكائن من المجموعة إذا كان سيتم تضمينه في الصفيف الذي تم إرجاعه. على سبيل المثال ، إذا كانت الوسيطة الأولى هي [{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }] ، والوسيطة الثانية هي { last: "Capulet" } ، ثم يجب عليك إرجاع الكائن الثالث من الصفيف (الوسيطة الأولى) ، لأنه يحتوي على الاسم والقيمة الخاصة به ، التي تم تمريرها على أنها الوسيطة الثانية. تذكر استخدام Read-Search-Ask إذا واجهتك مشكلة. اكتب الكود الخاص بك.
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: 'whatIsInAName([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" }) يجب أن تعود [{ first: "Tybalt", last: "Capulet" }] .' + testString: 'assert.deepEqual(whatIsInAName([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" }), [{ first: "Tybalt", last: "Capulet" }], "whatIsInAName([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" }) should return [{ first: "Tybalt", last: "Capulet" }].");' + - text: 'whatIsInAName([{ "apple": 1 }, { "apple": 1 }, { "apple": 1, "bat": 2 }], { "apple": 1 }) يجب أن يعرض [{ "apple": 1 }, { "apple": 1 }, { "apple": 1, "bat": 2 }] .' + testString: 'assert.deepEqual(whatIsInAName([{ "apple": 1 }, { "apple": 1 }, { "apple": 1, "bat": 2 }], { "apple": 1 }), [{ "apple": 1 }, { "apple": 1 }, { "apple": 1, "bat": 2 }], "whatIsInAName([{ "apple": 1 }, { "apple": 1 }, { "apple": 1, "bat": 2 }], { "apple": 1 }) should return [{ "apple": 1 }, { "apple": 1 }, { "apple": 1, "bat": 2 }].");' + - text: 'whatIsInAName([{ "apple": 1, "bat": 2 }, { "bat": 2 }, { "apple": 1, "bat": 2, "cookie": 2 }], { "apple": 1, "bat": 2 }) يجب عرض [{ "apple": 1, "bat": 2 }, { "apple": 1, "bat": 2, "cookie": 2 }] .' + testString: 'assert.deepEqual(whatIsInAName([{ "apple": 1, "bat": 2 }, { "bat": 2 }, { "apple": 1, "bat": 2, "cookie": 2 }], { "apple": 1, "bat": 2 }), [{ "apple": 1, "bat": 2 }, { "apple": 1, "bat": 2, "cookie": 2 }], "whatIsInAName([{ "apple": 1, "bat": 2 }, { "bat": 2 }, { "apple": 1, "bat": 2, "cookie": 2 }], { "apple": 1, "bat": 2 }) should return [{ "apple": 1, "bat": 2 }, { "apple": 1, "bat": 2, "cookie": 2 }].");' + - text: 'whatIsInAName([{ "apple": 1, "bat": 2 }, { "apple": 1 }, { "apple": 1, "bat": 2, "cookie": 2 }], { "apple": 1, "cookie": 2 }) يجب عرض [{ "apple": 1, "bat": 2, "cookie": 2 }] .' + testString: 'assert.deepEqual(whatIsInAName([{ "apple": 1, "bat": 2 }, { "apple": 1 }, { "apple": 1, "bat": 2, "cookie": 2 }], { "apple": 1, "cookie": 2 }), [{ "apple": 1, "bat": 2, "cookie": 2 }], "whatIsInAName([{ "apple": 1, "bat": 2 }, { "apple": 1 }, { "apple": 1, "bat": 2, "cookie": 2 }], { "apple": 1, "cookie": 2 }) should return [{ "apple": 1, "bat": 2, "cookie": 2 }].");' + - text: 'whatIsInAName([{ "apple": 1, "bat": 2 }, { "apple": 1 }, { "apple": 1, "bat": 2, "cookie": 2 }, { "bat":2 }], { "apple": 1, "bat": 2 }) [{ "apple": 1, "bat": 2 }, { "apple": 1, "bat": 2, "cookie":2 }] .' + testString: 'assert.deepEqual(whatIsInAName([{ "apple": 1, "bat": 2 }, { "apple": 1 }, { "apple": 1, "bat": 2, "cookie": 2 }, {"bat":2}], { "apple": 1, "bat": 2 }), [{ "apple": 1, "bat": 2 }, { "apple": 1, "bat": 2, "cookie":2 }], "whatIsInAName([{ "apple": 1, "bat": 2 }, { "apple": 1 }, { "apple": 1, "bat": 2, "cookie": 2 }, { "bat":2 }], { "apple": 1, "bat": 2 }) should return [{ "apple": 1, "bat": 2 }, { "apple": 1, "bat": 2, "cookie":2 }].");' + - text: '' + testString: 'assert.deepEqual(whatIsInAName([{ "a": 1, "b": 2, "c": 3 }], { "a": 1, "b": 9999, "c": 3 }), [], "whatIsInAName([{"a": 1, "b": 2, "c": 3}], {"a": 1, "b": 9999, "c": 3}) should return []");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function whatIsInAName(collection, source) { + // What's in a name? + var arr = []; + // Only change code below this line + + + // Only change code above this line + return arr; +} + +whatIsInAName([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" }); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/caesars-cipher.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/caesars-cipher.arabic.md new file mode 100644 index 0000000000..737e750ced --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/caesars-cipher.arabic.md @@ -0,0 +1,62 @@ +--- +id: 56533eb9ac21ba0edf2244e2 +title: Caesars Cipher +challengeType: 5 +isRequired: true +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(rot13("SERR PBQR PNZC") === "FREE CODE CAMP", "rot13("SERR PBQR PNZC") should decode to FREE CODE CAMP");' + - text: '' + testString: 'assert(rot13("SERR CVMMN!") === "FREE PIZZA!", "rot13("SERR CVMMN!") should decode to FREE PIZZA!");' + - text: '' + testString: 'assert(rot13("SERR YBIR?") === "FREE LOVE?", "rot13("SERR YBIR?") should decode to FREE LOVE?");' + - text: '' + testString: 'assert(rot13("GUR DHVPX OEBJA SBK WHZCF BIRE GUR YNML QBT.") === "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.", "rot13("GUR DHVPX OEBJA SBK WHZCF BIRE GUR YNML QBT.") should decode to THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function rot13(str) { // LBH QVQ VG! + + return str; +} + +// Change the inputs below to test +rot13("SERR PBQR PNZC"); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/cash-register.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/cash-register.arabic.md new file mode 100644 index 0000000000..13a39591bc --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/cash-register.arabic.md @@ -0,0 +1,77 @@ +--- +id: aa2e6f85cab2ab736c9a9b24 +title: Cash Register +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert.deepEqual(Object.prototype.toString.call(checkCashRegister(19.5, 20, [["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.1], ["QUARTER", 4.25], ["ONE", 90], ["FIVE", 55], ["TEN", 20], ["TWENTY", 60], ["ONE HUNDRED", 100]])), "[object Object]", "checkCashRegister(19.5, 20, [["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.1], ["QUARTER", 4.25], ["ONE", 90], ["FIVE", 55], ["TEN", 20], ["TWENTY", 60], ["ONE HUNDRED", 100]]) should return an object.");' + - text: '' + testString: 'assert.deepEqual(checkCashRegister(19.5, 20, [["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.1], ["QUARTER", 4.25], ["ONE", 90], ["FIVE", 55], ["TEN", 20], ["TWENTY", 60], ["ONE HUNDRED", 100]]), {status: "OPEN", change: [["QUARTER", 0.5]]}, "checkCashRegister(19.5, 20, [["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.1], ["QUARTER", 4.25], ["ONE", 90], ["FIVE", 55], ["TEN", 20], ["TWENTY", 60], ["ONE HUNDRED", 100]]) should return {status: "OPEN", change: [["QUARTER", 0.5]]}.");' + - text: '' + testString: 'assert.deepEqual(checkCashRegister(3.26, 100, [["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.1], ["QUARTER", 4.25], ["ONE", 90], ["FIVE", 55], ["TEN", 20], ["TWENTY", 60], ["ONE HUNDRED", 100]]), {status: "OPEN", change: [["TWENTY", 60], ["TEN", 20], ["FIVE", 15], ["ONE", 1], ["QUARTER", 0.5], ["DIME", 0.2], ["PENNY", 0.04]]}, "checkCashRegister(3.26, 100, [["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.1], ["QUARTER", 4.25], ["ONE", 90], ["FIVE", 55], ["TEN", 20], ["TWENTY", 60], ["ONE HUNDRED", 100]]) should return {status: "OPEN", change: [["TWENTY", 60], ["TEN", 20], ["FIVE", 15], ["ONE", 1], ["QUARTER", 0.5], ["DIME", 0.2], ["PENNY", 0.04]]}.");' + - text: '' + testString: 'assert.deepEqual(checkCashRegister(19.5, 20, [["PENNY", 0.01], ["NICKEL", 0], ["DIME", 0], ["QUARTER", 0], ["ONE", 0], ["FIVE", 0], ["TEN", 0], ["TWENTY", 0], ["ONE HUNDRED", 0]]), {status: "INSUFFICIENT_FUNDS", change: []}, "checkCashRegister(19.5, 20, [["PENNY", 0.01], ["NICKEL", 0], ["DIME", 0], ["QUARTER", 0], ["ONE", 0], ["FIVE", 0], ["TEN", 0], ["TWENTY", 0], ["ONE HUNDRED", 0]]) should return {status: "INSUFFICIENT_FUNDS", change: []}.");' + - text: 'checkCashRegister(19.5, 20, [["PENNY", 0.01], ["NICKEL", 0], ["DIME", 0], ["QUARTER", 0], ["ONE", 1], ["FIVE", 0], ["TEN", 0], ["TWENTY", 0], ["ONE HUNDRED", 0]]) يجب أن ترجع {status: "INSUFFICIENT_FUNDS", change: []} .' + testString: 'assert.deepEqual(checkCashRegister(19.5, 20, [["PENNY", 0.01], ["NICKEL", 0], ["DIME", 0], ["QUARTER", 0], ["ONE", 1], ["FIVE", 0], ["TEN", 0], ["TWENTY", 0], ["ONE HUNDRED", 0]]), {status: "INSUFFICIENT_FUNDS", change: []}, "checkCashRegister(19.5, 20, [["PENNY", 0.01], ["NICKEL", 0], ["DIME", 0], ["QUARTER", 0], ["ONE", 1], ["FIVE", 0], ["TEN", 0], ["TWENTY", 0], ["ONE HUNDRED", 0]]) should return {status: "INSUFFICIENT_FUNDS", change: []}.");' + - text: '' + testString: 'assert.deepEqual(checkCashRegister(19.5, 20, [["PENNY", 0.5], ["NICKEL", 0], ["DIME", 0], ["QUARTER", 0], ["ONE", 0], ["FIVE", 0], ["TEN", 0], ["TWENTY", 0], ["ONE HUNDRED", 0]]), {status: "CLOSED", change: [["PENNY", 0.5], ["NICKEL", 0], ["DIME", 0], ["QUARTER", 0], ["ONE", 0], ["FIVE", 0], ["TEN", 0], ["TWENTY", 0], ["ONE HUNDRED", 0]]}, "checkCashRegister(19.5, 20, [["PENNY", 0.5], ["NICKEL", 0], ["DIME", 0], ["QUARTER", 0], ["ONE", 0], ["FIVE", 0], ["TEN", 0], ["TWENTY", 0], ["ONE HUNDRED", 0]]) should return {status: "CLOSED", change: [["PENNY", 0.5], ["NICKEL", 0], ["DIME", 0], ["QUARTER", 0], ["ONE", 0], ["FIVE", 0], ["TEN", 0], ["TWENTY", 0], ["ONE HUNDRED", 0]]}.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function checkCashRegister(price, cash, cid) { + var change; + // Here is your change, ma'am. + return change; +} + +// Example cash-in-drawer array: +// [["PENNY", 1.01], +// ["NICKEL", 2.05], +// ["DIME", 3.1], +// ["QUARTER", 4.25], +// ["ONE", 90], +// ["FIVE", 55], +// ["TEN", 20], +// ["TWENTY", 60], +// ["ONE HUNDRED", 100]] + +checkCashRegister(19.5, 20, [["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.1], ["QUARTER", 4.25], ["ONE", 90], ["FIVE", 55], ["TEN", 20], ["TWENTY", 60], ["ONE HUNDRED", 100]]); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/palindrome-checker.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/palindrome-checker.arabic.md new file mode 100644 index 0000000000..121e6b881d --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/palindrome-checker.arabic.md @@ -0,0 +1,82 @@ +--- +id: aaa48de84e1ecc7c742e1124 +title: Palindrome Checker +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: '' +--- + +## Description +
    قم بإرجاع true إذا كانت السلسلة المحددة متناظرة. خلاف ذلك ، تعود false . النص المتناظر هو كلمة أو جملة مكتوبة بنفس الطريقة إلى الأمام والخلف ، وتتجاهل علامات الترقيم والحالة والتباعد. ملحوظة
    ستحتاج إلى إزالة جميع الأحرف غير الأبجدية الرقمية (علامات الترقيم والمسافات والرموز) وتحويل كل شيء إلى الحالة نفسها (الحالة السفلية أو العلوية) من أجل التحقق من التباين. سنقوم بتمرير سلاسل بأشكال مختلفة ، مثل "racecar" و "RaceCar" و "race CAR" وغيرها. سنقوم أيضًا بتمرير سلاسل مع رموز خاصة ، مثل "2A3*3a2" و "2A3 3a2" و "2_A3*3#A2" . تذكر استخدام Read-Search-Ask إذا واجهتك مشكلة. اكتب الكود الخاص بك.
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يعيد palindrome("eye") قيمة منطقية. + testString: 'assert(typeof palindrome("eye") === "boolean", "palindrome("eye") should return a boolean.");' + - text: palindrome("eye") يجب أن تعود حقيقية. + testString: 'assert(palindrome("eye") === true, "palindrome("eye") should return true.");' + - text: palindrome("_eye") يجب أن ترجع true. + testString: 'assert(palindrome("_eye") === true, "palindrome("_eye") should return true.");' + - text: palindrome("race car") يجب أن تعود حقيقية. + testString: 'assert(palindrome("race car") === true, "palindrome("race car") should return true.");' + - text: palindrome("not a palindrome") يجب أن يقوم بإرجاع false. + testString: 'assert(palindrome("not a palindrome") === false, "palindrome("not a palindrome") should return false.");' + - text: 'palindrome("A man, a plan, a canal. Panama") يجب أن تعود حقيقية.' + testString: 'assert(palindrome("A man, a plan, a canal. Panama") === true, "palindrome("A man, a plan, a canal. Panama") should return true.");' + - text: palindrome("never odd or even") يجب أن يُرجع صحيحًا. + testString: 'assert(palindrome("never odd or even") === true, "palindrome("never odd or even") should return true.");' + - text: يجب أن ترجع palindrome("nope") false. + testString: 'assert(palindrome("nope") === false, "palindrome("nope") should return false.");' + - text: palindrome("almostomla") يجب أن يقوم بإرجاع false. + testString: 'assert(palindrome("almostomla") === false, "palindrome("almostomla") should return false.");' + - text: 'palindrome("My age is 0, 0 si ega ym.") يجب أن palindrome("My age is 0, 0 si ega ym.") true.' + testString: 'assert(palindrome("My age is 0, 0 si ega ym.") === true, "palindrome("My age is 0, 0 si ega ym.") should return true.");' + - text: palindrome("1 eye for of 1 eye.") يجب أن تعود خاطئة. + testString: 'assert(palindrome("1 eye for of 1 eye.") === false, "palindrome("1 eye for of 1 eye.") should return false.");' + - text: 'palindrome("0_0 (: /-\ :) 0-0") يجب أن ترجع true.' + testString: 'assert(palindrome("0_0 (: /-\ :) 0-0") === true, "palindrome("0_0 (: /-\ :) 0-0") should return true.");' + - text: palindrome("five|\_/|four") يجب أن يقوم بإرجاع false. + testString: 'assert(palindrome("five|\_/|four") === false, "palindrome("five|\_/|four") should return false.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function palindrome(str) { + // Good luck! + return true; +} + + + +palindrome("eye"); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/roman-numeral-converter.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/roman-numeral-converter.arabic.md new file mode 100644 index 0000000000..d8c29426d2 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/roman-numeral-converter.arabic.md @@ -0,0 +1,105 @@ +--- +id: a7f4d8f2483413a6ce226cac +title: Roman Numeral Converter +isRequired: true +challengeType: 5 +videoUrl: '' +localeTitle: تحويل الأرقام الرومانية +--- + +## Description +
    تحويل الرقم المحدد إلى رقم روماني. يجب تقديم جميع إجابات الأرقام الرومانية في الحالة العليا. تذكر استخدام Read-Search-Ask إذا واجهتك مشكلة. حاول إقران البرنامج. اكتب الكود الخاص بك.
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: convertToRoman(2) يجب أن ترجع "II". + testString: 'assert.deepEqual(convertToRoman(2), "II", "convertToRoman(2) should return "II".");' + - text: '' + testString: 'assert.deepEqual(convertToRoman(3), "III", "convertToRoman(3) should return "III".");' + - text: convertToRoman(4) يجب أن ترجع "IV". + testString: 'assert.deepEqual(convertToRoman(4), "IV", "convertToRoman(4) should return "IV".");' + - text: convertToRoman(5) يجب أن ترجع "V". + testString: 'assert.deepEqual(convertToRoman(5), "V", "convertToRoman(5) should return "V".");' + - text: convertToRoman(9) يجب أن ترجع "IX". + testString: 'assert.deepEqual(convertToRoman(9), "IX", "convertToRoman(9) should return "IX".");' + - text: convertToRoman(12) يجب أن ترجع "XII". + testString: 'assert.deepEqual(convertToRoman(12), "XII", "convertToRoman(12) should return "XII".");' + - text: convertToRoman(16) يجب أن ترجع "XVI". + testString: 'assert.deepEqual(convertToRoman(16), "XVI", "convertToRoman(16) should return "XVI".");' + - text: '' + testString: 'assert.deepEqual(convertToRoman(29), "XXIX", "convertToRoman(29) should return "XXIX".");' + - text: '' + testString: 'assert.deepEqual(convertToRoman(44), "XLIV", "convertToRoman(44) should return "XLIV".");' + - text: '' + testString: 'assert.deepEqual(convertToRoman(45), "XLV", "convertToRoman(45) should return "XLV"");' + - text: '' + testString: 'assert.deepEqual(convertToRoman(68), "LXVIII", "convertToRoman(68) should return "LXVIII"");' + - text: '' + testString: 'assert.deepEqual(convertToRoman(83), "LXXXIII", "convertToRoman(83) should return "LXXXIII"");' + - text: '' + testString: 'assert.deepEqual(convertToRoman(97), "XCVII", "convertToRoman(97) should return "XCVII"");' + - text: '' + testString: 'assert.deepEqual(convertToRoman(99), "XCIX", "convertToRoman(99) should return "XCIX"");' + - text: convertToRoman(400) يجب أن ترجع "CD" + testString: 'assert.deepEqual(convertToRoman(400), "CD", "convertToRoman(400) should return "CD"");' + - text: '' + testString: 'assert.deepEqual(convertToRoman(500), "D", "convertToRoman(500) should return "D"");' + - text: convertToRoman(501) يجب أن ترجع "DI" + testString: 'assert.deepEqual(convertToRoman(501), "DI", "convertToRoman(501) should return "DI"");' + - text: '' + testString: 'assert.deepEqual(convertToRoman(649), "DCXLIX", "convertToRoman(649) should return "DCXLIX"");' + - text: '' + testString: 'assert.deepEqual(convertToRoman(798), "DCCXCVIII", "convertToRoman(798) should return "DCCXCVIII"");' + - text: '' + testString: 'assert.deepEqual(convertToRoman(891), "DCCCXCI", "convertToRoman(891) should return "DCCCXCI"");' + - text: '' + testString: 'assert.deepEqual(convertToRoman(1000), "M", "convertToRoman(1000) should return "M"");' + - text: '' + testString: 'assert.deepEqual(convertToRoman(1004), "MIV", "convertToRoman(1004) should return "MIV"");' + - text: '' + testString: 'assert.deepEqual(convertToRoman(1006), "MVI", "convertToRoman(1006) should return "MVI"");' + - text: '' + testString: 'assert.deepEqual(convertToRoman(1023), "MXXIII", "convertToRoman(1023) should return "MXXIII"");' + - text: '' + testString: 'assert.deepEqual(convertToRoman(2014), "MMXIV", "convertToRoman(2014) should return "MMXIV"");' + - text: '' + testString: 'assert.deepEqual(convertToRoman(3999), "MMMCMXCIX", "convertToRoman(3999) should return "MMMCMXCIX"");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function convertToRoman(num) { + return num; +} + +convertToRoman(36); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/telephone-number-validator.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/telephone-number-validator.arabic.md new file mode 100644 index 0000000000..2c63ecc9e3 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/telephone-number-validator.arabic.md @@ -0,0 +1,107 @@ +--- +id: aff0395860f5d3034dc0bfc9 +title: Telephone Number Validator +challengeType: 5 +isRequired: true +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(typeof telephoneCheck("555-555-5555") === "boolean", "telephoneCheck("555-555-5555") should return a boolean.");' + - text: '' + testString: 'assert(telephoneCheck("1 555-555-5555") === true, "telephoneCheck("1 555-555-5555") should return true.");' + - text: '' + testString: 'assert(telephoneCheck("1 (555) 555-5555") === true, "telephoneCheck("1 (555) 555-5555") should return true.");' + - text: '' + testString: 'assert(telephoneCheck("5555555555") === true, "telephoneCheck("5555555555") should return true.");' + - text: '' + testString: 'assert(telephoneCheck("555-555-5555") === true, "telephoneCheck("555-555-5555") should return true.");' + - text: '' + testString: 'assert(telephoneCheck("(555)555-5555") === true, "telephoneCheck("(555)555-5555") should return true.");' + - text: '' + testString: 'assert(telephoneCheck("1(555)555-5555") === true, "telephoneCheck("1(555)555-5555") should return true.");' + - text: '' + testString: 'assert(telephoneCheck("555-5555") === false, "telephoneCheck("555-5555") should return false.");' + - text: '' + testString: 'assert(telephoneCheck("5555555") === false, "telephoneCheck("5555555") should return false.");' + - text: '' + testString: 'assert(telephoneCheck("1 555)555-5555") === false, "telephoneCheck("1 555)555-5555") should return false.");' + - text: '' + testString: 'assert(telephoneCheck("1 555 555 5555") === true, "telephoneCheck("1 555 555 5555") should return true.");' + - text: '' + testString: 'assert(telephoneCheck("1 456 789 4444") === true, "telephoneCheck("1 456 789 4444") should return true.");' + - text: '' + testString: 'assert(telephoneCheck("123**&!!asdf#") === false, "telephoneCheck("123**&!!asdf#") should return false.");' + - text: '' + testString: 'assert(telephoneCheck("55555555") === false, "telephoneCheck("55555555") should return false.");' + - text: '' + testString: 'assert(telephoneCheck("(6054756961)") === false, "telephoneCheck("(6054756961)") should return false");' + - text: '' + testString: 'assert(telephoneCheck("2 (757) 622-7382") === false, "telephoneCheck("2 (757) 622-7382") should return false.");' + - text: '' + testString: 'assert(telephoneCheck("0 (757) 622-7382") === false, "telephoneCheck("0 (757) 622-7382") should return false.");' + - text: '' + testString: 'assert(telephoneCheck("-1 (757) 622-7382") === false, "telephoneCheck("-1 (757) 622-7382") should return false");' + - text: '' + testString: 'assert(telephoneCheck("2 757 622-7382") === false, "telephoneCheck("2 757 622-7382") should return false.");' + - text: '' + testString: 'assert(telephoneCheck("10 (757) 622-7382") === false, "telephoneCheck("10 (757) 622-7382") should return false.");' + - text: '' + testString: 'assert(telephoneCheck("27576227382") === false, "telephoneCheck("27576227382") should return false.");' + - text: telephoneCheck("(275)76227382") يجب أن ترجع كاذبة. + testString: 'assert(telephoneCheck("(275)76227382") === false, "telephoneCheck("(275)76227382") should return false.");' + - text: telephoneCheck("2(757)6227382") يجب أن ترجع false. + testString: 'assert(telephoneCheck("2(757)6227382") === false, "telephoneCheck("2(757)6227382") should return false.");' + - text: telephoneCheck("2(757)622-7382") يجب أن ترجع false. + testString: 'assert(telephoneCheck("2(757)622-7382") === false, "telephoneCheck("2(757)622-7382") should return false.");' + - text: telephoneCheck("555)-555-5555") يجب أن ترجع false. + testString: 'assert(telephoneCheck("555)-555-5555") === false, "telephoneCheck("555)-555-5555") should return false.");' + - text: telephoneCheck("(555-555-5555") يجب أن telephoneCheck("(555-555-5555") خطأ. + testString: 'assert(telephoneCheck("(555-555-5555") === false, "telephoneCheck("(555-555-5555") should return false.");' + - text: telephoneCheck("(555)5(55?)-5555") يجب أن ترجع false. + testString: 'assert(telephoneCheck("(555)5(55?)-5555") === false, "telephoneCheck("(555)5(55?)-5555") should return false.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function telephoneCheck(str) { + // Good luck! + return true; +} + +telephoneCheck("555-555-5555"); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/add-methods-after-inheritance.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/add-methods-after-inheritance.arabic.md new file mode 100644 index 0000000000..a364c25a5d --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/add-methods-after-inheritance.arabic.md @@ -0,0 +1,72 @@ +--- +id: 587d7db1367417b2b2512b87 +title: Add Methods After Inheritance +challengeType: 1 +videoUrl: '' +localeTitle: إضافة طرق بعد الوراثة +--- + +## Description +
    لا تزال دالة منشئ ترث كائن نموذجها prototype من دالة منشئ supertype قادرة على استخدام أساليبها الخاصة بالإضافة إلى الأساليب الموروثة. على سبيل المثال ، Bird هو مُنشئ يرث prototype من Animal :
    وظيفة الحيوان () {}
    Animal.prototype.eat = function () {
    console.log ("nom nom nom")؛

    وظيفة الطيور () {}
    Bird.prototype = Object.create (Animal.prototype)؛
    Bird.prototype.constructor = Bird؛
    بالإضافة إلى ما هو موروث من Animal ، فأنت تريد إضافة سلوك فريد لكائنات Bird . هنا ، سوف تحصل Bird على وظيفة fly() . يتم إضافة وظائف إلى Bird's prototype بنفس الطريقة مثل أي وظيفة المنشئ:
    Bird.prototype.fly = function () {
    console.log ("أنا أطير!") ؛
    الآن سوف يكون لديك Bird من Bird على كلا أساليب eat() و fly() :
    السماح بطة = الطيور الجديدة () ؛
    duck.eat ()؛ // prints "nom nom nom"
    duck.fly ()؛ // prints "أنا أطير!"
    + +## Instructions +
    إضافة كافة التعليمات البرمجية الضرورية لذلك Dog يرث الكائن من Animal و Dog's prototype يتم تعيين المنشئ إلى الكلب. ثم أضف طريقة bark() إلى جسم Dog حتى يستطيع beagle أن eat() bark() . يجب أن تطبع طريقة bark() "Woof!" إلى وحدة التحكم.
    + +## Tests +
    + +```yml +tests: + - text: لا ينبغي أن يستجيب Animal لطريقة bark() . + testString: 'assert(typeof Animal.prototype.bark == "undefined", "Animal should not respond to the bark() method.");' + - text: يجب أن يرث Dog طريقة eat() من Animal . + testString: 'assert(typeof Dog.prototype.eat == "function", "Dog should inherit the eat() method from Animal.");' + - text: يجب أن يكون Dog أسلوب bark() كخاصية own . + testString: 'assert(Dog.prototype.hasOwnProperty("bark"), "Dog should have the bark() method as an own property.");' + - text: beagle يجب أن يكون instanceof Animal . + testString: 'assert(beagle instanceof Animal, "beagle should be an instanceof Animal.");' + - text: يجب تعيين منشئ beagle Dog . + testString: 'assert(beagle.constructor === Dog, "The constructor for beagle should be set to Dog.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function Animal() { } +Animal.prototype.eat = function() { console.log("nom nom nom"); }; + +function Dog() { } + +// Add your code below this line + + + + +// Add your code above this line + +let beagle = new Dog(); + +beagle.eat(); // Should print "nom nom nom" +beagle.bark(); // Should print "Woof!" + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/change-the-prototype-to-a-new-object.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/change-the-prototype-to-a-new-object.arabic.md new file mode 100644 index 0000000000..3c65a113d8 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/change-the-prototype-to-a-new-object.arabic.md @@ -0,0 +1,62 @@ +--- +id: 587d7daf367417b2b2512b7f +title: Change the Prototype to a New Object +challengeType: 1 +videoUrl: '' +localeTitle: تغيير النموذج إلى كائن جديد +--- + +## Description +
    حتى الآن ، كنت تضيف خصائص إلى prototype فردي:
    Bird.prototype.numLegs = 2؛
    هذا يصبح مملا بعد أكثر من بعض الخصائص.
    Bird.prototype.eat = function () {
    console.log ("nom nom nom")؛
    }

    Bird.prototype.describe = function () {
    console.log ("اسمي هو" + this.name)؛
    }
    الطريقة الأكثر فعالية هي تعيين prototype على كائن جديد يحتوي بالفعل على الخصائص. بهذه الطريقة ، تتم إضافة الخصائص كلها مرة واحدة:
    Bird.prototype = {
    numLegs: 2 ،
    أكل: وظيفة () {
    console.log ("nom nom nom")؛

    وصف: الوظيفة () {
    console.log ("اسمي هو" + this.name)؛
    }
    + +## Instructions +
    إضافة الخاصية numLegs eat() describe() إلى prototype Dog عن طريق وضع prototype على كائن جديد.
    + +## Tests +
    + +```yml +tests: + - text: يجب تعيين Dog.prototype إلى كائن جديد. + testString: 'assert((/Dog\.prototype\s*?=\s*?{/).test(code), "Dog.prototype should be set to a new object.");' + - text: Dog.prototype يجب أن يكون الممتلكات numLegs . + testString: 'assert(Dog.prototype.numLegs !== undefined, "Dog.prototype should have the property numLegs.");' + - text: يجب أن يكون Dog.prototype الأسلوب eat() . + testString: 'assert(typeof Dog.prototype.eat === "function", "Dog.prototype should have the method eat()."); ' + - text: يجب أن يكون Dog.prototype الأسلوب describe() . + testString: 'assert(typeof Dog.prototype.describe === "function", "Dog.prototype should have the method describe()."); ' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function Dog(name) { + this.name = name; +} + +Dog.prototype = { + // Add your code below this line + +}; + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/create-a-basic-javascript-object.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/create-a-basic-javascript-object.arabic.md new file mode 100644 index 0000000000..96d3273f17 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/create-a-basic-javascript-object.arabic.md @@ -0,0 +1,55 @@ +--- +id: 587d7dac367417b2b2512b73 +title: Create a Basic JavaScript Object +challengeType: 1 +videoUrl: '' +localeTitle: قم بإنشاء كائن JavaScript أساسي +--- + +## Description +
    فكّر في الأشياء التي يشاهدها الناس يوميًا ، مثل السيارات والمحلات التجارية والطيور. هذه كلها objects : أشياء ملموسة يستطيع الناس ملاحظتها والتفاعل معها. ما هي بعض صفات هذه objects ؟ سيارة لديها عجلات. محلات بيع المواد. الطيور لديها أجنحة. هذه الصفات ، أو properties ، تحدد ما الذي يصنع object . لاحظ أن objects المتشابهة تتشارك في نفس properties ، ولكن قد تحتوي على قيم مختلفة لتلك properties . على سبيل المثال ، تحتوي جميع السيارات على عجلات ، ولكن لا تحتوي جميع السيارات على نفس عدد العجلات. يتم استخدام Objects في JavaScript Objects في العالم الحقيقي ، مما يمنحها properties وسلوكًا مثل نظيراتها في العالم الحقيقي. في ما يلي مثال على استخدام هذه المفاهيم لإنشاء object duck :
    دع بطة = {
    الاسم: "Aflac" ،
    numLegs: 2
    يحتوي هذا object duck أزواج الخاصية / قيمة اثنين: name "Aflac" و numLegs من 2.
    + +## Instructions +
    إنشاء object dog مع name وخصائص numLegs ، numLegs إلى سلسلة ورقم ، على التوالي.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يكون dog object . + testString: 'assert(typeof(dog) === "object", "dog should be an object.");' + - text: يجب أن يكون dog خاصية name معيّنة إلى string . + testString: 'assert(typeof(dog.name) === "string", "dog should have a name property set to a string.");' + - text: يجب أن يكون لدى dog خاصية numLegs معيّنة إلى number . + testString: 'assert(typeof(dog.numLegs) === "number", "dog should have a numLegs property set to a number.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let dog = { + +}; + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/create-a-method-on-an-object.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/create-a-method-on-an-object.arabic.md new file mode 100644 index 0000000000..21e51b5a6c --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/create-a-method-on-an-object.arabic.md @@ -0,0 +1,57 @@ +--- +id: 587d7dad367417b2b2512b75 +title: Create a Method on an Object +challengeType: 1 +videoUrl: '' +localeTitle: إنشاء طريقة على كائن +--- + +## Description +
    يمكن أن تحتوي Objects على نوع خاص من property ، تسمى method . Methods هي properties التي هي وظائف. هذا يضيف سلوك مختلف إلى object . إليك مثال duck مع طريقة:
    دع بطة = {
    الاسم: "Aflac" ،
    numLegs: 2 ،
    sayName: function () {return "اسم هذه البط هو" + duck.name + "."؛}

    duck.sayName ()؛
    // Returns "اسم هذه البط هو Aflac".
    يقوم المثال sayName method sayName ، وهي عبارة تقوم بارجاع جملة تعطي اسم duck . لاحظ أن method الوصول إلى خاصية name في العبارة الإرجاع باستخدام duck.name . سيغطي التحدي التالي طريقة أخرى للقيام بذلك.
    + +## Instructions +
    باستخدام object dog ، أعطه طريقة تسمى sayLegs . يجب أن ترجع الطريقة الجملة "يحتوي هذا الكلب على 4 أرجل".
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يكون dog.sayLegs() دالة. + testString: 'assert(typeof(dog.sayLegs) === "function", "dog.sayLegs() should be a function.");' + - text: يجب أن يعيد dog.sayLegs() السلسلة المعطاة - لاحظ أن علامات الترقيم ومسألة التباعد. + testString: 'assert(dog.sayLegs() === "This dog has 4 legs.", "dog.sayLegs() should return the given string - note that punctuation and spacing matter.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let dog = { + name: "Spot", + numLegs: 4, + +}; + +dog.sayLegs(); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/define-a-constructor-function.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/define-a-constructor-function.arabic.md new file mode 100644 index 0000000000..a18ed59844 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/define-a-constructor-function.arabic.md @@ -0,0 +1,52 @@ +--- +id: 587d7dad367417b2b2512b77 +title: Define a Constructor Function +challengeType: 1 +videoUrl: '' +localeTitle: تحديد وظيفة منشئ +--- + +## Description +
    Constructors هي وظائف تقوم بإنشاء كائنات جديدة. أنها تحدد الخصائص والسلوكيات التي تنتمي إلى الكائن الجديد. فكر فيها كمخطط لإنشاء كائنات جديدة. هنا مثال constructor :
    وظيفة الطيور () {
    this.name = "Albert"؛
    this.color = "blue"؛
    this.numLegs = 2 ،
    }
    يعرّف هذا constructor كائن Bird name الخاصية ، color ، ومجموعة numLegs إلى Albert ، و blue ، و 2 ، على التوالي. Constructors متابعة بعض الاتفاقيات:
    + +## Instructions +
    إنشاء constructor ، Dog ، مع name الخصائص ، color ، و numLegs التي تم تعيينها إلى سلسلة ، وسلسلة ، ورقم ، على التوالي.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يكون Dog خاصية name معيّنة إلى سلسلة. + testString: 'assert(typeof (new Dog()).name === "string", "Dog should have a name property set to a string.");' + - text: يجب أن يكون Dog خاصية color مضبوطة على سلسلة. + testString: 'assert(typeof (new Dog()).color === "string", "Dog should have a color property set to a string.");' + - text: يجب أن يكون لدى Dog خاصية numLegs معيّنة إلى رقم. + testString: 'assert(typeof (new Dog()).numLegs === "number", "Dog should have a numLegs property set to a number.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/extend-constructors-to-receive-arguments.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/extend-constructors-to-receive-arguments.arabic.md new file mode 100644 index 0000000000..d1f18c20a4 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/extend-constructors-to-receive-arguments.arabic.md @@ -0,0 +1,57 @@ +--- +id: 587d7dae367417b2b2512b79 +title: Extend Constructors to Receive Arguments +challengeType: 1 +videoUrl: '' +localeTitle: تمديد البنائين لتلقي الحجج +--- + +## Description +
    عملت Bird Dog من التحدي الأخير بشكل جيد. ومع ذلك ، لاحظ أن جميع Birds التي يتم إنشاؤها بواسطة منشئ Bird تسمى تلقائيًا Albert ، وهي زرقاء اللون ، ولها أرجل. ماذا لو كنت تريد الطيور ذات القيم المختلفة للاسم واللون؟ من الممكن تغيير خصائص كل طائر يدويًا ، لكن ذلك سيكون كثيرًا من العمل:
    دعونا بجعة = طائر جديد () ؛
    swan.name = "Carlos"؛
    swan.color = "white"؛
    افترض أنك كنت تكتب برنامج لتتبع مئات أو حتى الآلاف من الطيور المختلفة في القفص. سيستغرق الأمر الكثير من الوقت لإنشاء جميع الطيور ، ثم تغيير الخصائص إلى قيم مختلفة لكل واحد. لإنشاء كائنات Bird مختلفة بسهولة أكبر ، يمكنك تصميم منشئ Bird الخاص بك لقبول المعلمات:
    وظيفة الطيور (الاسم واللون) {
    this.name = name؛
    this.color = لون؛
    this.numLegs = 2 ،
    }
    ثم قم بتمرير القيم كحجج لتعريف كل طائر فريد في منشئ Bird : let cardinal = new Bird("Bruce", "red"); هذا يعطي مثال جديد من Bird مع اسم وخصائص اللون لتعيين بروس والأحمر ، على التوالي. لا يزال يتم تعيين الخاصية numLegs إلى 2. يحتوي cardinal على هذه الخصائص:
    cardinal.name // => بروس
    cardinal.color // => أحمر
    cardinal.numLegs // => 2
    المنشئ أكثر مرونة. من الممكن الآن تحديد خصائص كل Bird في وقت إنشائه ، وهو أحد الطرق التي تكون بها منشئات جافا سكريبت مفيدة للغاية. يقوموا بتجميع الأشياء معًا استنادًا إلى الخصائص والسلوكيات المشتركة وتحديد مخطط يعمل تلقائيًا على إنشائها.
    + +## Instructions +
    إنشاء منشئ Dog آخر. هذه المرة ، إعداده لاتخاذ المعلمات name color ، ولها خاصية numLegs ثابتة في 4. ثم إنشاء Dog جديد المحفوظة في terrier متغير. تمريرها جهازي كوسائط name ولخصائص color .
    + +## Tests +
    + +```yml +tests: + - text: Dog يجب أن يحصل على حجة name . + testString: 'assert((new Dog("Clifford")).name === "Clifford", "Dog should receive an argument for name.");' + - text: يجب أن يحصل Dog على حجة color . + testString: 'assert((new Dog("Clifford", "yellow")).color === "yellow", "Dog should receive an argument for color.");' + - text: يجب أن يكون Dog لديه خاصية numLegs مضبوطة على 4. + testString: 'assert((new Dog("Clifford")).numLegs === 4, "Dog should have property numLegs set to 4.");' + - text: يجب أن يتم إنشاء terrier باستخدام منشئ Dog . + testString: 'assert(terrier instanceof Dog, "terrier should be created using the Dog constructor.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function Dog() { + +} + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/inherit-behaviors-from-a-supertype.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/inherit-behaviors-from-a-supertype.arabic.md new file mode 100644 index 0000000000..16d603b5d9 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/inherit-behaviors-from-a-supertype.arabic.md @@ -0,0 +1,70 @@ +--- +id: 587d7db0367417b2b2512b84 +title: Inherit Behaviors from a Supertype +challengeType: 1 +videoUrl: '' +localeTitle: وراثة السلوكيات من Supertype +--- + +## Description +
    في التحدي السابق ، أنشأت نوعًا من النوع supertype يُطلق عليه اسم Animal والذي حدد السلوكيات التي تتقاسمها جميع الحيوانات:
    وظيفة الحيوان () {}
    Animal.prototype.eat = function () {
    console.log ("nom nom nom")؛
    سيغطي هذا التحدي التالي كيفية إعادة استخدام أساليب Animal's داخل Bird and Dog بدون تعريفهم مرة أخرى. ويستخدم تقنية تسمى inheritance . يغطي هذا التحدي الخطوة الأولى: تقديم مثال على النوع supertype (أو الأصل). أنت تعرف بالفعل طريقة واحدة لإنشاء مثيل Animal باستخدام المشغل new :
    السماح للحيوان = حيوان جديد () ؛
    هناك بعض العيوب عند استخدام هذه الصيغة inheritance ، والتي تكون معقدة للغاية بالنسبة لنطاق هذا التحدي. بدلاً من ذلك ، إليك طريقة بديلة بدون هذه العيوب:
    السماح للحيوان = Object.create (Animal.prototype) ؛
    Object.create(obj) بإنشاء كائن جديد ويقوم بتعيين obj كـ prototype للكائن الجديد. أذكر أن prototype هو مثل "وصفة" لإنشاء كائن. من خلال وضع prototype animal ليكون prototype Animal's ، فأنت تعطي مثال animal على نحو فعال نفس "الوصفة" كأي مثيل آخر Animal .
    animal.eat ()؛ // prints "nom nom nom"
    الحيوان المسبب للحيوان؛ // => صحيح
    + +## Instructions +
    استخدم Object.create لعمل حالتين من Animal المسمى duck beagle .
    + +## Tests +
    + +```yml +tests: + - text: يجب تعريف متغير duck . + testString: 'assert(typeof duck !== "undefined", "The duck variable should be defined.");' + - text: يجب تعريف متغير beagle . + testString: 'assert(typeof beagle !== "undefined", "The beagle variable should be defined.");' + - text: يجب أن يكون duck prototype Animal . + testString: 'assert(duck instanceof Animal, "duck should have a prototype of Animal.");' + - text: ينبغي أن يكون beagle prototype Animal . + testString: 'assert(beagle instanceof Animal, "beagle should have a prototype of Animal.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function Animal() { } + +Animal.prototype = { + constructor: Animal, + eat: function() { + console.log("nom nom nom"); + } +}; + +// Add your code below this line + +let duck; // Change this line +let beagle; // Change this line + +duck.eat(); // Should print "nom nom nom" +beagle.eat(); // Should print "nom nom nom" + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/iterate-over-all-properties.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/iterate-over-all-properties.arabic.md new file mode 100644 index 0000000000..1c9ea85263 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/iterate-over-all-properties.arabic.md @@ -0,0 +1,64 @@ +--- +id: 587d7daf367417b2b2512b7d +title: Iterate Over All Properties +challengeType: 1 +videoUrl: '' +localeTitle: تكرار جميع الممتلكات +--- + +## Description +
    لقد رأيت الآن نوعين من الخصائص: الخصائص own وخواص prototype . يتم تعريف الخصائص Own مباشرة على مثيل الكائن نفسه. يتم تعريف خصائص prototype على prototype .
    وظيفة الطيور (الاسم) {
    this.name = name؛ //الملكية الخاصة
    }

    Bird.prototype.numLegs = 2؛ // الملكية النموذج

    السماح بطة = الطيور الجديدة ("دونالد") ؛
    هنا هو كيف يمكنك إضافة duck الصورة own خصائص لمجموعة ownProps و prototype خصائص لمجموعة prototypeProps :
    let ownProps = []؛
    السماح لـ prototypeProps = []؛

    ل (دع الممتلكات في البط) {
    if (duck.hasOwProProty (property)) {
    ownProps.push (الملكية)؛
    } آخر {
    prototypeProps.push (الملكية)؛
    }
    }

    console.log (ownProps)؛ // printts ["name"]
    console.log (prototypeProps)؛ // prints ["numLegs"]
    + +## Instructions +
    إضافة جميع الخصائص own beagle إلى مجموعة ownProps . إضافة كل خصائص prototype Dog إلى مجموعة prototypeProps .
    + +## Tests +
    + +```yml +tests: + - text: يجب أن تتضمن صفيف ownProps "name" . + testString: 'assert(ownProps.indexOf("name") !== -1, "The ownProps array should include "name".");' + - text: يجب أن تتضمن صفيف prototypeProps "numLegs" . + testString: 'assert(prototypeProps.indexOf("numLegs") !== -1, "The prototypeProps array should include "numLegs".");' + - text: حل هذا التحدي دون استخدام الأسلوب Object.keys() . + testString: 'assert(!/\Object.keys/.test(code), "Solve this challenge without using the built in method Object.keys().");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function Dog(name) { + this.name = name; +} + +Dog.prototype.numLegs = 4; + +let beagle = new Dog("Snoopy"); + +let ownProps = []; +let prototypeProps = []; + +// Add your code below this line + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/make-code-more-reusable-with-the-this-keyword.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/make-code-more-reusable-with-the-this-keyword.arabic.md new file mode 100644 index 0000000000..a767804b78 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/make-code-more-reusable-with-the-this-keyword.arabic.md @@ -0,0 +1,57 @@ +--- +id: 587d7dad367417b2b2512b76 +title: Make Code More Reusable with the this Keyword +challengeType: 1 +videoUrl: '' +localeTitle: جعل رمز أكثر قابلة لإعادة الاستخدام مع هذه الكلمة الرئيسية +--- + +## Description +
    قدم التحدي الأخير method إلى كائن duck . استخدم duck.name dot notation للوصول إلى قيمة خاصية name داخل العبارة return: sayName: function() {return "The name of this duck is " + duck.name + ".";} بينما هذا صالح طريقة للوصول إلى خاصية الكائن ، هناك شرك هنا. في حالة تغيير اسم المتغير ، يجب تحديث أي شفرة تشير إلى الاسم الأصلي أيضًا. في تعريف كائن قصير ، ليست مشكلة ، ولكن إذا كان للكائن العديد من الإشارات إلى خصائصه ، فهناك فرصة أكبر للخطأ. تتمثل إحدى الطرق لتجنب هذه المشكلات في استخدام this الكلمة الرئيسية:
    دع بطة = {
    الاسم: "Aflac" ،
    numLegs: 2 ،
    sayName: function () {return "اسم هذه البطة هو" + this.name + "."؛}
    this موضوع عميق ، والمثال أعلاه هو طريقة واحدة فقط لاستخدامه. في السياق الحالي ، يشير this إلى الكائن الذي ترتبط به الطريقة: duck . إذا تم تغيير اسم الكائن إلى mallard ، فليس من الضروري العثور على جميع الإشارات إلى duck في الشفرة. إنه يجعل الشفرة قابلة لإعادة الاستخدام وسهلة القراءة.
    + +## Instructions +
    قم بتعديل طريقة dog.sayLegs لإزالة أي مراجع dog . استخدم مثال duck للإرشاد.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن ترجع dog.sayLegs() السلسلة المعطاة. + testString: 'assert(dog.sayLegs() === "This dog has 4 legs.", "dog.sayLegs() should return the given string.");' + - text: يجب أن تستخدم شفرتك this الكلمة الرئيسية للوصول إلى خاصية numLegs الخاصة dog . + testString: 'assert(code.match(/this\.numLegs/g), "Your code should use the this keyword to access the numLegs property of dog.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let dog = { + name: "Spot", + numLegs: 4, + sayLegs: function() {return "This dog has " + dog.numLegs + " legs.";} +}; + +dog.sayLegs(); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/override-inherited-methods.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/override-inherited-methods.arabic.md new file mode 100644 index 0000000000..213561c5a8 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/override-inherited-methods.arabic.md @@ -0,0 +1,66 @@ +--- +id: 587d7db1367417b2b2512b88 +title: Override Inherited Methods +challengeType: 1 +videoUrl: '' +localeTitle: تجاوز الأساليب الموروثة +--- + +## Description +
    في الدروس السابقة ، تعلمت أن الكائن يمكن أن يرث سلوكه (أساليب) من كائن آخر عن طريق استنساخ كائن prototype الخاص به:
    ChildObject.prototype = Object.create (ParentObject.prototype)؛
    ثم تلقت ChildObject الخاصة عن طريق ChildObject prototype :
    ChildObject.prototype.methodName = function () {...}؛
    من الممكن تجاوز طريقة وراثية. ويتم ذلك بنفس الطريقة - عن طريق إضافة طريقة إلى ChildObject.prototype باستخدام نفس اسم الأسلوب الذي يتم تجاوزه. في ما يلي مثال Bird يتفوق على طريقة eat() الموروثة من Animal :
    وظيفة الحيوان () {}
    Animal.prototype.eat = function () {
    return "nom nom nom"؛

    وظيفة الطيور () {}

    // وراثة جميع الطرق من الحيوان
    Bird.prototype = Object.create (Animal.prototype)؛

    // Bird.eat () يتخطى Animal.eat ()
    Bird.prototype.eat = function () {
    عودة "بيك بيك بيك"؛
    إذا كان لديك مثيل ، let duck = new Bird(); واستدعاء duck.eat() ، هذه هي الطريقة التي يبدو جافا سكريبت لأسلوب على duck's prototype سلسلة: 1. بطة => هل تأكل () المعرفة هنا؟ رقم 2. الطيور => هل تناول الطعام () المعرفة هنا؟ => نعم. تنفيذ ذلك ووقف البحث. 3. يتم تعريف Animal => eat () أيضًا ، لكن JavaScript توقفت عن البحث قبل الوصول إلى هذا المستوى. 4. Object => توقف JavaScript عن البحث قبل الوصول إلى هذا المستوى.
    + +## Instructions +
    تجاوز طريقة fly() لـ Penguin بحيث تُرجع "Alas ، هذا طائر بلا fly() ".
    + +## Tests +
    + +```yml +tests: + - text: يجب أن ترجع penguin.fly() السلسلة "للأسف ، هذا طائر بلا طيار". + testString: 'assert(penguin.fly() === "Alas, this is a flightless bird.", "penguin.fly() should return the string "Alas, this is a flightless bird."");' + - text: يجب أن ترجع طريقة bird.fly() "أنا bird.fly() !" + testString: 'assert((new Bird()).fly() === "I am flying!", "The bird.fly() method should return "I am flying!"");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function Bird() { } + +Bird.prototype.fly = function() { return "I am flying!"; }; + +function Penguin() { } +Penguin.prototype = Object.create(Bird.prototype); +Penguin.prototype.constructor = Penguin; + +// Add your code below this line + + + +// Add your code above this line + +let penguin = new Penguin(); +console.log(penguin.fly()); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/remember-to-set-the-constructor-property-when-changing-the-prototype.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/remember-to-set-the-constructor-property-when-changing-the-prototype.arabic.md new file mode 100644 index 0000000000..992e179622 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/remember-to-set-the-constructor-property-when-changing-the-prototype.arabic.md @@ -0,0 +1,63 @@ +--- +id: 587d7daf367417b2b2512b80 +title: Remember to Set the Constructor Property when Changing the Prototype +challengeType: 1 +videoUrl: '' +localeTitle: تذكر تعيين الخاصية منشئ عند تغيير "النموذج الأولي" +--- + +## Description +
    هناك أحد الآثار الجانبية الحاسمة لإعداد prototype لكائن جديد. انها تمحو الملكية constructor ! الشفرة في التحدي السابق ستطبع ما يلي duck :
    console.log (duck.constructor)
    // prints 'undefined' - عفوًا!
    لإصلاح ذلك ، عند تعيين نموذج أولي يدويًا لكائن جديد ، تذكر تحديد خاصية constructor :
    Bird.prototype = {
    constructor: Bird، // define الخاصية منشئ
    numLegs: 2 ،
    أكل: وظيفة () {
    console.log ("nom nom nom")؛

    وصف: الوظيفة () {
    console.log ("اسمي هو" + this.name)؛
    }
    + +## Instructions +
    تحديد خاصية constructor على prototype Dog .
    + +## Tests +
    + +```yml +tests: + - text: Dog.prototype يجب تعيين الخاصية constructor . + testString: 'assert(Dog.prototype.constructor === Dog, "Dog.prototype should set the constructor property.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function Dog(name) { + this.name = name; +} + +// Modify the code below this line +Dog.prototype = { + + numLegs: 2, + eat: function() { + console.log("nom nom nom"); + }, + describe: function() { + console.log("My name is " + this.name); + } +}; + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/reset-an-inherited-constructor-property.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/reset-an-inherited-constructor-property.arabic.md new file mode 100644 index 0000000000..e07cd59f38 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/reset-an-inherited-constructor-property.arabic.md @@ -0,0 +1,67 @@ +--- +id: 587d7db1367417b2b2512b86 +title: Reset an Inherited Constructor Property +challengeType: 1 +videoUrl: '' +localeTitle: إعادة تعيين منشئ Conherrated الخاصية +--- + +## Description +
    عندما يرث كائن prototype الخاص به من كائن آخر ، فإنه يرث أيضًا خاصية مُنشئ supertype . إليك مثال على ذلك:
    وظيفة الطيور () {}
    Bird.prototype = Object.create (Animal.prototype)؛
    السماح بطة = الطيور الجديدة () ؛
    duck.constructor // وظيفة الحيوان () {...}
    ولكن يجب أن تظهر duck وجميع حالات Bird التي شيدت من قبل Bird وليس Animal . للقيام بذلك، يمكنك تعيين يدويا Bird's الملكية منشئ إلى Bird وجوه:
    Bird.prototype.constructor = Bird؛
    duck.constructor // function Bird () {...}
    + +## Instructions +
    إصلاح التعليمات البرمجية بحيث duck.constructor و beagle.constructor إرجاع beagle.constructor الخاصة بهم.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يكون Bird.prototype مثالًا Animal . + testString: 'assert(Animal.prototype.isPrototypeOf(Bird.prototype), "Bird.prototype should be an instance of Animal.");' + - text: يجب أن يعود duck.constructor Bird . + testString: 'assert(duck.constructor === Bird, "duck.constructor should return Bird.");' + - text: يجب أن يكون Dog.prototype مثالا Animal . + testString: 'assert(Animal.prototype.isPrototypeOf(Dog.prototype), "Dog.prototype should be an instance of Animal.");' + - text: يجب أن يعود beagle.constructor Dog . + testString: 'assert(beagle.constructor === Dog, "beagle.constructor should return Dog.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function Animal() { } +function Bird() { } +function Dog() { } + +Bird.prototype = Object.create(Animal.prototype); +Dog.prototype = Object.create(Animal.prototype); + +// Add your code below this line + + + +let duck = new Bird(); +let beagle = new Dog(); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/set-the-childs-prototype-to-an-instance-of-the-parent.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/set-the-childs-prototype-to-an-instance-of-the-parent.arabic.md new file mode 100644 index 0000000000..bd5b2c4a27 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/set-the-childs-prototype-to-an-instance-of-the-parent.arabic.md @@ -0,0 +1,64 @@ +--- +id: 587d7db1367417b2b2512b85 +title: Set the Child's Prototype to an Instance of the Parent +challengeType: 1 +videoUrl: '' +localeTitle: قم بتعيين Prototype الخاص بالطفل إلى مثيل من أصل +--- + +## Description +
    في التحدي السابق ، شاهدت الخطوة الأولى لوراثة السلوك من Animal supertype (أو الوالد): صنع نسخة جديدة من Animal . يغطي هذا التحدي الخطوة التالية: تعيين prototype subtype (أو الطفل) - في هذه الحالة ، Bird - لتكون مثالًا Animal .
    Bird.prototype = Object.create (Animal.prototype)؛
    تذكر أن prototype هو مثل "وصفة" لإنشاء كائن. بطريقة ما ، تتضمن وصفة Bird الآن جميع "المكونات" الأساسية من Animal .
    السماح بطة = الطيور الجديدة ("دونالد") ؛
    duck.eat ()؛ // prints "nom nom nom"
    يرث duck جميع خصائص Animal ، بما في ذلك طريقة eat .
    + +## Instructions +
    تعديل التعليمات البرمجية بحيث ترث حالات Dog من Animal .
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يكون Dog.prototype مثالا Animal . + testString: 'assert(Animal.prototype.isPrototypeOf(Dog.prototype), "Dog.prototype should be an instance of Animal.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function Animal() { } + +Animal.prototype = { + constructor: Animal, + eat: function() { + console.log("nom nom nom"); + } +}; + +function Dog() { } + +// Add your code below this line + + +let beagle = new Dog(); +beagle.eat(); // Should print "nom nom nom" + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-own-properties.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-own-properties.arabic.md new file mode 100644 index 0000000000..1e4875f522 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-own-properties.arabic.md @@ -0,0 +1,58 @@ +--- +id: 587d7dae367417b2b2512b7b +title: Understand Own Properties +challengeType: 1 +videoUrl: '' +localeTitle: فهم خصائص خاصة +--- + +## Description +
    في المثال التالي ، يعرف منشئ Bird خاصيتين: name و numLegs :
    وظيفة الطيور (الاسم) {
    this.name = name؛
    this.numLegs = 2 ،
    }

    السماح بطة = الطيور الجديدة ("دونالد") ؛
    السماح الكناري = الطيور الجديدة ("تويتي") ؛
    name و numLegs تسمى الخصائص own ، لأنها محددة مباشرة على كائن مثيل. وهذا يعني أن كل من duck canary له نسخة منفصلة خاصة به من هذه الخصائص. في الواقع ، سيكون لكل نسخة من Bird نسخة خاصة بها من هذه الخصائص. التعليمة البرمجية التالية يضيف كل من own خصائص duck لمجموعة ownProps :
    let ownProps = []؛

    ل (دع الممتلكات في البط) {
    if (duck.hasOwProProty (property)) {
    ownProps.push (الملكية)؛
    }
    }

    console.log (ownProps)؛ // prints ["name"، "numLegs"]
    + +## Instructions +
    إضافة الخصائص own canary إلى مجموعة ownProps .
    + +## Tests +
    + +```yml +tests: + - text: يجب أن تتضمن ownProps القيم "numLegs" و "name" . + testString: 'assert(ownProps.indexOf("name") !== -1 && ownProps.indexOf("numLegs") !== -1, "ownProps should include the values "numLegs" and "name".");' + - text: حل هذا التحدي دون استخدام الأسلوب Object.keys() . + testString: 'assert(!/\Object.keys/.test(code), "Solve this challenge without using the built in method Object.keys().");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function Bird(name) { + this.name = name; + this.numLegs = 2; +} + +let canary = new Bird("Tweety"); +let ownProps = []; +// Add your code below this line + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-the-constructor-property.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-the-constructor-property.arabic.md new file mode 100644 index 0000000000..c1ff0cc163 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-the-constructor-property.arabic.md @@ -0,0 +1,60 @@ +--- +id: 587d7daf367417b2b2512b7e +title: Understand the Constructor Property +challengeType: 1 +videoUrl: '' +localeTitle: فهم خاصية منشئ +--- + +## Description +
    هناك خاصية constructor خاص تقع على كائنات الكائن duck beagle التي تم إنشاؤها في التحديات السابقة:
    السماح بطة = الطيور الجديدة () ؛
    دع بيغل = كلب جديد ()؛

    console.log (duck.constructor === Bird)؛ // يطبع صحيح
    console.log (beagle.constructor === Dog)؛ // يطبع صحيح
    لاحظ أن الخاصية constructor مرجع إلى الدالة منشئ الذي أنشأ المثيل. ميزة الخاصية constructor أنه من الممكن التحقق من هذه الخاصية لمعرفة نوع الكائن. في ما يلي مثال لكيفية استخدام هذا:
    وظيفة joinBirdFraternity (مرشح) {
    if (candidate.constructor === Bird) {
    عاد صحيح
    } آخر {
    عودة كاذبة؛
    }
    }
    ملحوظة
    نظرًا لأنه يمكن الكتابة فوق خاصية constructor (والتي سيتم تغطيتها في التحديين التاليين) ، فمن الأفضل عمومًا استخدام أسلوب instanceof للتحقق من نوع الكائن.
    + +## Instructions +
    اكتب دالة joinDogFraternity تأخذ معلمة candidate ، وتعود باستخدام خاصية constructor ، true إذا كان المرشح Dog ، وإلا تعيد false .
    + +## Tests +
    + +```yml +tests: + - text: يجب تعريف joinDogFraternity كدالة. + testString: 'assert(typeof(joinDogFraternity) === "function", "joinDogFraternity should be defined as a function.");' + - text: يجب أن تعود joinDogFraternity true إذا كان candidate مثالًا لـ Dog . + testString: 'assert(joinDogFraternity(new Dog("")) === true, "joinDogFraternity should return true ifcandidate is an instance of Dog.");' + - text: joinDogFraternity يجب استخدام الخاصية constructor . + testString: 'assert(/\.constructor/.test(code) && !/instanceof/.test(code), "joinDogFraternity should use the constructor property.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function Dog(name) { + this.name = name; +} + +// Add your code below this line +function joinDogFraternity(candidate) { + +} + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-the-immediately-invoked-function-expression-iife.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-the-immediately-invoked-function-expression-iife.arabic.md new file mode 100644 index 0000000000..b882b5bab1 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-the-immediately-invoked-function-expression-iife.arabic.md @@ -0,0 +1,55 @@ +--- +id: 587d7db2367417b2b2512b8b +title: Understand the Immediately Invoked Function Expression (IIFE) +challengeType: 1 +videoUrl: '' +localeTitle: فهم تعبير الدالة المستحثة فوراً (IIFE) +--- + +## Description +
    نمط شائع في JavaScript هو تنفيذ وظيفة بمجرد إعلانها:
    (وظيفة () {
    console.log ("Chirp، chirp!")؛
    }) ()؛ // هذا هو تعبير وظيفة مجهول ينفذ على الفور
    // المخرجات "غرد ، غرد!" فورا
    لاحظ أن الدالة ليس لها اسم ولا يتم تخزينها في متغير. الأقواس () في نهاية تعبير الدالة تتسبب في تنفيذها أو استدعاءها على الفور. يُعرف هذا النمط باسم immediately invoked function expression IIFE أو IIFE .
    + +## Instructions +
    makeNest كتابة الدالة makeNest وإزالة دعوتها ، لذا فهي عبارة immediately invoked function expression مجهول على immediately invoked function expression ( IIFE ).
    + +## Tests +
    + +```yml +tests: + - text: يجب أن تكون الوظيفة مجهولة. + testString: 'assert(/\(\s*?function\s*?\(\s*?\)\s*?{/.test(code), "The function should be anonymous.");' + - text: يجب أن تحتوي الدالة الخاصة بك على أقواس في نهاية التعبير للاتصال به على الفور. + testString: 'assert(/}\s*?\)\s*?\(\s*?\)/.test(code), "Your function should have parentheses at the end of the expression to call it immediately.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function makeNest() { + console.log("A cozy nest is ready"); +} + +makeNest(); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-the-prototype-chain.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-the-prototype-chain.arabic.md new file mode 100644 index 0000000000..f4346a734f --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-the-prototype-chain.arabic.md @@ -0,0 +1,58 @@ +--- +id: 587d7db0367417b2b2512b82 +title: Understand the Prototype Chain +challengeType: 1 +videoUrl: '' +localeTitle: فهم سلسلة النموذج +--- + +## Description +
    جميع الكائنات في JavaScript (مع بعض الاستثناءات) لديها prototype . أيضا ، فإن prototype للكائن هو كائن.
    وظيفة الطيور (الاسم) {
    this.name = name؛
    }

    typeof Bird.prototype ، // => كائن
    لأن prototype هو كائن، وهو prototype يمكن أن يكون الخاص prototype ! في هذه الحالة ، يكون prototype Bird.prototype هو Object.prototype :
    Object.prototype.isPrototypeOf (Bird.prototype)؛
    // يعود صحيح
    كيف هذا مفيد؟ قد تتذكر أسلوب hasOwnProperty من التحدي السابق:
    السماح بطة = الطيور الجديدة ("دونالد") ؛
    duck.hasOwnProperty ( "اسم")؛ // => صحيح
    يتم تعريف أسلوب hasOwnProperty في Object.prototype ، والذي يمكن الوصول إليه بواسطة Bird.prototype ، والذي يمكن الوصول إليه بواسطة duck . هذا مثال على سلسلة prototype . في هذا prototype سلسلة، Bird هو supertype ل duck ، في حين أن duck هو subtype . Object هو نوع supertype لكل من Bird و duck . Object هو نوع supertype لجميع الكائنات في JavaScript. لذلك ، يمكن استخدام أي كائن أسلوب hasOwnProperty .
    + +## Instructions +
    تعديل الرمز لإظهار سلسلة النموذج الأولي الصحيح.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن تُظهر الكود الخاص بك أن Object.prototype هو النموذج الأولي لـ Dog.prototype ") + testString: 'assert(/Object\.prototype\.isPrototypeOf/.test(code), "Your code should show that Object.prototype is the prototype of Dog.prototype");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function Dog(name) { + this.name = name; +} + +let beagle = new Dog("Snoopy"); + +Dog.prototype.isPrototypeOf(beagle); // => true + +// Fix the code below so that it evaluates to true +???.isPrototypeOf(Dog.prototype); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-where-an-objects-prototype-comes-from.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-where-an-objects-prototype-comes-from.arabic.md new file mode 100644 index 0000000000..5a0e82977d --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-where-an-objects-prototype-comes-from.arabic.md @@ -0,0 +1,55 @@ +--- +id: 587d7db0367417b2b2512b81 +title: Understand Where an Object’s Prototype Comes From +challengeType: 1 +videoUrl: '' +localeTitle: فهم أين يأتي النموذج الأولي للكائن من +--- + +## Description +
    مثلما يرث الناس جيناتهم من آبائهم ، يرث الكائن prototype مباشرةً من دالة المُنشئ التي أنشأته. على سبيل المثال ، هنا ينشئ منشئ Bird كائن duck :
    وظيفة الطيور (الاسم) {
    this.name = name؛
    }

    السماح بطة = الطيور الجديدة ("دونالد") ؛
    يرث duck نموذجها prototype من وظيفة منشئ Bird . يمكنك إظهار هذه العلاقة مع طريقة isPrototypeOf :
    Bird.prototype.isPrototypeOf (بطة)؛
    // يعود صحيح
    + +## Instructions +
    استخدم isPrototypeOf للتحقق من prototype beagle .
    + +## Tests +
    + +```yml +tests: + - text: تبين أن Dog.prototype هو prototype من beagle + testString: 'assert(/Dog\.prototype\.isPrototypeOf\(beagle\)/.test(code), "Show that Dog.prototype is the prototype of beagle");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function Dog(name) { + this.name = name; +} + +let beagle = new Dog("Snoopy"); + +// Add your code below this line + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/use-a-constructor-to-create-objects.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/use-a-constructor-to-create-objects.arabic.md new file mode 100644 index 0000000000..b3ea514cb7 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/use-a-constructor-to-create-objects.arabic.md @@ -0,0 +1,56 @@ +--- +id: 587d7dad367417b2b2512b78 +title: Use a Constructor to Create Objects +challengeType: 1 +videoUrl: '' +localeTitle: استخدم منشئ لإنشاء كائنات +--- + +## Description +
    هنا منشئ Bird من التحدي السابق:
    وظيفة الطيور () {
    this.name = "Albert"؛
    this.color = "blue"؛
    this.numLegs = 2 ،
    // "هذا" داخل المنشئ يشير دائمًا إلى الكائن الذي يتم إنشاؤه
    }

    واسمحوا blueBird = الطيور الجديدة () ؛
    لاحظ أن المشغل new يستخدم عند استدعاء منشئ. هذا يخبر JavaScript لإنشاء instance جديد من Bird باسم blueBird . بدون المشغل new ، لا يشير this داخل المُنشئ إلى الكائن الذي تم إنشاؤه حديثًا ، مما يعطي نتائج غير متوقعة. الآن blueBird لديه كل الخصائص التي تم تعريفها داخل منشئ Bird :
    blueBird.name. // => ألبرت
    blueBird.color. // => أزرق
    blueBird.numLegs. // => 2
    تمامًا مثل أي كائن آخر ، يمكن الوصول إلى خصائصه وتعديلها:
    blueBird.name = 'Elvira' ،
    blueBird.name. // => إلفيرا
    + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: يجب إنشاء hound باستخدام منشئ Dog . + testString: 'assert(hound instanceof Dog, "hound should be created using the Dog constructor.");' + - text: يجب أن تستخدم شفرتك المشغل new لإنشاء instance Dog . + testString: 'assert(code.match(/new/g), "Your code should use the new operator to create an instance of Dog.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function Dog() { + this.name = "Rupert"; + this.color = "brown"; + this.numLegs = 4; +} +// Add your code below this line + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/use-a-mixin-to-add-common-behavior-between-unrelated-objects.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/use-a-mixin-to-add-common-behavior-between-unrelated-objects.arabic.md new file mode 100644 index 0000000000..78020c8403 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/use-a-mixin-to-add-common-behavior-between-unrelated-objects.arabic.md @@ -0,0 +1,63 @@ +--- +id: 587d7db2367417b2b2512b89 +title: Use a Mixin to Add Common Behavior Between Unrelated Objects +challengeType: 1 +videoUrl: '' +localeTitle: استخدم Mixin لإضافة سلوك شائع بين الكائنات غير المرتبطة +--- + +## Description +
    كما رأيت ، يتم تقاسم السلوك من خلال الوراثة. ومع ذلك ، هناك حالات عندما لا يكون الوراثة هو الحل الأفضل. لا يعمل الميراث بشكل جيد مع الكائنات غير المرتبطة مثل Bird و Airplane . يستطيع كلاهما الطيران ، لكن Bird ليست نوعًا من Airplane والعكس صحيح. بالنسبة للكائنات غير المرتبطة ، من الأفضل استخدام mixins . يسمح mixin للكائنات الأخرى باستخدام مجموعة من الوظائف.
    let flyMixin = function (obj) {
    obj.fly = function () {
    console.log ("الطائر ، wooosh!") ؛
    }
    يأخذ flyMixin أي كائن ويعطيه طريقة fly .
    دع الطائر = {
    الاسم: "دونالد" ،
    numLegs: 2


    واسمحوا الطائرة = {
    model: "777" ،
    num بالمرشحين: 524


    flyMixin (الطيور)؛
    flyMixin (طائرة)؛
    هنا يتم تمرير bird plane في flyMixin ، والذي يقوم بتعيين وظيفة fly لكل كائن. الآن يمكن bird plane الطيران:
    طائر يطير()؛ // prints "Flying، wooosh!"
    plane.fly ()؛ // prints "Flying، wooosh!"
    لاحظ كيف يسمح هذا mixin بإعادة استخدام نفس طريقة fly بواسطة كائنات لا علاقة لها bird plane .
    + +## Instructions +
    إنشاء mixin المسمى glideMixin الذي يحدد طريقة تسمى glide . ثم استخدم glideMixin لإعطاء كل من bird boat القدرة على الانزلاق.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن تقوم التعليمات البرمجية بتعريف متغير glideMixin الذي يعد دالة. + testString: 'assert(typeof glideMixin === "function", "Your code should declare a glideMixin variable that is a function.");' + - text: يجب أن تستخدم التعليمات البرمجية الخاصة بك glideMixin على كائن bird لإعطائه طريقة glide . + testString: 'assert(typeof bird.glide === "function", "Your code should use the glideMixin on the bird object to give it the glide method.");' + - text: يجب أن تستخدم التعليمات البرمجية الخاصة بك glideMixin على كائن boat لإعطائه طريقة glide . + testString: 'assert(typeof boat.glide === "function", "Your code should use the glideMixin on the boat object to give it the glide method.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let bird = { + name: "Donald", + numLegs: 2 +}; + +let boat = { + name: "Warrior", + type: "race-boat" +}; + +// Add your code below this line + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/use-an-iife-to-create-a-module.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/use-an-iife-to-create-a-module.arabic.md new file mode 100644 index 0000000000..00392f4888 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/use-an-iife-to-create-a-module.arabic.md @@ -0,0 +1,62 @@ +--- +id: 587d7db2367417b2b2512b8c +title: Use an IIFE to Create a Module +challengeType: 1 +videoUrl: '' +localeTitle: استخدم IIFE لإنشاء وحدة نمطية +--- + +## Description +
    غالبا ما يتم استخدام immediately invoked function expression IIFE immediately invoked function expression ( IIFE ) لتجميع الوظائف ذات الصلة في كائن واحد أو module واحدة. على سبيل المثال ، حدد تحدٍ سابق اثنين من المزيج:
    وظيفة glideMixin (obj) {
    obj.glide = function () {
    console.log ("الانزلاق على الماء") ؛

    }
    وظيفة flyMixin (obj) {
    obj.fly = function () {
    console.log ("الطائر ، wooosh!") ؛

    }
    يمكننا تجميع هذه mixins في وحدة نمطية على النحو التالي:
    let motionModule = (function () {
    إرجاع {
    glideMixin: function (obj) {
    obj.glide = function () {
    console.log ("الانزلاق على الماء") ؛


    flyMixin: وظيفة (obj) {
    obj.fly = function () {
    console.log ("الطائر ، wooosh!") ؛

    }
    }
    }) ()؛ // يتسبب هذان القوسان في استدعاء الدالة على الفور
    لاحظ أن لديك immediately invoked function expression ( IIFE ) تقوم بإرجاع كائن motionModule . يحتوي هذا الكائن الذي تم إرجاعه على كافة سلوكيات mixin كخصائص للكائن. وتتمثل ميزة نمط module في إمكانية تجميع كل سلوكيات الحركة في كائن واحد يمكن استخدامه بعد ذلك بواسطة أجزاء أخرى من شفرتك. هنا مثال على ذلك استخدامه:
    motionModule.glideMixin (بطة)؛
    duck.glide ()؛
    + +## Instructions +
    إنشاء module اسمه funModule التفاف اثنين من mixins isCuteMixin و singMixin . يجب أن ترجع funModule كائن.
    + +## Tests +
    + +```yml +tests: + - text: يجب تعريف funModule وإرجاع كائن. + testString: 'assert(typeof funModule === "object", "funModule should be defined and return an object.");' + - text: funModule.isCuteMixin يجب الوصول إلى وظيفة. + testString: 'assert(typeof funModule.isCuteMixin === "function", "funModule.isCuteMixin should access a function.");' + - text: funModule.singMixin يجب الوصول إلى وظيفة. + testString: 'assert(typeof funModule.singMixin === "function", "funModule.singMixin should access a function.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let isCuteMixin = function(obj) { + obj.isCute = function() { + return true; + }; +}; +let singMixin = function(obj) { + obj.sing = function() { + console.log("Singing to an awesome tune"); + }; +}; + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/use-closure-to-protect-properties-within-an-object-from-being-modified-externally.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/use-closure-to-protect-properties-within-an-object-from-being-modified-externally.arabic.md new file mode 100644 index 0000000000..c9d5da72ff --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/use-closure-to-protect-properties-within-an-object-from-being-modified-externally.arabic.md @@ -0,0 +1,55 @@ +--- +id: 587d7db2367417b2b2512b8a +title: Use Closure to Protect Properties Within an Object from Being Modified Externally +challengeType: 1 +videoUrl: '' +localeTitle: استخدم Closure لحماية الخصائص داخل كائن من التعديل الخارجي +--- + +## Description +
    في التحدي السابق ، كان bird name ملكية عامة. ويعتبر الجمهور لأنه يمكن الوصول إليها وتغييرها خارج تعريف bird .
    bird.name = "Duffy" ؛
    لذلك ، يمكن لأي جزء من التعليمات البرمجية بسهولة تغيير اسم bird إلى أي قيمة. فكر في أشياء مثل كلمات المرور والحسابات المصرفية التي يمكن تغييرها بسهولة عن طريق أي جزء من تعليمات البرمجة لديك. يمكن أن يسبب الكثير من القضايا. إن أبسط طريقة لجعل الخصائص خاصة هي عن طريق إنشاء متغير داخل دالة المنشئ. هذا يغير نطاق هذا المتغير ليكون داخل دالة المنشئ مقابل المتاحة عالمياً. بهذه الطريقة ، يمكن الوصول إلى الخاصية وتغييرها فقط بالطرق داخل دالة المنشئ أيضًا.
    وظيفة الطيور () {
    واسمحوا hatchedEgg = 10 ؛ // ملكية خاصة

    this.getHatchedEggCount = function () {/ / / يمكن للجمهور أن يستخدم طريقة الطيور
    العودة مع الفقس.

    }
    دع الحبيب = طائر جديد () ؛
    ducky.getHatchedEggCount ()؛ // returns 10
    هنا ، يعد getHachedEggCount طريقة مميزة ، لأنه يمتلك إمكانية الوصول إلى المتغير hatchedEgg . هذا ممكن لأنه يتم الإعلان عن hatchedEgg في نفس السياق مثل getHachedEggCount . في جافا سكريبت ، يمكن لأي وظيفة دائمًا الوصول إلى السياق الذي تم إنشاؤه فيه. وهذا ما يسمى closure .
    + +## Instructions +
    تغيير كيفية تحديد weight في وظيفة Bird لذا فهو متغير خاص. ثم قم بإنشاء أسلوب getWeight بإرجاع قيمة weight .
    + +## Tests +
    + +```yml +tests: + - text: يجب أن تكون خاصية weight متغيرًا خاصًا. + testString: 'assert(!code.match(/this\.weight/g), "The weight property should be a private variable.");' + - text: يجب أن تقوم التعليمات البرمجية بإنشاء طريقة في Bird تسمى getWeight تقوم بإرجاع weight . + testString: 'assert((new Bird()).getWeight() === 15, "Your code should create a method in Bird called getWeight that returns the weight.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function Bird() { + this.weight = 15; + + +} + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/use-dot-notation-to-access-the-properties-of-an-object.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/use-dot-notation-to-access-the-properties-of-an-object.arabic.md new file mode 100644 index 0000000000..3e1357050b --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/use-dot-notation-to-access-the-properties-of-an-object.arabic.md @@ -0,0 +1,55 @@ +--- +id: 587d7dac367417b2b2512b74 +title: Use Dot Notation to Access the Properties of an Object +challengeType: 1 +videoUrl: '' +localeTitle: استخدم Dot Notation للوصول إلى خصائص كائن +--- + +## Description +
    خلق التحدي الأخير object به properties ، والآن سترى كيفية الوصول إلى قيم تلك properties . إليك مثال على ذلك:
    دع بطة = {
    الاسم: "Aflac" ،
    numLegs: 2

    console.log (duck.name)؛
    // هذا يطبع "Aflac" إلى وحدة التحكم
    يتم استخدام الترقيم النقطي على اسم object ، duck ، متبوعًا باسم property ، name ، للوصول إلى قيمة "Aflac".
    + +## Instructions +
    طباعة كلا properties كائن dog أدناه لوحدة التحكم الخاصة بك.
    + +## Tests +
    + +```yml +tests: + - text: يجب عليك استخدام console.log لطباعة القيمة لخاصية name كائن dog . + testString: 'assert(/console.log\(.*dog\.name.*\)/g.test(code), "Your should use console.log to print the value for the name property of the dog object.");' + - text: يجب استخدامك console.log لطباعة القيمة لخاصية numLegs للكائن dog . + testString: 'assert(/console.log\(.*dog\.numLegs.*\)/g.test(code), "Your should use console.log to print the value for the numLegs property of the dog object.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let dog = { + name: "Spot", + numLegs: 4 +}; +// Add your code below this line + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/use-inheritance-so-you-dont-repeat-yourself.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/use-inheritance-so-you-dont-repeat-yourself.arabic.md new file mode 100644 index 0000000000..441b29988c --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/use-inheritance-so-you-dont-repeat-yourself.arabic.md @@ -0,0 +1,80 @@ +--- +id: 587d7db0367417b2b2512b83 +title: Use Inheritance So You Don't Repeat Yourself +challengeType: 1 +videoUrl: '' +localeTitle: استخدام الوراثة حتى لا تكرر نفسك +--- + +## Description +
    هناك مبدأ في البرمجة يسمى " Don't Repeat Yourself (DRY) . السبب في تكرار التعليمات البرمجية هو مشكلة لأن أي تغيير يتطلب إصلاح الكود في أماكن متعددة. هذا عادة ما يعني المزيد من العمل للمبرمجين ومجالاً أكبر للأخطاء. لاحظ في المثال أدناه أن طريقة describe تتم مشاركتها بواسطة Bird and Dog :
    Bird.prototype = {
    منشئ: الطيور ،
    وصف: الوظيفة () {
    console.log ("اسمي هو" + this.name)؛
    }


    Dog.prototype = {
    منشئ: كلب ،
    وصف: الوظيفة () {
    console.log ("اسمي هو" + this.name)؛
    }
    تكرر طريقة describe في مكانين. يمكن تحرير الرمز ليتبع مبدأ DRY عن طريق إنشاء نوع supertype (أو الأصل) يسمى Animal :
    وظيفة الحيوان () {}؛

    Animal.prototype = {
    منشئ: الحيوان ،
    وصف: الوظيفة () {
    console.log ("اسمي هو" + this.name)؛
    }
    بما أن Animal يشتمل على طريقة describe ، فيمكنك إزالتها من Bird and Dog :
    Bird.prototype = {
    منشئ: الطيور


    Dog.prototype = {
    منشئ: كلب
    + +## Instructions +
    تتكرر طريقة eat في كل من Cat and Bear . قم بتحرير الكود بروح DRY بتحريك طريقة eat إلى نوع supertype Animal .
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يكون Animal.prototype خاصية eat . + testString: 'assert(Animal.prototype.hasOwnProperty("eat"), "Animal.prototype should have the eat property.");' + - text: يجب أن لا يكون Bear.prototype خاصية eat . + testString: 'assert(!(Bear.prototype.hasOwnProperty("eat")), "Bear.prototype should not have the eat property.");' + - text: يجب ألا يكون لدى Cat.prototype خاصية eat . + testString: 'assert(!(Cat.prototype.hasOwnProperty("eat")), "Cat.prototype should not have the eat property.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function Cat(name) { + this.name = name; +} + +Cat.prototype = { + constructor: Cat, + eat: function() { + console.log("nom nom nom"); + } +}; + +function Bear(name) { + this.name = name; +} + +Bear.prototype = { + constructor: Bear, + eat: function() { + console.log("nom nom nom"); + } +}; + +function Animal() { } + +Animal.prototype = { + constructor: Animal, + +}; + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/use-prototype-properties-to-reduce-duplicate-code.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/use-prototype-properties-to-reduce-duplicate-code.arabic.md new file mode 100644 index 0000000000..a04914ebb2 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/use-prototype-properties-to-reduce-duplicate-code.arabic.md @@ -0,0 +1,60 @@ +--- +id: 587d7dae367417b2b2512b7c +title: Use Prototype Properties to Reduce Duplicate Code +challengeType: 1 +videoUrl: '' +localeTitle: استخدم خصائص النموذج لتخفيض قانون مكرر +--- + +## Description +
    بما أن numLegs المحتمل أن يكون لها نفس القيمة لجميع حالات Bird ، فأنت تمتلك numLegs متغيرة numLegs داخل كل Bird . قد لا يكون هذا مشكلة عند وجود حالتين فقط ، ولكن تخيل ما إذا كان هناك الملايين من الحالات. من شأنه أن يكون هناك الكثير من المتغيرات المتكررة. أفضل طريقة هي استخدام prototype Bird's . prototype هو كائن مشترك بين كافة مثيلات Bird . فيما يلي كيفية إضافة numLegs إلى Bird prototype :
    Bird.prototype.numLegs = 2؛
    الآن جميع الحالات من Bird لديها خاصية numLegs .
    console.log (duck.numLegs)؛ // يطبع 2
    console.log (canary.numLegs)؛ // يطبع 2
    نظرًا لأن جميع المثيلات تحتوي تلقائيًا على الخصائص في prototype ، prototype في prototype prototype أنه "وصفة" لإنشاء الكائنات. لاحظ أن prototype duck و canary هو جزء من منشئ Bird كنوع Bird.prototype . يحتوي كل كائن في JavaScript تقريبًا على خاصية prototype تمثل جزءًا من دالة المُنشئ التي أنشأها.
    + +## Instructions +
    إضافة خاصية numLegs إلى prototype لـ Dog
    + +## Tests +
    + +```yml +tests: + - text: beagle ينبغي أن يكون لها numLegs الممتلكات. + testString: 'assert(beagle.numLegs !== undefined, "beagle should have a numLegs property.");' + - text: يجب أن يكون beagle.numLegs رقمًا. + testString: 'assert(typeof(beagle.numLegs) === "number" , "beagle.numLegs should be a number.");' + - text: يجب أن يكون numLegs خاصية prototype وليست خاصية own . + testString: 'assert(beagle.hasOwnProperty("numLegs") === false, "numLegs should be a prototype property not an own property.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +function Dog(name) { + this.name = name; +} + + + +// Add your code above this line +let beagle = new Dog("Snoopy"); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/verify-an-objects-constructor-with-instanceof.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/verify-an-objects-constructor-with-instanceof.arabic.md new file mode 100644 index 0000000000..27422a9c42 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/object-oriented-programming/verify-an-objects-constructor-with-instanceof.arabic.md @@ -0,0 +1,57 @@ +--- +id: 587d7dae367417b2b2512b7a +title: Verify an Object's Constructor with instanceof +challengeType: 1 +videoUrl: '' +localeTitle: تحقق من Constructor كائن مع instanceof +--- + +## Description +
    في أي وقت ، تقوم دالة منشئ بإنشاء كائن جديد ، ويقال أن هذا الكائن هو instance لمنشئه. تقدم JavaScript طريقة ملائمة للتحقق من ذلك باستخدام عامل التشغيل instanceof . يسمح لك instanceof بمقارنة كائن بمُنشئ ، وإرجاع true أو false استنادًا إلى ما إذا كان قد تم إنشاء ذلك الكائن باستخدام المُنشئ أم لا. إليك مثال على ذلك:
    اسمحوا بيرد = وظيفة (اسم ولون) {
    this.name = name؛
    this.color = لون؛
    this.numLegs = 2 ،
    }

    دعونا الغراب = الطيور الجديدة ("الكسيس" ، "الأسود") ؛

    غراب مثيله // => صحيح
    إذا تم إنشاء كائن دون استخدام منشئ، instanceof سوف تحقق من أنه لا مثيل لهذا المنشئ:
    دع الكناري = {
    الاسم: "ميلدريد" ،
    اللون الأصفر"،
    numLegs: 2


    طائر كنارى // => خطأ
    + +## Instructions +
    قم بإنشاء مثيل جديد لمنشئ House ، واصفًا به myHouse واجتاز عددًا من غرف النوم. ثم ، استخدم instanceof للتحقق من أنه مثيل House .
    + +## Tests +
    + +```yml +tests: + - text: يجب أن تحتوي myHouse على سمة numBedrooms مضبوطة على رقم. + testString: 'assert(typeof myHouse.numBedrooms === "number", "myHouse should have a numBedrooms attribute set to a number.");' + - text: تأكد من التحقق من أن myHouse هو مثال على House باستخدام عامل التشغيل instanceof . + testString: 'assert(/myHouse\s*instanceof\s*House/.test(code), "Be sure to verify that myHouse is an instance of House using the instanceof operator.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +/* jshint expr: true */ + +function House(numBedrooms) { + this.numBedrooms = numBedrooms; +} + +// Add your code below this line + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-all-or-none.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-all-or-none.arabic.md new file mode 100644 index 0000000000..828154810d --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-all-or-none.arabic.md @@ -0,0 +1,57 @@ +--- +id: 587d7dba367417b2b2512ba8 +title: Check for All or None +challengeType: 1 +videoUrl: '' +localeTitle: تحقق من الكل أو لا شيء +--- + +## Description +
    في بعض الأحيان قد تحتوي الأنماط التي تريد البحث عنها على أجزاء منها قد تكون موجودة أو غير موجودة. ومع ذلك ، قد يكون من المهم التحقق منهم على الرغم من ذلك. يمكنك تحديد الوجود المحتمل لعنصر مع علامة استفهام ، ? . هذا يتحقق لصفر أو واحد من العنصر السابق. يمكنك التفكير في هذا الرمز كقول أن العنصر السابق اختياري. على سبيل المثال ، هناك اختلافات طفيفة في اللغة الإنجليزية الأمريكية والبريطانية ويمكنك استخدام علامة الاستفهام لمطابقة كل من التهجئة.
    دع أمريكا = "لون" ؛
    دعونا البريطانية = "لون".
    اترك rainbowRegex = / colou؟ r /؛
    rainbowRegex.test (أمريكا)؛ // يعود صحيح
    rainbowRegex.test (البريطانية)؛ // يعود صحيح
    + +## Instructions +
    قم بتغيير favRegex regex لمطابقة كل من الإنجليزية الأمريكية (المفضلة) وإصدار اللغة الإنجليزية البريطانية (المفضلة) للكلمة.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يستخدم تعبيرك العادي الرمز الاختياري ، ? . + testString: 'assert(favRegex.source.match(/\?/).length > 0, "Your regex should use the optional symbol, ?.");' + - text: يجب أن يتطابق التعبير العادي مع "favorite" + testString: 'assert(favRegex.test("favorite"), "Your regex should match "favorite"");' + - text: يجب أن يتطابق التعبير العادي مع "favourite" + testString: 'assert(favRegex.test("favourite"), "Your regex should match "favourite"");' + - text: يجب ألا يتطابق تعبيرك العادي مع "fav" + testString: 'assert(!favRegex.test("fav"), "Your regex should not match "fav"");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let favWord = "favorite"; +let favRegex = /change/; // Change this line +let result = favRegex.test(favWord); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/extract-matches.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/extract-matches.arabic.md new file mode 100644 index 0000000000..f54c2d1d5d --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/extract-matches.arabic.md @@ -0,0 +1,55 @@ +--- +id: 587d7db4367417b2b2512b92 +title: Extract Matches +challengeType: 1 +videoUrl: '' +localeTitle: استخراج مباريات +--- + +## Description +
    حتى الآن ، كنت تتحقق فقط مما إذا كان هناك نمط موجود أم لا داخل سلسلة. يمكنك أيضًا استخراج التطابقات الفعلية التي وجدتها مع طريقة .match() . لاستخدام طريقة .match() ، قم بتطبيق الطريقة على سلسلة وتمريرها في regex داخل الأقواس. إليك مثال على ذلك:
    "مرحبا ، العالم!". المباراة (/ مرحبا /) ؛
    // إرجاع ["مرحبًا"]
    دع ourStr = "التعبيرات العادية"؛
    اسمحوا ourRegex = / تعبيرات / ؛
    ourStr.match (ourRegex)؛
    // إرجاع ["التعبيرات"]
    + +## Instructions +
    قم .match() طريقة .match() لاستخراج كلمة coding .
    + +## Tests +
    + +```yml +tests: + - text: و result يجب أن يكون كلمة coding + testString: 'assert(result.join() === "coding", "The result should have the word coding");' + - text: يجب أن يبحث codingRegex regex codingRegex عن coding + testString: 'assert(codingRegex.source === "coding", "Your regex codingRegex should search for coding");' + - text: يجب عليك استخدام طريقة .match() . + testString: 'assert(code.match(/\.match\(.*\)/), "You should use the .match() method.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let extractStr = "Extract the word 'coding' from this string."; +let codingRegex = /change/; // Change this line +let result = extractStr; // Change this line + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/find-characters-with-lazy-matching.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/find-characters-with-lazy-matching.arabic.md new file mode 100644 index 0000000000..4a84602ad0 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/find-characters-with-lazy-matching.arabic.md @@ -0,0 +1,51 @@ +--- +id: 587d7db6367417b2b2512b9b +title: Find Characters with Lazy Matching +challengeType: 1 +videoUrl: '' +localeTitle: العثور على شخصيات مع مطابقة كسول +--- + +## Description +
    في التعبيرات العادية ، تعثر المطابقة greedy على أطول جزء ممكن من السلسلة التي تناسب نمط regex وتعرضها كمطابقة. ويطلق على البديل اسم "مطابقة lazy ، والتي تجد أصغر جزء ممكن من السلسلة التي تفي بنمط regex. يمكنك تطبيق regex /t[az]*i/ على السلسلة "titanic" . هذا التعبير المعتاد هو في الأساس نمط يبدأ بـ t ، وينتهي بـ i ، ويحتوي على بعض الأحرف بينهما. تكون التعابير العادية greedy بشكل افتراضي ، لذا فإن المباراة ستعيد ["titani"] . يجد أكبر سلسلة فرعية ممكنة لتناسب النمط. ومع ذلك ، يمكنك استخدام ? شخصية لتغييره إلى مطابقة lazy . تطابق "titanic" مع regex المعدلة من /t[az]*?i/ returns ["ti"] .
    + +## Instructions +
    أصلح regex /<.*>/ لإرجاع علامة HTML <h1> وليس النص "<h1>Winter is coming</h1>" . تذكر حرف البدل . في التعبير العادي يطابق أي حرف.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يكون متغير result صفيفًا به <h1> فيه + testString: 'assert(result[0] == "

    ", "The result variable should be an array with <h1> in it");' + +``` + +

    + +## Challenge Seed +
    + +
    + +```js +let text = "

    Winter is coming

    "; +let myRegex = /<.*>/; // Change this line +let result = text.match(myRegex); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/find-more-than-the-first-match.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/find-more-than-the-first-match.arabic.md new file mode 100644 index 0000000000..6efc63c6cb --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/find-more-than-the-first-match.arabic.md @@ -0,0 +1,57 @@ +--- +id: 587d7db4367417b2b2512b93 +title: Find More Than the First Match +challengeType: 1 +videoUrl: '' +localeTitle: العثور على أكثر من المباراة الأولى +--- + +## Description +
    حتى الآن ، كنت قادرًا على استخراج نمط أو البحث عنه مرة واحدة فقط.
    let testStr = "Repeat، Repeat، Repeat"؛
    دع ourRegex = / كرر /؛
    testStr.match (ourRegex)؛
    // Returns ["Repeat"]
    للبحث أو استخراج نمط أكثر من مرة ، يمكنك استخدام علم g .
    اترك repeatRegex = / Repeat / g؛
    testStr.match (repeatRegex)؛
    // Returns ["Repeat"، "Repeat"، "Repeat"]
    + +## Instructions +
    باستخدام regex starRegex ، ابحث starRegex الكلمات "Twinkle" من سلسلة twinkleStar . ملحوظة
    يمكنك الحصول على العديد من العلامات على تعديلك مثل /search/gi
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يستخدم starRegex regex الخاص بك العلم العالمي g + testString: 'assert(starRegex.flags.match(/g/).length == 1, "Your regex starRegex should use the global flag g");' + - text: يجب أن يستخدم starRegex الخاص بك regex starRegex الحالة غير الحساسة i + testString: 'assert(starRegex.flags.match(/i/).length == 1, "Your regex starRegex should use the case insensitive flag i");' + - text: يجب أن تتطابق المطابقة مع كلمتين لكلمة "Twinkle" + testString: 'assert(result.sort().join() == twinkleStar.match(/twinkle/gi).sort().join(), "Your match should match both occurrences of the word "Twinkle"");' + - text: يجب أن تحتوي result المطابقة الخاصة بك على عنصرين. + testString: 'assert(result.length == 2, "Your match result should have two elements in it.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let twinkleStar = "Twinkle, twinkle, little star"; +let starRegex = /change/; // Change this line +let result = twinkleStar; // Change this line + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/find-one-or-more-criminals-in-a-hunt.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/find-one-or-more-criminals-in-a-hunt.arabic.md new file mode 100644 index 0000000000..cc3f12b497 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/find-one-or-more-criminals-in-a-hunt.arabic.md @@ -0,0 +1,67 @@ +--- +id: 587d7db7367417b2b2512b9c +title: Find One or More Criminals in a Hunt +challengeType: 1 +videoUrl: '' +localeTitle: العثور على واحد أو أكثر من المجرمين في مطاردة +--- + +## Description +
    حان وقت الإيقاف المؤقت واختبار مهاراتك الجديدة في الكتابة المعتادة. هربت مجموعة من المجرمين من السجن وهربت ، لكنك لا تعرف عددهم. ومع ذلك ، فأنت تعرف أنها تبقى قريبة من بعضها البعض عندما تكون حول أشخاص آخرين. أنت مسؤول عن العثور على جميع المجرمين في وقت واحد. في ما يلي مثال لمراجعة كيفية إجراء ذلك: يطابق regex /z+/ الحرف z عند ظهوره مرة واحدة أو أكثر في صف واحد. سيجد تطابقات في كافة السلاسل التالية:
    "ض"
    "zzzzzz"
    "ABCzzzz"
    "zzzzABC"
    "abczzzzzzzzzzzzzzzzzzzzzabc"
    ولكنه لا يعثر على تطابقات في السلاسل التالية حيث لا توجد أحرف z حرف:
    ""
    "ABC"
    "ABCABC"
    + +## Instructions +
    اكتب regex greedy أن يجد واحد أو أكثر من المجرمين داخل مجموعة من الناس الآخرين. يمثل المجرم بالحرف الكبير C
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يتطابق تعبيرك العادي مع one المجرمين (" C ") في "C" + testString: 'assert("C".match(reCriminals) && "C".match(reCriminals)[0] == "C", "Your regex should match one criminal ("C") in "C"");' + - text: يجب أن يتطابق تعبيرك العادي مع two المجرمين (" CC ") في "CC" + testString: 'assert("CC".match(reCriminals) && "CC".match(reCriminals)[0] == "CC", "Your regex should match two criminals ("CC") in "CC"");' + - text: يجب أن يتطابق "P1P5P4CCCP2P6P3" العادي مع three مجرمين (" CCC ") في "P1P5P4CCCP2P6P3" + testString: 'assert("P1P5P4CCCP2P6P3".match(reCriminals) && "P1P5P4CCCP2P6P3".match(reCriminals)[0] == "CCC", "Your regex should match three criminals ("CCC") in "P1P5P4CCCP2P6P3"");' + - text: يجب أن يتطابق "P6P2P7P4P5CCCCCP3P1" العادي مع five مجرمين (" CCCCC ") في "P6P2P7P4P5CCCCCP3P1" + testString: 'assert("P6P2P7P4P5CCCCCP3P1".match(reCriminals) && "P6P2P7P4P5CCCCCP3P1".match(reCriminals)[0] == "CCCCC", "Your regex should match five criminals ("CCCCC") in "P6P2P7P4P5CCCCCP3P1"");' + - text: يجب ألا يتطابق تعبيرك العادي مع أي مجرمين في "" + testString: 'assert(!reCriminals.test(""), "Your regex should not match any criminals in """);' + - text: يجب ألا يتطابق "P1P2P3" العادي مع أي مجرمين في "P1P2P3" + testString: 'assert(!reCriminals.test("P1P2P3"), "Your regex should not match any criminals in "P1P2P3"");' + - text: يجب أن يتطابق CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC العادي مع fifty المجرمين (" CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC ") في "P2P1P5P4CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCP3" . + testString: 'assert("P2P1P5P4CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCP3".match(reCriminals) && "P2P1P5P4CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCP3".match(reCriminals)[0] == "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC", "Your regex should match fifty criminals ("CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC") in "P2P1P5P4CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCP3".");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +// example crowd gathering +let crowd = 'P1P2P3P4P5P6CCCP7P8P9'; + +let reCriminals = /./; // Change this line + +let matchedCriminals = crowd.match(reCriminals); +console.log(matchedCriminals); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/ignore-case-while-matching.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/ignore-case-while-matching.arabic.md new file mode 100644 index 0000000000..3ade01826b --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/ignore-case-while-matching.arabic.md @@ -0,0 +1,69 @@ +--- +id: 587d7db4367417b2b2512b91 +title: Ignore Case While Matching +challengeType: 1 +videoUrl: '' +localeTitle: تجاهل حالة أثناء المطابقة +--- + +## Description +
    حتى الآن ، كنت قد نظرت في regexes للقيام مباريات حرفية من السلاسل. لكن في بعض الأحيان ، قد ترغب أيضًا في مطابقة اختلافات الحالات. الحالة (أو في بعض الأحيان حالة الأحرف) هي الفرق بين الأحرف الكبيرة والأحرف الصغيرة. أمثلة من الأحرف الكبيرة هي "A" و "B" و "C" . أمثلة من الأحرف الصغيرة هي "a" و "b" و "c" . يمكنك مطابقة الحالتين باستخدام ما يسمى بعلم. هناك علامات أخرى ولكن هنا سوف تركز على العلم الذي يتجاهل القضية - العلم i . يمكنك استخدامه عن طريق إلحاقه بالتعبير المعتاد. مثال على استخدام هذه العلامة هو /ignorecase/i . يمكن أن يتطابق هذا التعبير المعتاد مع الجمل "ignorecase" و "igNoreCase" و "IgnoreCase" .
    + +## Instructions +
    اكتب fccRegex regex لمطابقة "freeCodeCamp" ، بغض النظر عن قضيته. يجب ألا يتطابق تعبيرك العادي مع أي اختصارات أو اختلافات في المساحات.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يتطابق freeCodeCamp العادي مع freeCodeCamp + testString: 'assert(fccRegex.test("freeCodeCamp"), "Your regex should match freeCodeCamp");' + - text: يجب أن يتطابق FreeCodeCamp العادي مع FreeCodeCamp + testString: 'assert(fccRegex.test("FreeCodeCamp"), "Your regex should match FreeCodeCamp");' + - text: يجب أن يتطابق FreecodeCamp العادي مع FreecodeCamp + testString: 'assert(fccRegex.test("FreecodeCamp"), "Your regex should match FreecodeCamp");' + - text: يجب أن يتطابق FreeCodecamp العادي مع FreeCodecamp + testString: 'assert(fccRegex.test("FreeCodecamp"), "Your regex should match FreeCodecamp");' + - text: يجب ألا يتطابق تعبيرك العادي مع Free Code Camp + testString: 'assert(!fccRegex.test("Free Code Camp"), "Your regex should not match Free Code Camp");' + - text: يجب أن يتطابق FreeCOdeCamp العادي مع FreeCOdeCamp + testString: 'assert(fccRegex.test("FreeCOdeCamp"), "Your regex should match FreeCOdeCamp");' + - text: يجب ألا يتطابق تعبيرك العادي مع FCC + testString: 'assert(!fccRegex.test("FCC"), "Your regex should not match FCC");' + - text: يجب أن يتطابق FrEeCoDeCamp العادي مع FrEeCoDeCamp + testString: 'assert(fccRegex.test("FrEeCoDeCamp"), "Your regex should match FrEeCoDeCamp");' + - text: يجب أن يتطابق FrEeCodECamp العادي مع FrEeCodECamp + testString: 'assert(fccRegex.test("FrEeCodECamp"), "Your regex should match FrEeCodECamp");' + - text: يجب أن يتطابق التعبير المعتاد مع FReeCodeCAmp + testString: 'assert(fccRegex.test("FReeCodeCAmp"), "Your regex should match FReeCodeCAmp");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let myString = "freeCodeCamp"; +let fccRegex = /change/; // Change this line +let result = fccRegex.test(myString); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-a-literal-string-with-different-possibilities.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-a-literal-string-with-different-possibilities.arabic.md new file mode 100644 index 0000000000..f88a502a52 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-a-literal-string-with-different-possibilities.arabic.md @@ -0,0 +1,63 @@ +--- +id: 587d7db4367417b2b2512b90 +title: Match a Literal String with Different Possibilities +challengeType: 1 +videoUrl: '' +localeTitle: تطابق سلسلة حرفية مع الاحتمالات المختلفة +--- + +## Description +
    باستخدام regexes مثل /coding/ ، يمكنك البحث عن نمط "coding" في سلسلة أخرى. يعد هذا أمرًا قويًا للبحث عن سلاسل مفردة ، ولكنه يقتصر على نمط واحد فقط. يمكنك البحث عن أنماط متعددة باستخدام alternation أو OR المشغل: | . هذا المشغل يطابق الأنماط قبل أو بعدها. على سبيل المثال ، إذا كنت تريد مطابقة "yes" أو "no" ، فإن التعبير المعتاد الذي تريده هو /yes|no/ . يمكنك أيضًا البحث عن أكثر من نمطين فقط. يمكنك القيام بذلك عن طريق إضافة المزيد من الأنماط مع المزيد من عوامل تشغيل OR تفصل بينها ، مثل /yes|no|maybe/ .
    + +## Instructions +
    أكمل petRegex regex petRegex مع الحيوانات الأليفة "dog" أو "cat" أو "bird" أو "fish" .
    + +## Tests +
    + +```yml +tests: + - text: يجب إرجاع petRegex الخاص بك regex true للسلسلة "John has a pet dog." + testString: 'assert(petRegex.test("John has a pet dog."), "Your regex petRegex should return true for the string "John has a pet dog."");' + - text: يجب إرجاع petRegex الخاص بك regex false لسلسلة "Emma has a pet rock." + testString: 'assert(!petRegex.test("Emma has a pet rock."), "Your regex petRegex should return false for the string "Emma has a pet rock."");' + - text: يجب إرجاع petRegex الخاص بك regex true للسلسلة "Emma has a pet bird." + testString: 'assert(petRegex.test("Emma has a pet bird."), "Your regex petRegex should return true for the string "Emma has a pet bird."");' + - text: يجب إعادة petRegex الخاص بك regex true للسلسلة "Liz has a pet cat." + testString: 'assert(petRegex.test("Liz has a pet cat."), "Your regex petRegex should return true for the string "Liz has a pet cat."");' + - text: يجب إعادة petRegex الخاص بك regex false للسلسلة "Kara has a pet dolphin." petRegex "Kara has a pet dolphin." + testString: 'assert(!petRegex.test("Kara has a pet dolphin."), "Your regex petRegex should return false for the string "Kara has a pet dolphin."");' + - text: يجب أن يعود petRegex المعتاد الخاص بك true للسلسلة "Alice has a pet fish." + testString: 'assert(petRegex.test("Alice has a pet fish."), "Your regex petRegex should return true for the string "Alice has a pet fish."");' + - text: يجب أن petRegex المعتاد الخاص بك false للسلسلة "Jimmy has a pet computer." + testString: 'assert(!petRegex.test("Jimmy has a pet computer."), "Your regex petRegex should return false for the string "Jimmy has a pet computer."");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let petString = "James has a pet cat."; +let petRegex = /change/; // Change this line +let result = petRegex.test(petString); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-all-letters-and-numbers.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-all-letters-and-numbers.arabic.md new file mode 100644 index 0000000000..6428e75586 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-all-letters-and-numbers.arabic.md @@ -0,0 +1,61 @@ +--- +id: 587d7db7367417b2b2512b9f +title: Match All Letters and Numbers +challengeType: 1 +videoUrl: '' +localeTitle: المباراة جميع الحروف والأرقام +--- + +## Description +
    باستخدام فئات الأحرف ، تمكنت من البحث عن جميع حروف الأبجدية باستخدام [az] . هذا النوع من فئة الأحرف شائع بما فيه الكفاية أن هناك اختصارًا له ، على الرغم من أنه يتضمن بضعة أحرف إضافية أيضًا. إن أقرب فئة أحرف في JavaScript لتطابق الأبجدية هي \w . هذا الاختصار يساوي [A-Za-z0-9_] . فئة الأحرف هذا تطابق الأحرف الكبيرة والصغيرة بالإضافة إلى الأرقام. ملاحظة ، يتضمن فئة الأحرف هذه أيضًا حرف تسطير أسفل السطر ( _ ).
    let longHand = / [A-Za-z0-9 _] + /؛
    اترك shortHand = / \ w + /؛
    السماح للأرقام = "42" ؛
    السماح varNames = "important_var" ؛
    longHand.test (الأرقام)؛ // يعود صحيح
    shortHand.test (الأرقام)؛ // يعود صحيح
    longHand.test (varNames)؛ // يعود صحيح
    shortHand.test (varNames)؛ // يعود صحيح
    ومن المعروف أيضا أن هذه الفئات طابع الاختصار كما shorthand character classes .
    + +## Instructions +
    استخدم class \w حرف الاختصار لحساب عدد الأحرف الأبجدية الرقمية في علامات الاقتباس والسلاسل المختلفة.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يستخدم تعبيرك العادي العلم العام. + testString: 'assert(alphabetRegexV2.global, "Your regex should use the global flag.");' + - text: يجب أن يستخدم تعبيرك العادي الحرف المختصر + testString: 'assert(/\\w/.test(alphabetRegexV2.source), "Your regex should use the shorthand character \w to match all characters which are alphanumeric.");' + - text: يجب أن يعثر تعبيرك المنطقي على 31 حرفًا أبجديًا رقميًا في "The five boxing wizards jump quickly." + testString: 'assert("The five boxing wizards jump quickly.".match(alphabetRegexV2).length === 31, "Your regex should find 31 alphanumeric characters in "The five boxing wizards jump quickly."");' + - text: يجب أن يعثر تعبيرك المنطقي على 32 حرفًا أبجديًا رقميًا في "Pack my box with five dozen liquor jugs." + testString: 'assert("Pack my box with five dozen liquor jugs.".match(alphabetRegexV2).length === 32, "Your regex should find 32 alphanumeric characters in "Pack my box with five dozen liquor jugs."");' + - text: يجب أن يعثر تعبيرك المعتاد على 30 حرفًا أبجديًا رقميًا في "How vexingly quick daft zebras jump!" + testString: 'assert("How vexingly quick daft zebras jump!".match(alphabetRegexV2).length === 30, "Your regex should find 30 alphanumeric characters in "How vexingly quick daft zebras jump!"");' + - text: يجب أن يعثر "123 456 7890 ABC def GHI jkl MNO pqr STU vwx YZ." على 36 حرفًا أبجديًا رقميًا في "123 456 7890 ABC def GHI jkl MNO pqr STU vwx YZ." + testString: 'assert("123 456 7890 ABC def GHI jkl MNO pqr STU vwx YZ.".match(alphabetRegexV2).length === 36, "Your regex should find 36 alphanumeric characters in "123 456 7890 ABC def GHI jkl MNO pqr STU vwx YZ."");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let quoteSample = "The five boxing wizards jump quickly."; +let alphabetRegexV2 = /change/; // Change this line +let result = quoteSample.match(alphabetRegexV2).length; + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-all-non-numbers.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-all-non-numbers.arabic.md new file mode 100644 index 0000000000..d4047f070f --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-all-non-numbers.arabic.md @@ -0,0 +1,65 @@ +--- +id: 587d7db8367417b2b2512ba1 +title: Match All Non-Numbers +challengeType: 1 +videoUrl: '' +localeTitle: المباراة جميع غير الارقام +--- + +## Description +
    أظهر التحدي الأخير كيفية البحث عن الأرقام باستخدام الاختصار \d باستخدام أحرف صغيرة d . يمكنك أيضًا البحث عن غير أرقام باستخدام اختصار مماثل يستخدم حرف D كبيرًا بدلاً من ذلك. الاختصار للبحث عن أحرف غير رقمية هو \D هذا يساوي فئة الأحرف [^0-9] ، والتي تبحث عن حرف واحد ليس رقمًا بين الصفر والتاسع.
    + +## Instructions +
    استخدم فئة حرف الاختصار غير digits \D لحساب عدد غير أرقام في عناوين الأفلام.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يستخدم تعبيرك العادي حرف الاختصار لمطابقة الأحرف غير المكونة + testString: 'assert(/\\D/.test(noNumRegex.source), "Your regex should use the shortcut character to match non-digit characters");' + - text: يجب أن يستخدم تعبيرك العادي العلم العام. + testString: 'assert(noNumRegex.global, "Your regex should use the global flag.");' + - text: يجب ألا يعثر التعبير المعتاد على أي أرقام في "9" . + testString: 'assert("9".match(noNumRegex) == null, "Your regex should find no non-digits in "9".");' + - text: يجب أن يعثر تعبيرك المنطقي على 6 أرقام في "Catch 22" . + testString: 'assert("Catch 22".match(noNumRegex).length == 6, "Your regex should find 6 non-digits in "Catch 22".");' + - text: يجب أن يعثر تعبيرك المنطقي على 11 رقمًا غير رقمي في "101 Dalmatians" . + testString: 'assert("101 Dalmatians".match(noNumRegex).length == 11, "Your regex should find 11 non-digits in "101 Dalmatians".");' + - text: 'يجب أن يعثر تعبيرك المعتاد على 15 رقمًا غير رقمي في "One, Two, Three" .' + testString: 'assert("One, Two, Three".match(noNumRegex).length == 15, "Your regex should find 15 non-digits in "One, Two, Three".");' + - text: يجب أن يعثر تعبيرك المعتاد على 12 رقمًا غير رقمي في "21 Jump Street" . + testString: 'assert("21 Jump Street".match(noNumRegex).length == 12, "Your regex should find 12 non-digits in "21 Jump Street".");' + - text: 'يجب أن يعثر تعبيرك المعتاد على 17 رقمًا غير رقمي في "2001: A Space Odyssey" .' + testString: 'assert("2001: A Space Odyssey".match(noNumRegex).length == 17, "Your regex should find 17 non-digits in "2001: A Space Odyssey".");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let numString = "Your sandwich will be $5.00"; +let noNumRegex = /change/; // Change this line +let result = numString.match(noNumRegex).length; + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-all-numbers.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-all-numbers.arabic.md new file mode 100644 index 0000000000..bed38303ba --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-all-numbers.arabic.md @@ -0,0 +1,65 @@ +--- +id: 5d712346c441eddfaeb5bdef +title: Match All Numbers +challengeType: 1 +videoUrl: '' +localeTitle: تطابق جميع الأرقام +--- + +## Description +
    لقد تعلمت اختصارات لنماذج السلسلة الشائعة مثل alphanumerics. نمط آخر شائع يبحث عن أرقام أو أرقام فقط. الاختصار للبحث عن أحرف الأرقام هو \d ، مع حرف صغير d . هذا يساوي درجة الحرف [0-9] ، التي تبحث عن حرف واحد لأي رقم بين صفر وتسعة.
    + +## Instructions +
    استخدم فئة حرف الاختصار \d لحساب عدد الأرقام الموجودة في عناوين الأفلام. الأرقام المكتوبة ("ستة" بدلا من 6) لا تحتسب.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يستخدم تعبيرك العادي حرف الاختصار لمطابقة أحرف الأرقام + testString: 'assert(/\\d/.test(numRegex.source), "Your regex should use the shortcut character to match digit characters");' + - text: يجب أن يستخدم تعبيرك العادي العلم العام. + testString: 'assert(numRegex.global, "Your regex should use the global flag.");' + - text: يجب أن يعثر تعبيرك المنطقي على رقم واحد في "9" . + testString: 'assert("9".match(numRegex).length == 1, "Your regex should find 1 digit in "9".");' + - text: يجب أن يعثر تعبيرك المنطقي على رقمين في "Catch 22" . + testString: 'assert("Catch 22".match(numRegex).length == 2, "Your regex should find 2 digits in "Catch 22".");' + - text: يجب أن يعثر تعبيرك المنطقي على 3 أرقام في "101 Dalmatians" . + testString: 'assert("101 Dalmatians".match(numRegex).length == 3, "Your regex should find 3 digits in "101 Dalmatians".");' + - text: 'يجب أن يعثر تعبيرك المنطقي على أي أرقام في "One, Two, Three" .' + testString: 'assert("One, Two, Three".match(numRegex) == null, "Your regex should find no digits in "One, Two, Three".");' + - text: يجب أن يعثر تعبيرك المنطقي على رقمين في "21 Jump Street" . + testString: 'assert("21 Jump Street".match(numRegex).length == 2, "Your regex should find 2 digits in "21 Jump Street".");' + - text: 'يجب أن يعثر تعبيرك المنطقي على 4 أرقام في "2001: A Space Odyssey" .' + testString: 'assert("2001: A Space Odyssey".match(numRegex).length == 4, "Your regex should find 4 digits in "2001: A Space Odyssey".");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let numString = "Your sandwich will be $5.00"; +let numRegex = /change/; // Change this line +let result = numString.match(numRegex).length; + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-anything-with-wildcard-period.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-anything-with-wildcard-period.arabic.md new file mode 100644 index 0000000000..9120934cd4 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-anything-with-wildcard-period.arabic.md @@ -0,0 +1,69 @@ +--- +id: 587d7db5367417b2b2512b94 +title: Match Anything with Wildcard Period +challengeType: 1 +videoUrl: '' +localeTitle: تطابق أي شيء مع فترة أحرف البدل +--- + +## Description +
    في بعض الأحيان ، لن (أو لا تحتاج إلى) معرفة الأحرف الدقيقة في أنماطك. التفكير في كل الكلمات التي تتطابق مع ، على سبيل المثال ، خطأ إملائي سيستغرق وقتًا طويلاً. لحسن الحظ، يمكنك توفير الوقت باستخدام حرف بدل: . حرف البدل . سوف تطابق أي حرف واحد. ويطلق على حرف البدل أيضا dot period . يمكنك استخدام حرف البدل تمامًا مثل أي حرف آخر في regex. على سبيل المثال ، إذا أردت مطابقة "hug" و "huh" و "hut" و "hum" ، فيمكنك استخدام regex /hu./ لمطابقة كل الكلمات الأربع.
    لندع humStr = "سوف ألعب أغنية" ؛
    let hugStr = "Bear hug"؛
    let huRegex = /hu./؛
    humStr.match (huRegex)؛ // Returns ["hum"]
    hugStr.match (huRegex)؛ // Returns ["hug"]
    + +## Instructions +
    أكمل regex unRegex بحيث يتطابق مع السلاسل "run" و "sun" و "fun" و "pun" و "nun" و "bun" . يجب أن يستخدم تعبيرك العادي حرف حرف البدل.
    + +## Tests +
    + +```yml +tests: + - text: يجب عليك استخدام طريقة .test() . + testString: 'assert(code.match(/\.test\(.*\)/), "You should use the .test() method.");' + - text: يجب عليك استخدام حرف البدل في regex unRegex + testString: 'assert(/\./.test(unRegex.source), "You should use the wildcard character in your regex unRegex");' + - text: يجب أن يطابق regex unRegex "run" في "Let us go on a run." + testString: 'assert(unRegex.test("Let us go on a run."), "Your regex unRegex should match "run" in "Let us go on a run."");' + - text: يجب أن يتطابق unRegex regex unRegex مع كلمة "sun" في "The sun is out today." + testString: 'assert(unRegex.test("The sun is out today."), "Your regex unRegex should match "sun" in "The sun is out today."");' + - text: يجب أن يطابق regex unRegex "fun" في "Coding is a lot of fun." + testString: 'assert(unRegex.test("Coding is a lot of fun."), "Your regex unRegex should match "fun" in "Coding is a lot of fun."");' + - text: يجب أن يتطابق "pun" regex unRegex مع "pun" في "Seven days without a pun makes one weak." + testString: 'assert(unRegex.test("Seven days without a pun makes one weak."), "Your regex unRegex should match "pun" in "Seven days without a pun makes one weak."");' + - text: يجب أن يتطابق unRegex regex unRegex مع "nun" في "One takes a vow to be a nun." unRegex "One takes a vow to be a nun." + testString: 'assert(unRegex.test("One takes a vow to be a nun."), "Your regex unRegex should match "nun" in "One takes a vow to be a nun."");' + - text: يجب أن تتطابق مع regex unRegex "bun" في "She got fired from the hot dog stand for putting her hair in a bun." unRegex "She got fired from the hot dog stand for putting her hair in a bun." + testString: 'assert(unRegex.test("She got fired from the hot dog stand for putting her hair in a bun."), "Your regex unRegex should match "bun" in "She got fired from the hot dog stand for putting her hair in a bun."");' + - text: يجب ألا يطابق regex unRegex "There is a bug in my code." + testString: 'assert(!unRegex.test("There is a bug in my code."), "Your regex unRegex should not match "There is a bug in my code."");' + - text: يجب ألا يتطابق التعبير unRegex regex unRegex مع "Catch me if you can." + testString: 'assert(!unRegex.test("Can me if you can."), "Your regex unRegex should not match "Catch me if you can."");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let exampleStr = "Let's have fun with regular expressions!"; +let unRegex = /change/; // Change this line +let result = unRegex.test(exampleStr); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-beginning-string-patterns.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-beginning-string-patterns.arabic.md new file mode 100644 index 0000000000..b5e6fc1960 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-beginning-string-patterns.arabic.md @@ -0,0 +1,57 @@ +--- +id: 587d7db7367417b2b2512b9d +title: Match Beginning String Patterns +challengeType: 1 +videoUrl: '' +localeTitle: مباراة بداية أنماط سلسلة +--- + +## Description +
    أظهرت التحديات السابقة أنه يمكن استخدام التعبيرات العادية للبحث عن عدد من التطابقات. كما يتم استخدامها للبحث عن أنماط في مواضع محددة في السلاسل. في تحدي سابق ، استخدمت caret ( ^ ) داخل مجموعة character set لإنشاء مجموعة negated character set [^thingsThatWillNotBeMatched] في النموذج [^thingsThatWillNotBeMatched] . خارج مجموعة character set ، يتم استخدام caret للبحث عن الأنماط في بداية السلاسل.
    let firstString = "Ricky is first and can be found."؛
    let firstRegex = / ^ Ricky /؛
    firstRegex.test (firstString)؛
    // يعود صحيح
    let notFirst = "لا يمكنك العثور على Ricky الآن."؛
    firstRegex.test (notFirst)؛
    // إرجاع خاطئة
    + +## Instructions +
    استخدم caret في تعبير منطقي للبحث عن "Cal" فقط في بداية السلسلة rickyAndCal .
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يبحث التعبير المعتاد عن "Cal" بحرف كبير. + testString: 'assert(calRegex.source == "^Cal", "Your regex should search for "Cal" with a capital letter.");' + - text: يجب ألا يستخدم تعبيرك المعتاد أي أعلام. + testString: 'assert(calRegex.flags == "", "Your regex should not use any flags.");' + - text: يجب أن يتطابق تعبيرك العادي مع كلمة "Cal" في بداية السلسلة. + testString: 'assert(calRegex.test("Cal and Ricky both like racing."), "Your regex should match "Cal" at the beginning of the string.");' + - text: يجب ألا يتطابق التعبير العادي مع "Cal" في وسط سلسلة. + testString: 'assert(!calRegex.test("Ricky and Cal both like racing."), "Your regex should not match "Cal" in the middle of a string.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let rickyAndCal = "Cal and Ricky both like racing."; +let calRegex = /change/; // Change this line +let result = calRegex.test(rickyAndCal); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-characters-that-occur-one-or-more-times.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-characters-that-occur-one-or-more-times.arabic.md new file mode 100644 index 0000000000..26d3b2ba2e --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-characters-that-occur-one-or-more-times.arabic.md @@ -0,0 +1,55 @@ +--- +id: 587d7db6367417b2b2512b99 +title: Match Characters that Occur One or More Times +challengeType: 1 +videoUrl: '' +localeTitle: مطابقة الأحرف التي تحدث مرة واحدة أو أكثر +--- + +## Description +
    في بعض الأحيان ، تحتاج إلى مطابقة حرف (أو مجموعة من الأحرف) التي تظهر مرة واحدة أو أكثر في صف واحد. هذا يعني أنه يحدث مرة واحدة على الأقل ، ويمكن أن يتكرر. يمكنك استخدام + للتحقق مما إذا كانت هذه هي الحالة. تذكر ، يجب أن تكون الشخصية أو النمط موجودًا على التوالي. بمعنى ، يجب على الحرف تكرار واحد بعد الآخر. على سبيل المثال ، سيعثر /a+/g على تطابق واحد في "abc" وإرجاع ["a"] . نظرًا لوجود + ، سيجد أيضًا تطابقًا واحدًا في "aabc" وإرجاع ["aa"] . لو كانت بدلا التحقق من سلسلة "abab" ، فإنه يجد مباراتين والعودة ["a", "a"] لأن a الأحرف ليست في صف واحد - هناك b بينهما. أخيرًا ، نظرًا لعدم وجود "a" في السلسلة "bcd" ، فلن تجد تطابقًا.
    + +## Instructions +
    تريد البحث عن تطابقات عندما يحدث الحرف s مرة أو أكثر في "Mississippi" . اكتب regex يستخدم علامة + .
    + +## Tests +
    + +```yml +tests: + - text: التعابير المنطقية الخاصة بك myRegex يجب استخدام + إشارة لمباراة واحدة أو أكثر من s حرفا. + testString: 'assert(/\+/.test(myRegex.source), "Your regex myRegex should use the + sign to match one or more s characters.");' + - text: يجب أن يتطابق التعبير العادي مع myRegex مع عنصرين. + testString: 'assert(result.length == 2, "Your regex myRegex should match 2 items.");' + - text: يجب أن يكون متغير result مصفوفة تحتوي على مجموعتين من "ss" + testString: 'assert(result[0] == "ss" && result[1] == "ss", "The result variable should be an array with two matches of "ss"");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let difficultSpelling = "Mississippi"; +let myRegex = /change/; // Change this line +let result = difficultSpelling.match(myRegex); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-characters-that-occur-zero-or-more-times.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-characters-that-occur-zero-or-more-times.arabic.md new file mode 100644 index 0000000000..563a46b48c --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-characters-that-occur-zero-or-more-times.arabic.md @@ -0,0 +1,59 @@ +--- +id: 587d7db6367417b2b2512b9a +title: Match Characters that Occur Zero or More Times +challengeType: 1 +videoUrl: '' +localeTitle: مطابقة الأحرف التي تحدث Zero أو أوقات إضافية +--- + +## Description +
    استخدم التحدي الأخير علامة زائد + للبحث عن الأحرف التي تحدث مرة واحدة أو أكثر. هناك أيضًا خيار يطابق الأحرف التي تحدث صفرًا أو أكثر. الحرف للقيام بذلك هو asterisk أو star : * .
    let soccerWord = "gooooooooal!"؛
    دعونا gPhrase = "الشعور الغريزي" ؛
    دع oPhrase = "فوق القمر" ؛
    اترك goRegex = / go * /؛
    soccerWord.match (goRegex)؛ // Returns ["goooooooo"]
    gPhrase.match (goRegex)؛ // Returns ["g"]
    oPhrase.match (goRegex)؛ // يعود لاغيا
    + +## Instructions +
    إنشاء regex chewieRegex يستخدم الحرف * لتطابق كافة الأحرف "a" العلوي والسفلي في chewieQuote . لا يحتاج تعبيرك العادي إلى علامات ، ولا ينبغي أن يتطابق مع أي من علامات الاقتباس الأخرى.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يستخدم regex chewieRegex * لمطابقة صفر أو أكثر a الأحرف. + testString: 'assert(/\*/.test(chewieRegex.source), "Your regex chewieRegex should use the * character to match zero or more a characters.");' + - text: يجب أن يتطابق التعبير العادي regex chewieRegex مع 16 حرفًا. + testString: 'assert(result[0].length === 16, "Your regex chewieRegex should match 16 characters.");' + - text: يجب أن يتطابق "Aaaaaaaaaaaaaaaa" العادي مع "Aaaaaaaaaaaaaaaa" . + testString: 'assert(result[0] === "Aaaaaaaaaaaaaaaa", "Your regex should match "Aaaaaaaaaaaaaaaa".");' + - text: 'يجب ألا يتطابق تعبيرك المعتاد مع أي أحرف في "He made a fair move. Screaming about it can't help you."' + testString: 'assert(!"He made a fair move. Screaming about it can\"t help you.".match(chewieRegex), "Your regex should not match any characters in "He made a fair move. Screaming about it can't help you."");' + - text: 'يجب ألا يتطابق "Let him have it. It's not wise to upset a Wookiee." المعتاد مع أي أحرف في "Let him have it. It's not wise to upset a Wookiee."' + testString: 'assert(!"Let him have it. It\"s not wise to upset a Wookiee.".match(chewieRegex), "Your regex should not match any characters in "Let him have it. It's not wise to upset a Wookiee."");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let chewieQuote = "Aaaaaaaaaaaaaaaarrrgh!"; +let chewieRegex = /change/; // Change this line +let result = chewieQuote.match(chewieRegex); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-ending-string-patterns.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-ending-string-patterns.arabic.md new file mode 100644 index 0000000000..1bbfb0f58f --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-ending-string-patterns.arabic.md @@ -0,0 +1,55 @@ +--- +id: 587d7db7367417b2b2512b9e +title: Match Ending String Patterns +challengeType: 1 +videoUrl: '' +localeTitle: تطابق نهاية أنماط سلسلة +--- + +## Description +
    في التحدي الأخير ، تعلمت استخدام caret للبحث عن الأنماط في بداية السلاسل. هناك أيضًا طريقة للبحث عن الأنماط في نهاية السلاسل. يمكنك البحث في نهاية السلاسل باستخدام حرف dollar sign $ في نهاية التعليمة regex.
    دع theEnding = "هذه قصة لا تنتهي أبدا"؛
    let storyRegex = / story $ /؛
    storyRegex.test (theEnding)؛
    // يعود صحيح
    let noEnding = "في بعض الأحيان يجب أن تنتهي القصة" ؛
    storyRegex.test (noEnding)؛
    // إرجاع خاطئة
    + +## Instructions +
    استخدم حرف الربط ( $ ) لمطابقة السلسلة "caboose" في نهاية سلسلة caboose .
    + +## Tests +
    + +```yml +tests: + - text: يجب عليك البحث عن "caboose" باستخدام علامة الدولار $ anchor في تعبيرك المعتاد. + testString: 'assert(lastRegex.source == "caboose$", "You should search for "caboose" with the dollar sign $ anchor in your regex.");' + - text: يجب ألا يستخدم تعبيرك المعتاد أي أعلام. + testString: 'assert(lastRegex.flags == "", "Your regex should not use any flags.");' + - text: يجب أن تتطابق مع "caboose" في نهاية السلسلة "The last car on a train is the caboose" + testString: 'assert(lastRegex.test("The last car on a train is the caboose"), "You should match "caboose" at the end of the string "The last car on a train is the caboose"");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let caboose = "The last car on a train is the caboose"; +let lastRegex = /change/; // Change this line +let result = lastRegex.test(caboose); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-everything-but-letters-and-numbers.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-everything-but-letters-and-numbers.arabic.md new file mode 100644 index 0000000000..dd678eff78 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-everything-but-letters-and-numbers.arabic.md @@ -0,0 +1,61 @@ +--- +id: 587d7db8367417b2b2512ba0 +title: Match Everything But Letters and Numbers +challengeType: 1 +videoUrl: '' +localeTitle: تطابق كل شيء لكن الحروف والأرقام +--- + +## Description +
    لقد تعلمت أنه يمكنك استخدام اختصار لمطابقة [A-Za-z0-9_] الأبجدية العددية [A-Za-z0-9_] باستخدام \w . النمط الطبيعي الذي قد ترغب في البحث عنه هو عكس alphanumerics. يمكنك البحث عن عكس \w مع \W لاحظ أن النمط المعاكس يستخدم حرفًا كبيرًا. هذا الاختصار هو نفسه [^A-Za-z0-9_] .
    اترك shortHand = / \ W /؛
    السماح للأرقام = "42 ٪" ؛
    اسمحوا الجملة = "الترميز!" ؛
    numbers.match (اختزال)؛ // عائدات ["٪"]
    sentence.match (اختزال)؛ // عائدات ["!"]
    + +## Instructions +
    استخدم class \W حرف الاختصار لحساب عدد الأحرف غير الأبجدية الرقمية في علامات الاقتباس والسلاسل المختلفة.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يستخدم تعبيرك العادي العلم العام. + testString: 'assert(nonAlphabetRegex.global, "Your regex should use the global flag.");' + - text: يجب أن يعثر تعبيرك المنطقي على 6 أحرف غير أبجدية رقمية في "The five boxing wizards jump quickly." . + testString: 'assert("The five boxing wizards jump quickly.".match(nonAlphabetRegex).length == 6, "Your regex should find 6 non-alphanumeric characters in "The five boxing wizards jump quickly.".");' + - text: يجب أن يستخدم تعبيرك العادي الحرف المختصر. + testString: 'assert(/\\W/.test(nonAlphabetRegex.source), "Your regex should use the shorthand character to match characters which are non-alphanumeric.");' + - text: يجب أن يعثر تعبيرك المنطقي على 8 أحرف غير أبجدية رقمية في "Pack my box with five dozen liquor jugs." + testString: 'assert("Pack my box with five dozen liquor jugs.".match(nonAlphabetRegex).length == 8, "Your regex should find 8 non-alphanumeric characters in "Pack my box with five dozen liquor jugs."");' + - text: يجب أن يعثر تعبيرك المنطقي على 6 أحرف غير أبجدية رقمية في "How vexingly quick daft zebras jump!" + testString: 'assert("How vexingly quick daft zebras jump!".match(nonAlphabetRegex).length == 6, "Your regex should find 6 non-alphanumeric characters in "How vexingly quick daft zebras jump!"");' + - text: يجب أن يعثر "123 456 7890 ABC def GHI jkl MNO pqr STU vwx YZ." على 12 حرفًا غير أبجدي رقمي في "123 456 7890 ABC def GHI jkl MNO pqr STU vwx YZ." + testString: 'assert("123 456 7890 ABC def GHI jkl MNO pqr STU vwx YZ.".match(nonAlphabetRegex).length == 12, "Your regex should find 12 non-alphanumeric characters in "123 456 7890 ABC def GHI jkl MNO pqr STU vwx YZ."");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let quoteSample = "The five boxing wizards jump quickly."; +let nonAlphabetRegex = /change/; // Change this line +let result = quoteSample.match(nonAlphabetRegex).length; + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-letters-of-the-alphabet.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-letters-of-the-alphabet.arabic.md new file mode 100644 index 0000000000..e6864e4e45 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-letters-of-the-alphabet.arabic.md @@ -0,0 +1,55 @@ +--- +id: 587d7db5367417b2b2512b96 +title: Match Letters of the Alphabet +challengeType: 1 +videoUrl: '' +localeTitle: تطابق حروف الأبجدية +--- + +## Description +
    لقد رأيت كيف يمكنك استخدام character sets لتحديد مجموعة من الأحرف لمطابقة ، ولكن هذا كثير من الكتابة عندما تحتاج إلى مطابقة مجموعة كبيرة من الأحرف (على سبيل المثال ، كل حرف في الأبجدية). لحسن الحظ ، هناك ميزة مضمنة تجعل هذا قصيرة وبسيطة. داخل مجموعة character set ، يمكنك تحديد نطاق من الأحرف لمطابقة أحرف hyphen : - . على سبيل المثال ، لمطابقة الأحرف الصغيرة a خلال e قد تستخدم [ae] .
    دع catStr = "قطة" ؛
    السماح batStr = "الخفافيش" ؛
    السماح matStr = "حصيرة" ؛
    let bgRegex = / [ae] at /؛
    catStr.match (bgRegex)؛ // Returns ["cat"]
    batStr.match (bgRegex)؛ // Returns ["bat"]
    matStr.match (bgRegex)؛ // يعود لاغيا
    + +## Instructions +
    تطابق جميع الحروف في سلسلة quoteSample . ملحوظة
    تأكد من مطابقة الأحرف الكبيرة والصغيرة .
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يتطابق معجمك alphabetRegex مع 35 عنصرًا. + testString: 'assert(result.length == 35, "Your regex alphabetRegex should match 35 items.");' + - text: يجب أن يستخدم alphabetRegex reggex alphabetRegex العلم العام. + testString: 'assert(alphabetRegex.flags.match(/g/).length == 1, "Your regex alphabetRegex should use the global flag.");' + - text: التعابير المنطقية الخاصة بك alphabetRegex يجب استخدام حالة العلم حساسة. + testString: 'assert(alphabetRegex.flags.match(/i/).length == 1, "Your regex alphabetRegex should use the case insensitive flag.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let quoteSample = "The quick brown fox jumps over the lazy dog."; +let alphabetRegex = /change/; // Change this line +let result = alphabetRegex; // Change this line + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-literal-strings.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-literal-strings.arabic.md new file mode 100644 index 0000000000..8a16ae61fe --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-literal-strings.arabic.md @@ -0,0 +1,55 @@ +--- +id: 587d7db3367417b2b2512b8f +title: Match Literal Strings +challengeType: 1 +videoUrl: '' +localeTitle: المباراة الحرفيه الاوتار +--- + +## Description +
    في التحدي الأخير ، قمت بالبحث عن كلمة "Hello" باستخدام التعبير العادي /Hello/ . بحث هذا التعبير المنطقي عن تطابق حرفي لسلسلة "Hello" . إليك مثال آخر يبحث عن مطابقة حرفية لسلسلة "Kevin" :
    let testStr = "مرحبًا ، اسمي كيفن."؛
    let testRegex = / Kevin /؛
    testRegex.test (testStr)؛
    // يعود صحيح
    أي أشكال أخرى من "Kevin" لن تتطابق. على سبيل المثال ، لن يتطابق regex /Kevin/ مع "kevin" أو "KEVIN" .
    let wrongRegex = / kevin /؛
    wrongRegex.test (testStr)؛
    // إرجاع خاطئة
    سيظهر تحدٍّ مستقبلي كيفية مضاهاة هذه الأشكال الأخرى أيضًا.
    + +## Instructions +
    أكمل waldoRegex regex للعثور على "Waldo" في السلسلة waldoIsHiding مع مطابقة حرفية.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يجد waldoRegex regex الخاص بك "Waldo" + testString: 'assert(waldoRegex.test(waldoIsHiding), "Your regex waldoRegex should find "Waldo"");' + - text: يجب ألا يبحث regex waldoRegex عن أي شيء آخر. + testString: 'assert(!waldoRegex.test("Somewhere is hiding in this text."), "Your regex waldoRegex should not search for anything else.");' + - text: يجب إجراء مطابقة سلسلة حرفية مع تعبيرك المعتاد. + testString: 'assert(!/\/.*\/i/.test(code), "You should perform a literal string match with your regex.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let waldoIsHiding = "Somewhere Waldo is hiding in this text."; +let waldoRegex = /search/; // Change this line +let result = waldoRegex.test(waldoIsHiding); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-non-whitespace-characters.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-non-whitespace-characters.arabic.md new file mode 100644 index 0000000000..51451b3288 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-non-whitespace-characters.arabic.md @@ -0,0 +1,59 @@ +--- +id: 587d7db9367417b2b2512ba4 +title: Match Non-Whitespace Characters +challengeType: 1 +videoUrl: '' +localeTitle: تطابق أحرف غير بيضاء +--- + +## Description +
    لقد تعلمت عن البحث عن المسافات البيضاء باستخدام \s ، باستخدام s صغير. يمكنك أيضًا البحث عن كل شيء ما عدا المسافة البيضاء. البحث عن غير بيضاء، يستخدم \S ، وهي الأحرف الكبيرة s . لن يطابق هذا النمط المسافات البيضاء ، والعودة إلى السطر ، وعلامة التبويب ، وتغذية النموذج ، وأحرف الخطوط الجديدة. يمكنك التفكير في كونه مشابهًا لفئة الأحرف [^ \r\t\f\n\v] .
    let whiteSpace = "Whitespace. Whitespace everywhere!"
    اترك nonSpaceRegex = / \ S / g؛
    whiteSpace.match (nonSpaceRegex) مدة العرض. // إرجاع 32
    + +## Instructions +
    غيّر countNonWhiteSpace regex للبحث عن أحرف non-whitespace متعددة في سلسلة.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يستخدم تعبيرك العادي العلم العام. + testString: 'assert(countNonWhiteSpace.global, "Your regex should use the global flag.");' + - text: يجب أن يستخدم تعبيرك العادي الحرف المختصر + testString: 'assert(/\\S/.test(countNonWhiteSpace.source), "Your regex should use the shorthand character \S/code> to match all non-whitespace characters.");' + - text: يجب أن يعثر تعبيرك المعتاد على 35 حالة غير مسافات في "Men are from Mars and women are from Venus." + testString: 'assert("Men are from Mars and women are from Venus.".match(countNonWhiteSpace).length == 35, "Your regex should find 35 non-spaces in "Men are from Mars and women are from Venus."");' + - text: 'يجب أن يعثر تعبيرك المعتاد على 23 منطقة غير مسافات في "Space: the final frontier."' + testString: 'assert("Space: the final frontier.".match(countNonWhiteSpace).length == 23, "Your regex should find 23 non-spaces in "Space: the final frontier."");' + - text: يجب أن يعثر "MindYourPersonalSpace" على 21 "MindYourPersonalSpace" غير مسافات في "MindYourPersonalSpace" + testString: 'assert("MindYourPersonalSpace".match(countNonWhiteSpace).length == 21, "Your regex should find 21 non-spaces in "MindYourPersonalSpace"");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let sample = "Whitespace is important in separating words"; +let countNonWhiteSpace = /change/; // Change this line +let result = sample.match(countNonWhiteSpace); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-numbers-and-letters-of-the-alphabet.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-numbers-and-letters-of-the-alphabet.arabic.md new file mode 100644 index 0000000000..4b0c072c47 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-numbers-and-letters-of-the-alphabet.arabic.md @@ -0,0 +1,55 @@ +--- +id: 587d7db5367417b2b2512b97 +title: Match Numbers and Letters of the Alphabet +challengeType: 1 +videoUrl: '' +localeTitle: أرقام المباراة ورسائل الأبجدية +--- + +## Description +
    لا يقتصر استخدام الواصلة ( - ) لمطابقة نطاق من الأحرف على الأحرف. كما يعمل على مطابقة مجموعة من الأرقام. على سبيل المثال ، /[0-5]/ تطابق أي رقم بين 0 و 5 ، بما في ذلك 0 و 5 . أيضا ، من الممكن الجمع بين مجموعة من الحروف والأرقام في مجموعة أحرف واحدة.
    let jennyStr = "Jenny8675309"؛
    let myRegex = / [a-z0-9] / ig؛
    // تطابق جميع الحروف والأرقام في jennyStr
    jennyStr.match (myRegex)؛
    + +## Instructions +
    أنشئ تعبيرًا واحدًا يتطابق مع نطاق من الأحرف بين h و s ومجموعة من الأرقام بين 2 و 6 . تذكر تضمين الأعلام المناسبة في التعابير المنطقية.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يتطابق myRegex مع 17 عنصرًا. + testString: 'assert(result.length == 17, "Your regex myRegex should match 17 items.");' + - text: يجب أن يستخدم myRegex regex العلامة العامة. + testString: 'assert(myRegex.flags.match(/g/).length == 1, "Your regex myRegex should use the global flag.");' + - text: يجب أن يستخدم myRegex regex myRegex حالة الأحرف. + testString: 'assert(myRegex.flags.match(/i/).length == 1, "Your regex myRegex should use the case insensitive flag.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let quoteSample = "Blueberry 3.141592653s are delicious."; +let myRegex = /change/; // Change this line +let result = myRegex; // Change this line + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-single-character-with-multiple-possibilities.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-single-character-with-multiple-possibilities.arabic.md new file mode 100644 index 0000000000..0fd213d3e3 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-single-character-with-multiple-possibilities.arabic.md @@ -0,0 +1,59 @@ +--- +id: 587d7db5367417b2b2512b95 +title: Match Single Character with Multiple Possibilities +challengeType: 1 +videoUrl: '' +localeTitle: تطابق شخصية واحدة مع إمكانيات متعددة +--- + +## Description +
    تعلمت كيف تتطابق مع الأنماط الحرفية ( /literal/ ) وحرف البدل ( /./ ). هذه هي الحدود القصوى للتعبيرات العادية ، حيث يجد المرء مباريات متطابقة ويطابق الآخر كل شيء. هناك خيارات توازن بين النقيضين. يمكنك البحث عن نمط حرفية مع بعض المرونة مع character classes . تتيح لك فئات الأحرف تعريف مجموعة من الأحرف التي ترغب في مطابقتها بوضعها داخل أقواس مربعة ( [ و ] ). على سبيل المثال ، تريد مطابقة "bag" و "big" و "bug" وليس "bog" . يمكنك إنشاء regex /b[aiu]g/ للقيام بذلك. إن [aiu] هو فئة الشخصية التي تتطابق فقط مع الأحرف "a" أو "i" أو "u" .
    let bigStr = "big"؛
    اسمحوا bagStr = "حقيبة" ؛
    let bugStr = "bug"؛
    let bogStr = "bog"؛
    let bgRegex = / b [aiu] g /؛
    bigStr.match (bgRegex)؛ // Returns ["big"]
    bagStr.match (bgRegex)؛ // Returns ["bag"]
    bugStr.match (bgRegex)؛ // Returns ["bug"]
    bogStr.match (bgRegex)؛ // يعود لاغيا
    + +## Instructions +
    استخدم فئة أحرف مع أحرف العلة ( a ، e ، i ، o ، u ) في your regex vowelRegex للعثور على جميع حروف العلة في سلسلة quoteSample . ملحوظة
    تأكد من مطابقة حروف العلة العلوية والصغيرة.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن تجد كل الحروف المتحركة 25. + testString: 'assert(result.length == 25, "You should find all 25 vowels.");' + - text: يجب أن يستخدم regex vowelRegex فئة شخصية. + testString: 'assert(/\[.*\]/.test(vowelRegex.source), "Your regex vowelRegex should use a character class.");' + - text: يجب أن يستخدم regex vowelRegex العلم العام. + testString: 'assert(vowelRegex.flags.match(/g/).length == 1, "Your regex vowelRegex should use the global flag.");' + - text: يجب أن يستخدم vowelRegex regex vowelRegex علم حالة الأحرف. + testString: 'assert(vowelRegex.flags.match(/i/).length == 1, "Your regex vowelRegex should use the case insensitive flag.");' + - text: يجب ألا يطابق تعبيرك المعتاد أي أحرف ساكنة. + testString: 'assert(!/[b-df-hj-np-tv-z]/gi.test(result.join()), "Your regex should not match any consonants.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let quoteSample = "Beware of bugs in the above code; I have only proved it correct, not tried it."; +let vowelRegex = /change/; // Change this line +let result = vowelRegex; // Change this line + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-single-characters-not-specified.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-single-characters-not-specified.arabic.md new file mode 100644 index 0000000000..9029119ad6 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-single-characters-not-specified.arabic.md @@ -0,0 +1,55 @@ +--- +id: 587d7db6367417b2b2512b98 +title: Match Single Characters Not Specified +challengeType: 1 +videoUrl: '' +localeTitle: مطابقة أحرف مفردة غير محددة +--- + +## Description +
    حتى الآن ، قمت بإنشاء مجموعة من الأحرف التي تريد مطابقتها ، ولكن يمكنك أيضًا إنشاء مجموعة من الأحرف التي لا تريد مطابقتها. تسمى هذه الأنواع من مجموعات negated character sets . لإنشاء مجموعة negated character set ، تضع caret ( ^ ) بعد قوس الفتح وقبل الأحرف التي لا تريد مطابقتها. على سبيل المثال ، يطابق /[^aeiou]/gi كافة الأحرف التي ليست حرف علة. لاحظ أن أحرف مثل . ! تتم مطابقة ، [ ، @ ، / وفضاء أبيض] - تستبعد مجموعة أحرف العلة المنسوخة أحرف الأحرف المتحركة فقط.
    + +## Instructions +
    قم بإنشاء تعبير عادي واحد يتطابق مع كل الحروف التي ليست رقمًا أو حرفًا متحركًا. تذكر تضمين الأعلام المناسبة في التعابير المنطقية.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يتطابق myRegex مع 9 عناصر. + testString: 'assert(result.length == 9, "Your regex myRegex should match 9 items.");' + - text: يجب أن يستخدم myRegex regex العلامة العامة. + testString: 'assert(myRegex.flags.match(/g/).length == 1, "Your regex myRegex should use the global flag.");' + - text: يجب أن يستخدم myRegex regex myRegex حالة الأحرف. + testString: 'assert(myRegex.flags.match(/i/).length == 1, "Your regex myRegex should use the case insensitive flag.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let quoteSample = "3 blind mice."; +let myRegex = /change/; // Change this line +let result = myRegex; // Change this line + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-whitespace.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-whitespace.arabic.md new file mode 100644 index 0000000000..1c53f6d9f4 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/match-whitespace.arabic.md @@ -0,0 +1,59 @@ +--- +id: 587d7db8367417b2b2512ba3 +title: Match Whitespace +challengeType: 1 +videoUrl: '' +localeTitle: تطابق الفراغ +--- + +## Description +
    غطت التحديات حتى الآن الحروف المطابقة للأبجدية والأرقام. يمكنك أيضًا مطابقة المسافة البيضاء أو المسافات بين الأحرف. يمكنك البحث عن المسافات باستخدام \s ، وهي صغيرة s . لا يطابق هذا النمط المسافة البيضاء فحسب ، بل يطابق أيضًا أحرف الإرجاع ، وعلامة التبويب ، وتغذية النموذج ، وأحرف الخطوط الجديدة. يمكنك اعتباره مشابهًا لفئة الأحرف [ \r\t\f\n\v] .
    let whiteSpace = "Whitespace. Whitespace everywhere!"
    اترك spaceRegex = / \ s / g؛
    whiteSpace.match (spaceRegex)؛
    // عائدات [" "، " "]
    + +## Instructions +
    غيّر countWhiteSpace regex للبحث عن أحرف بيضاء متعددة في سلسلة.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يستخدم تعبيرك العادي العلم العام. + testString: 'assert(countWhiteSpace.global, "Your regex should use the global flag.");' + - text: يجب أن يستخدم تعبيرك العادي الحرف المختصر + testString: 'assert(/\\s/.test(countWhiteSpace.source), "Your regex should use the shorthand character \s to match all whitespace characters.");' + - text: يجب أن يعثر تعبيرك المعتاد على ثماني مساحات في "Men are from Mars and women are from Venus." + testString: 'assert("Men are from Mars and women are from Venus.".match(countWhiteSpace).length == 8, "Your regex should find eight spaces in "Men are from Mars and women are from Venus."");' + - text: 'يجب أن يعثر تعبيرك المعتاد على ثلاث مسافات في "Space: the final frontier."' + testString: 'assert("Space: the final frontier.".match(countWhiteSpace).length == 3, "Your regex should find three spaces in "Space: the final frontier."");' + - text: يجب ألا يجد "MindYourPersonalSpace" أي مسافات في "MindYourPersonalSpace" + testString: 'assert("MindYourPersonalSpace".match(countWhiteSpace) == null, "Your regex should find no spaces in "MindYourPersonalSpace"");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let sample = "Whitespace is important in separating words"; +let countWhiteSpace = /change/; // Change this line +let result = sample.match(countWhiteSpace); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/positive-and-negative-lookahead.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/positive-and-negative-lookahead.arabic.md new file mode 100644 index 0000000000..70ba422ea4 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/positive-and-negative-lookahead.arabic.md @@ -0,0 +1,65 @@ +--- +id: 587d7dba367417b2b2512ba9 +title: Positive and Negative Lookahead +challengeType: 1 +videoUrl: '' +localeTitle: الإيجابية و السلبية Lookahead +--- + +## Description +
    Lookaheads هي الأنماط التي تخبر جافا سكريبت أن ننظر إلى الأمام في السلسلة الخاصة بك للتحقق من وجود أنماط أخرى على طول. يمكن أن يكون ذلك مفيدًا عندما تريد البحث عن أنماط متعددة عبر نفس السلسلة. هناك نوعان من lookaheads : positive lookahead و negative lookahead . سوف ننظر positive lookahead للتأكد من وجود عنصر في نمط البحث ، ولكن لن تتطابق في الواقع. يتم استخدام lookahead إيجابية كما (?=...) حيث ... هو الجزء المطلوب غير متطابق. من ناحية أخرى ، سوف ننظر negative lookahead للتأكد من عدم وجود عنصر في نمط البحث. يتم استخدام lookahead سلبي كما (?!...) حيث ... هو النمط الذي لا تريد أن تكون هناك. يتم إرجاع بقية النمط إذا كان جزء lookahead السلبي غير موجود. Lookaheads مربكة بعض الشيء ولكن بعض الأمثلة سوف تساعد.
    ترك quit = "qu"؛
    let noquit = "qt"؛
    let quRegex = / q (؟ = u) /؛
    اترك qRegex = / q (؟! u) /؛
    quit.match (quRegex)؛ // Returns ["q"]
    noquit.match (qRegex)؛ // Returns ["q"]
    استخدام أكثر عملية من lookaheads هو التحقق من اثنين أو أكثر من الأنماط في سلسلة واحدة. هنا مدقق كلمات مرور بسيط (بسذاجة) يبحث عن 3 إلى 6 أحرف ورقم واحد على الأقل:
    السماح بكلمة المرور = "abc123" ؛
    let checkPass = / (؟ = \ w {3،6}) (؟ = \ D * \ d) /؛
    checkPass.test (كلمة السر)؛ // يعود صحيح
    + +## Instructions +
    استخدم lookaheads في pwRegex لمطابقة كلمات المرور التي يزيد طولها عن 5 أحرف ولها رقمين متتاليين.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يستخدم lookaheads إيجابية. + testString: 'assert(pwRegex.source.match(/\(\?=.*?\)\(\?=.*?\)/) !== null, "Your regex should use two positive lookaheads.");' + - text: يجب ألا يتطابق تعبيرك العادي مع "astronaut" + testString: 'assert(!pwRegex.test("astronaut"), "Your regex should not match "astronaut"");' + - text: يجب ألا يتطابق تعبيرك العادي مع "airplanes" + testString: 'assert(!pwRegex.test("airplanes"), "Your regex should not match "airplanes"");' + - text: يجب ألا يتطابق التعبير العادي مع "banan1" + testString: 'assert(!pwRegex.test("banan1"), "Your regex should not match "banan1"");' + - text: يجب أن يتطابق "bana12" العادي مع "bana12" + testString: 'assert(pwRegex.test("bana12"), "Your regex should match "bana12"");' + - text: يجب أن يتطابق التعبير العادي مع "abc123" + testString: 'assert(pwRegex.test("abc123"), "Your regex should match "abc123"");' + - text: يجب ألا يتطابق التعبير العادي مع "123" + testString: 'assert(!pwRegex.test("123"), "Your regex should not match "123"");' + - text: يجب ألا يتطابق التعبير العادي مع "1234" + testString: 'assert(!pwRegex.test("1234"), "Your regex should not match "1234"");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let sampleWord = "astronaut"; +let pwRegex = /change/; // Change this line +let result = pwRegex.test(sampleWord); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/remove-whitespace-from-start-and-end.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/remove-whitespace-from-start-and-end.arabic.md new file mode 100644 index 0000000000..7e6930ef60 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/remove-whitespace-from-start-and-end.arabic.md @@ -0,0 +1,55 @@ +--- +id: 587d7dbb367417b2b2512bac +title: Remove Whitespace from Start and End +challengeType: 1 +videoUrl: '' +localeTitle: إزالة Whitespace من البداية والنهاية +--- + +## Description +
    في بعض الأحيان لا تكون الأحرف البيضاء حول السلاسل مطلوبة ولكن هناك. المعالجة النموذجية للسلاسل هي إزالة المسافة البيضاء في بداية ونهاية.
    + +## Instructions +
    اكتب regex واستخدم أساليب السلسلة المناسبة لإزالة المسافات البيضاء في بداية ونهاية السلاسل. ملحوظة
    .trim() طريقة .trim() هنا ، ولكن ستحتاج إلى إكمال هذا التحدي باستخدام التعبيرات العادية.
    + +## Tests +
    + +```yml +tests: + - text: 'يجب أن تساوي result "Hello, World!"' + testString: 'assert(result == "Hello, World!", "result should equal to "Hello, World!"");' + - text: يجب عدم استخدام طريقة .trim() . + testString: 'assert(!code.match(/\.trim\(.*?\)/), "You should not use the .trim() method.");' + - text: لا ينبغي تعيين متغير result مساو لسلسلة. + testString: 'assert(!code.match(/result\s*=\s*".*?"/), "The result variable should not be set equal to a string.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let hello = " Hello, World! "; +let wsRegex = /change/; // Change this line +let result = hello; // Change this line + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/restrict-possible-usernames.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/restrict-possible-usernames.arabic.md new file mode 100644 index 0000000000..a4be4058b2 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/restrict-possible-usernames.arabic.md @@ -0,0 +1,61 @@ +--- +id: 587d7db8367417b2b2512ba2 +title: Restrict Possible Usernames +challengeType: 1 +videoUrl: '' +localeTitle: تقييد أسماء المستخدمين المحتملين +--- + +## Description +
    يتم استخدام أسماء المستخدمين في كل مكان على الإنترنت. فهي تمنح المستخدمين هوية فريدة على مواقعهم المفضلة. تحتاج إلى التحقق من جميع أسماء المستخدمين في قاعدة بيانات. فيما يلي بعض القواعد البسيطة التي يجب على المستخدمين اتباعها عند إنشاء اسم المستخدم الخاص بهم. 1) يجب أن تكون الأرقام الوحيدة في اسم المستخدم في النهاية. يمكن أن يكون هناك صفر أو أكثر منهم في النهاية. 2) يمكن أن تكون أحرف اسم المستخدم صغيرة وأخرى كبيرة. 3) يجب أن تتكون أسماء المستخدمين من حرفين على الأقل. يمكن لاسم المستخدم المكون من حرفين فقط استخدام أحرف الحروف الأبجدية.
    + +## Instructions +
    غيّر userCheck لتتوافق مع القيود المدرجة أعلاه.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يتطابق JACK العادي مع JACK + testString: 'assert(userCheck.test("JACK"), "Your regex should match JACK");' + - text: يجب ألا يتطابق تعبيرك العادي مع J + testString: 'assert(!userCheck.test("J"), "Your regex should not match J");' + - text: يجب أن يتطابق Oceans11 العادي مع Oceans11 + testString: 'assert(userCheck.test("Oceans11"), "Your regex should match Oceans11");' + - text: يجب أن يتطابق RegexGuru العادي مع RegexGuru + testString: 'assert(userCheck.test("RegexGuru"), "Your regex should match RegexGuru");' + - text: يجب ألا يتطابق تعبيرك العادي مع 007 + testString: 'assert(!userCheck.test("007"), "Your regex should not match 007");' + - text: يجب ألا يتطابق تعبيرك العادي مع 9 + testString: 'assert(!userCheck.test("9"), "Your regex should not match 9");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let username = "JackOfAllTrades"; +let userCheck = /change/; // Change this line +let result = userCheck.test(username); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/reuse-patterns-using-capture-groups.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/reuse-patterns-using-capture-groups.arabic.md new file mode 100644 index 0000000000..45be0a3b6b --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/reuse-patterns-using-capture-groups.arabic.md @@ -0,0 +1,69 @@ +--- +id: 587d7dbb367417b2b2512baa +title: Reuse Patterns Using Capture Groups +challengeType: 1 +videoUrl: '' +localeTitle: إعادة استخدام الأنماط باستخدام مجموعات الالتقاط +--- + +## Description +
    ستحدث بعض الأنماط التي تبحث عنها عدة مرات في سلسلة. من المبدد أن نكرر هذا التعبير المعتاد يدويًا. توجد طريقة أفضل لتحديد عندما يكون لديك سلاسل فرعية متعددة مكررة في السلسلة الخاصة بك. يمكنك البحث عن سلاسل فرعية مكررة باستخدام capture groups . يتم استخدام الأقواس ، ( و ) ، للعثور على أجزاء فرعية متكررة. يمكنك وضع تعبير النمط الذي سيتكرر بين الأقواس. لتحديد مكان ظهور سلسلة التكرار ، استخدم خط مائل عكسي ( \ ) ثم رقمًا. يبدأ هذا الرقم من 1 ويزيد مع كل مجموعة التقاط إضافية تستخدمها. على سبيل المثال سيكون \1 لمطابقة المجموعة الأولى. يتطابق المثال أدناه مع أي كلمة تحدث مرتين مفصولة بمسافة:
    let repeatStr = "regex regex"؛
    اترك repeatRegex = / (\ w +) \ s \ 1 /؛
    repeatRegex.test (repeatStr)؛ // يعود صحيح
    repeatStr.match (repeatRegex)؛ // Returns ["regex regex"، "regex"]
    باستخدام أسلوب .match() على سلسلة سيعود مصفوفة مع السلسلة يطابق ، جنبا إلى جنب مع مجموعة الالتقاط الخاصة به.
    + +## Instructions +
    استخدم capture groups في reRegex لمطابقة الأرقام التي يتم تكرارها ثلاث مرات فقط في سلسلة ، كل منها مفصولة بمسافة.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يستخدم تعبيرك المنطقي فئة الأحرف المختصرة للأرقام. + testString: 'assert(reRegex.source.match(/\\d/), "Your regex should use the shorthand character class for digits.");' + - text: يجب أن يعيد التعبير المعتاد مجموعة الالتقاط مرتين. + testString: 'assert(reRegex.source.match(/\\\d/g).length === 2, "Your regex should reuse the capture group twice.");' + - text: يجب أن يكون للتعبير العادي منطقتين تفصلان الأرقام الثلاثة. + testString: 'assert(reRegex.source.match(/\\s/g).length === 2, "Your regex should have two spaces separating the three numbers.");' + - text: يجب أن يتطابق تعبيرك العادي مع "42 42 42" . + testString: 'assert(reRegex.test("42 42 42"), "Your regex should match "42 42 42".");' + - text: يجب أن يتطابق تعبيرك العادي مع "100 100 100" . + testString: 'assert(reRegex.test("100 100 100"), "Your regex should match "100 100 100".");' + - text: يجب ألا يتطابق تعبيرك العادي مع "42 42 42 42" . + testString: 'assert.equal(("42 42 42 42").match(reRegex.source), null, "Your regex should not match "42 42 42 42".");' + - text: يجب ألا يتطابق تعبيرك العادي مع "42 42" . + testString: 'assert.equal(("42 42").match(reRegex.source), null, "Your regex should not match "42 42".");' + - text: يجب ألا يتطابق تعبيرك العادي مع "101 102 103" . + testString: 'assert(!reRegex.test("101 102 103"), "Your regex should not match "101 102 103".");' + - text: يجب ألا يتطابق تعبيرك العادي مع "1 2 3" . + testString: 'assert(!reRegex.test("1 2 3"), "Your regex should not match "1 2 3".");' + - text: يجب أن يتطابق تعبيرك العادي مع "10 10 10" . + testString: 'assert(reRegex.test("10 10 10"), "Your regex should match "10 10 10".");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let repeatNum = "42 42 42"; +let reRegex = /change/; // Change this line +let result = reRegex.test(repeatNum); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/specify-exact-number-of-matches.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/specify-exact-number-of-matches.arabic.md new file mode 100644 index 0000000000..c7355ec4a5 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/specify-exact-number-of-matches.arabic.md @@ -0,0 +1,61 @@ +--- +id: 587d7db9367417b2b2512ba7 +title: Specify Exact Number of Matches +challengeType: 1 +videoUrl: '' +localeTitle: تحديد العدد الدقيق للمباريات +--- + +## Description +
    يمكنك تحديد العدد السفلي والأعلى من الأنماط مع quantity specifiers باستخدام الأقواس المتعرجة. في بعض الأحيان ، لا تريد سوى عدد محدد من التطابقات. لتحديد عدد معين من الأنماط ، يكون هذا الرقم واحدًا فقط بين الأقواس المتعرجة. على سبيل المثال، لمطابقة فقط كلمة "hah" مع الرسالة a 3 مرات، من شأنه أن التعابير المنطقية الخاص بك سيكون /ha{3}h/ .
    اترك A4 = "haaaah"؛
    دع A3 = "haaah" ؛
    اترك A100 = "h" + "a" .repeat (100) + "h"؛
    السماح لـ multipleHA = / ha {3} h /؛
    multipleHA.test (A4)؛ // إرجاع خاطئة
    multipleHA.test (A3)؛ // يعود صحيح
    multipleHA.test (A100)؛ // إرجاع خاطئة
    + +## Instructions +
    قم بتغيير timRegex regex regex timRegex مع الكلمة "Timber" فقط عندما يكون لها أربعة أحرف m .
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يستخدم تعبيرك المعتاد الأقواس المتعرجة. + testString: 'assert(timRegex.source.match(/{.*?}/).length > 0, "Your regex should use curly brackets.");' + - text: يجب ألا يتطابق تعبيرك العادي مع "Timber" + testString: 'assert(!timRegex.test("Timber"), "Your regex should not match "Timber"");' + - text: يجب ألا يتطابق "Timmber" العادي مع "Timmber" + testString: 'assert(!timRegex.test("Timmber"), "Your regex should not match "Timmber"");' + - text: يجب ألا يتطابق "Timmmber" العادي مع "Timmmber" + testString: 'assert(!timRegex.test("Timmmber"), "Your regex should not match "Timmmber"");' + - text: يجب أن يتطابق "Timmmmber" العادي مع "Timmmmber" + testString: 'assert(timRegex.test("Timmmmber"), "Your regex should match "Timmmmber"");' + - text: يجب ألا يتطابق التعبير العادي مع "Timber" مع 30 m في الصورة. + testString: 'assert(!timRegex.test("Ti" + "m".repeat(30) + "ber"), "Your regex should not match "Timber" with 30 m\"s in it.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let timStr = "Timmmmber"; +let timRegex = /change/; // Change this line +let result = timRegex.test(timStr); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/specify-only-the-lower-number-of-matches.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/specify-only-the-lower-number-of-matches.arabic.md new file mode 100644 index 0000000000..bae80652a8 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/specify-only-the-lower-number-of-matches.arabic.md @@ -0,0 +1,63 @@ +--- +id: 587d7db9367417b2b2512ba6 +title: Specify Only the Lower Number of Matches +challengeType: 1 +videoUrl: '' +localeTitle: تحديد عدد أقل من المطابقات فقط +--- + +## Description +
    يمكنك تحديد العدد السفلي والأعلى من الأنماط مع quantity specifiers باستخدام الأقواس المتعرجة. في بعض الأحيان ، تحتاج فقط إلى تحديد عدد أقل من الأنماط بدون حد أعلى. لتحديد عدد أقل من الأنماط فقط ، احتفظ بالرقم الأول متبوعًا بفاصلة. على سبيل المثال، لمطابقة فقط سلسلة "hah" مع الرسالة a تظهر ما لا يقل عن 3 مرات، من شأنه أن التعابير المنطقية الخاص بك سيكون /ha{3,}h/ .
    اترك A4 = "haaaah"؛
    دع A2 = "haah" ؛
    اترك A100 = "h" + "a" .repeat (100) + "h"؛
    السماح لـ multipleA = / ha {3،} h /؛
    multipleA.test (A4)؛ // يعود صحيح
    multipleA.test (A2)؛ // إرجاع خاطئة
    multipleA.test (A100)؛ // يعود صحيح
    + +## Instructions +
    تغيير التعبير المعتاد haRegex لتتناسب مع كلمة "Hazzah" فقط عندما يكون لديه أربعة أو أكثر من بريد إلكتروني z الصورة.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يستخدم تعبيرك المعتاد الأقواس المتعرجة. + testString: 'assert(haRegex.source.match(/{.*?}/).length > 0, "Your regex should use curly brackets.");' + - text: يجب ألا يتطابق "Hazzah" العادي مع "Hazzah" + testString: 'assert(!haRegex.test("Hazzah"), "Your regex should not match "Hazzah"");' + - text: يجب ألا يتطابق "Hazzzah" العادي مع "Hazzzah" + testString: 'assert(!haRegex.test("Hazzzah"), "Your regex should not match "Hazzzah"");' + - text: يجب أن يتطابق "Hazzzzah" العادي مع "Hazzzzah" + testString: 'assert(haRegex.test("Hazzzzah"), "Your regex should match "Hazzzzah"");' + - text: يجب أن يتطابق "Hazzzzzah" العادي مع "Hazzzzzah" + testString: 'assert(haRegex.test("Hazzzzzah"), "Your regex should match "Hazzzzzah"");' + - text: يجب أن يتطابق "Hazzzzzzah" العادي مع "Hazzzzzzah" + testString: 'assert(haRegex.test("Hazzzzzzah"), "Your regex should match "Hazzzzzzah"");' + - text: يجب أن يتطابق التعبير العادي مع "Hazzah" مع 30 z \ in. + testString: 'assert(haRegex.test("Ha" + "z".repeat(30) + "ah"), "Your regex should match "Hazzah" with 30 z\"s in it.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let haStr = "Hazzzzah"; +let haRegex = /change/; // Change this line +let result = haRegex.test(haStr); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/specify-upper-and-lower-number-of-matches.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/specify-upper-and-lower-number-of-matches.arabic.md new file mode 100644 index 0000000000..c940b3c447 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/specify-upper-and-lower-number-of-matches.arabic.md @@ -0,0 +1,63 @@ +--- +id: 587d7db9367417b2b2512ba5 +title: Specify Upper and Lower Number of Matches +challengeType: 1 +videoUrl: '' +localeTitle: تحديد العلوي والسفلي عدد من المباريات +--- + +## Description +
    أذكر أنك تستخدم علامة الجمع + للبحث عن حرف واحد أو أكثر والعلامة النجمية * للبحث عن صفر أو أكثر من الأحرف. هذه هي مريحة ولكن في بعض الأحيان تريد أن تتطابق مع مجموعة معينة من الأنماط. يمكنك تحديد العدد السفلي والعلوي من الأنماط مع quantity specifiers . يتم استخدام محددات الكمية مع الأقواس المتعرجة ( { و } ). يمكنك وضع رقمين بين الأقواس المتعرجة - للعدد السفلي والأعلى من الأنماط. على سبيل المثال، لمطابقة فقط الرسالة a التي تظهر بين 3 و 5 مرات في سلسلة "ah" ، رجإكس الخاص سيكون /a{3,5}h/ .
    اترك A4 = "aaaah" ؛
    دع A2 = "aah" ؛
    السماح لـ multipleA = / a {3،5} h /؛
    multipleA.test (A4)؛ // يعود صحيح
    multipleA.test (A2)؛ // إرجاع خاطئة
    + +## Instructions +
    تغيير التعبير المعتاد ohRegex لمباراة فقط 3 إلى 6 إلكتروني h الصورة في كلمة "Oh no" .
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يستخدم تعبيرك المعتاد الأقواس المتعرجة. + testString: 'assert(ohRegex.source.match(/{.*?}/).length > 0, "Your regex should use curly brackets.");' + - text: يجب ألا يتطابق "Ohh no" العادي مع "Ohh no" + testString: 'assert(!ohRegex.test("Ohh no"), "Your regex should not match "Ohh no"");' + - text: يجب أن يتطابق "Ohhh no" المعتاد مع "Ohhh no" + testString: 'assert(ohRegex.test("Ohhh no"), "Your regex should match "Ohhh no"");' + - text: يجب أن يتطابق "Ohhhh no" المعتاد مع "Ohhhh no" + testString: 'assert(ohRegex.test("Ohhhh no"), "Your regex should match "Ohhhh no"");' + - text: يجب أن يتطابق "Ohhhhh no" العادي مع "Ohhhhh no" + testString: 'assert(ohRegex.test("Ohhhhh no"), "Your regex should match "Ohhhhh no"");' + - text: يجب أن يتطابق "Ohhhhhh no" المعتاد مع "Ohhhhhh no" + testString: 'assert(ohRegex.test("Ohhhhhh no"), "Your regex should match "Ohhhhhh no"");' + - text: يجب ألا يتطابق "Ohhhhhhh no" العادي مع "Ohhhhhhh no" + testString: 'assert(!ohRegex.test("Ohhhhhhh no"), "Your regex should not match "Ohhhhhhh no"");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let ohStr = "Ohhh no"; +let ohRegex = /change/; // Change this line +let result = ohRegex.test(ohStr); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/use-capture-groups-to-search-and-replace.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/use-capture-groups-to-search-and-replace.arabic.md new file mode 100644 index 0000000000..57724d27f2 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/use-capture-groups-to-search-and-replace.arabic.md @@ -0,0 +1,56 @@ +--- +id: 587d7dbb367417b2b2512bab +title: Use Capture Groups to Search and Replace +challengeType: 1 +videoUrl: '' +localeTitle: استخدم مجموعات الالتقاط للبحث واستبدال +--- + +## Description +
    البحث مفيد. ومع ذلك ، يمكنك جعل البحث أكثر قوة عندما يتغير (أو يحل محل) النص الذي تطابقه. يمكنك البحث واستبدال النص في سلسلة باستخدام .replace() في سلسلة. تعتبر مدخلات .replace() هي أولاً نمط regex الذي تريد البحث عنه. المعلمة الثانية هي السلسلة التي ستحل محل المطابقة أو الوظيفة لفعل شيء ما.
    let wrongText = "إن السماء فضية."؛
    let silverRegex = / silver /؛
    wrongText.replace (silverRegex، "blue")؛
    // Returns "السماء زرقاء."
    يمكنك أيضًا الوصول إلى مجموعات الالتقاط في سلسلة الاستبدال باستخدام علامة الدولار ( $ ).
    "Code Code" .replace (/ (\ w +) \ s (\ w +) /، '$ 2 $ 1')؛
    // إرجاع "رمز المعسكر"
    + +## Instructions +
    اكتب تعبيرًا منطقيًا حتى يبحث عن السلسلة "good" . ثم قم بتحديث متغير replaceText لاستبدال "good" بـ "okey-dokey" .
    + +## Tests +
    + +```yml +tests: + - text: يجب عليك استخدام .replace() للبحث .replace() . + testString: 'assert(code.match(/\.replace\(.*\)/), "You should use .replace() to search and replace.");' + - text: يجب أن يتغير تعبيرك المعتاد "This sandwich is good." إلى "This sandwich is okey-dokey." + testString: 'assert(result == "This sandwich is okey-dokey." && replaceText === "okey-dokey", "Your regex should change "This sandwich is good." to "This sandwich is okey-dokey."");' + - text: يجب عدم تغيير السطر الأخير. + testString: 'assert(code.match(/result\s*=\s*huhText\.replace\(.*?\)/), "You should not change the last line.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let huhText = "This sandwich is good."; +let fixRegex = /change/; // Change this line +let replaceText = ""; // Change this line +let result = huhText.replace(fixRegex, replaceText); + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/using-the-test-method.arabic.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/using-the-test-method.arabic.md new file mode 100644 index 0000000000..417a3e0df0 --- /dev/null +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/regular-expressions/using-the-test-method.arabic.md @@ -0,0 +1,53 @@ +--- +id: 587d7db3367417b2b2512b8e +title: Using the Test Method +challengeType: 1 +videoUrl: '' +localeTitle: باستخدام طريقة الاختبار +--- + +## Description +
    يتم استخدام التعبيرات العادية في لغات البرمجة لمطابقة أجزاء من السلاسل. يمكنك إنشاء أنماط لمساعدتك في إجراء ذلك المطابقة. إذا كنت تريد العثور على الكلمة "the" في السلسلة "The dog chased the cat" ، يمكنك استخدام التعبير العادي التالي: /the/ . لاحظ أن علامات الاقتباس ليست مطلوبة في التعبير العادي. جافا سكريبت لديها طرق متعددة لاستخدام regexes. طريقة واحدة لاختبار regex تستخدم طريقة .test() . و .test() يأخذ طريقة التعبير المعتاد، وينطبق ذلك إلى سلسلة (التي يتم وضعها داخل قوسين)، وإرجاع true أو false إذا وجد النمط الخاص بك شيئا أم لا.
    السماح testStr = "freeCodeCamp" ؛
    let testRegex = / Code /؛
    testRegex.test (testStr)؛
    // يعود صحيح
    + +## Instructions +
    قم myRegex regex على السلسلة myString باستخدام طريقة .test() .
    + +## Tests +
    + +```yml +tests: + - text: يجب عليك استخدام .test() لاختبار regex. + testString: 'assert(code.match(/myRegex.test\(\s*myString\s*\)/), "You should use .test() to test the regex.");' + - text: نتيجة الخاص بك يجب أن تعود true . + testString: 'assert(result === true, "Your result should return true.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```js +let myString = "Hello, World!"; +let myRegex = /Hello/; +let result = myRegex; // Change this line + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/add-elements-within-your-bootstrap-wells.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/add-elements-within-your-bootstrap-wells.arabic.md new file mode 100644 index 0000000000..9be1495942 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/add-elements-within-your-bootstrap-wells.arabic.md @@ -0,0 +1,72 @@ +--- +id: bad87fee1348bd9aec908849 +title: Add Elements within Your Bootstrap Wells +challengeType: 0 +videoUrl: '' +localeTitle: إضافة عناصر داخل الآبار Bootstrap الخاص بك +--- + +## Description +
    نحن الآن عدة عناصر div عميقة على كل عمود في صفنا. هذا عميق كما سنحتاج. الآن يمكننا إضافة عناصر button . عش ثلاثة button العناصر داخل كل الخاص بك well div العناصر.
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: عش ثلاثة button العناصر داخل كل الخاص بك div العناصر مع الطبقة well . + testString: 'assert($("div.well:eq(0)").children("button").length === 3 && $("div.well:eq(1)").children("button").length === 3, "Nest three button elements within each of your div elements with class well.");' + - text: يجب أن يكون لديك ما مجموعه 6 عناصر button . + testString: 'assert($("button") && $("button").length > 5, "You should have a total of 6 button elements.");' + - text: '' + testString: 'assert(code.match(/<\/button>/g) && code.match(/
    + +## Challenge Seed +
    + +
    + +```html +
    +

    jQuery Playground

    +
    +
    +
    + + + +
    +
    +
    +
    + + + +
    +
    +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/add-font-awesome-icons-to-all-of-our-buttons.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/add-font-awesome-icons-to-all-of-our-buttons.arabic.md new file mode 100644 index 0000000000..2fd35e6b4f --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/add-font-awesome-icons-to-all-of-our-buttons.arabic.md @@ -0,0 +1,113 @@ +--- +id: bad87fee1348bd9aedc08845 +title: Add Font Awesome Icons to all of our Buttons +required: + - link: 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.css' + raw: true +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert($(".btn-info > i").is(".fa.fa-info-circle") || $(".btn-info > span").is(".fa.fa-info-circle"), "You should add a <i class="fa fa-info-circle"></i> within your info button element.");' + - text: '' + testString: 'assert($(".btn-danger > i").is(".fa.fa-trash") || $(".btn-danger > span").is(".fa.fa-trash"), "You should add a <i class="fa fa-trash"></i> within your delete button element.");' + - text: '' + testString: 'assert(code.match(/<\/i>|<\/span/g) && code.match(/<\/i|<\/span>/g).length > 2 && ($(".btn-primary > i").is(".fa.fa-thumbs-up") || $(".btn-primary > span").is(".fa.fa-thumbs-up")), "Make sure each of your i elements has a closing tag and <i class="fa fa-thumbs-up"></i> is in your like button element.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + + +
    +
    +
    +

    CatPhotoApp

    +
    +
    + A cute orange cat lying on its back. +
    +
    + Three kittens running towards the camera. +
    +
    + +
    +
    + +
    +
    + +
    +
    +

    Things cats love:

    +
      +
    • cat nip
    • +
    • laser pointers
    • +
    • lasagna
    • +
    +

    Top 3 things cats hate:

    +
      +
    1. flea treatment
    2. +
    3. thunder
    4. +
    5. other cats
    6. +
    +
    + + + + + + + +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/add-font-awesome-icons-to-our-buttons.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/add-font-awesome-icons-to-our-buttons.arabic.md new file mode 100644 index 0000000000..12ed8cb062 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/add-font-awesome-icons-to-our-buttons.arabic.md @@ -0,0 +1,114 @@ +--- +id: bad87fee1348bd9aedd08845 +title: Add Font Awesome Icons to our Buttons +required: + - link: 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.css' + raw: true +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: إضافة عنصر i مع فئات fa و fa-thumbs-up . + testString: 'assert($("i").is(".fa.fa-thumbs-up") || $("span").is(".fa.fa-thumbs-up"), "Add an i element with the classes fa and fa-thumbs-up.");' + - text: يجب fa-thumbs-up رمز fa-thumbs-up الخاص بك داخل الزر Like. + testString: 'assert(($("i.fa-thumbs-up").parent().text().match(/Like/gi) && $(".btn-primary > i").is(".fa.fa-thumbs-up")) || ($("span.fa-thumbs-up").parent().text().match(/Like/gi) && $(".btn-primary > span").is(".fa.fa-thumbs-up")), "Your fa-thumbs-up icon should be located within the Like button.");' + - text: عش عنصر i الخاص بك داخل عنصر button الخاص بك. + testString: 'assert($("button").children("i").length > 0 || $("button").children("span").length > 0, "Nest your i element within your button element.");' + - text: تأكد من أن عنصر الرمز الخاص بك يحتوي على علامة إغلاق. + testString: 'assert(code.match(/<\/i>|<\/span>/g), "Make sure your icon element has a closing tag.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + + +
    +
    +
    +

    CatPhotoApp

    +
    +
    + A cute orange cat lying on its back. +
    +
    + Three kittens running towards the camera. +
    +
    + +
    +
    + +
    +
    + +
    +
    +

    Things cats love:

    +
      +
    • cat nip
    • +
    • laser pointers
    • +
    • lasagna
    • +
    +

    Top 3 things cats hate:

    +
      +
    1. flea treatment
    2. +
    3. thunder
    4. +
    5. other cats
    6. +
    +
    + + + + + + + +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/add-id-attributes-to-bootstrap-elements.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/add-id-attributes-to-bootstrap-elements.arabic.md new file mode 100644 index 0000000000..4192d959f7 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/add-id-attributes-to-bootstrap-elements.arabic.md @@ -0,0 +1,69 @@ +--- +id: bad87fee1348bd9aec908853 +title: Add id Attributes to Bootstrap Elements +challengeType: 0 +videoUrl: '' +localeTitle: أضف سمات المعرف إلى عناصر Bootstrap +--- + +## Description +
    تذكر أنه بالإضافة إلى سمات الصف ، يمكنك إعطاء كل عنصر من id خاصية id . يجب أن يكون كل معرف فريدًا لعنصر محدد ويستخدم مرة واحدة فقط لكل صفحة. دعونا نمنح معرفًا فريدًا لكل عنصر من عناصر div للفئة well . تذكر أنه يمكنك إعطاء عنصر معرف مثل هذا: <div class="well" id="center-well"> أعط البئر على اليسار معرف left-well . اعط البئر على اليمين معرف right-well .
    + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert($(".col-xs-6").children("#left-well") && $(".col-xs-6").children("#left-well").length > 0, "Give your left well the id of left-well.");' + - text: امنح حقك well معرف right-well . + testString: 'assert($(".col-xs-6").children("#right-well") && $(".col-xs-6").children("#right-well").length > 0, "Give your right well the id of right-well.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html +
    +

    jQuery Playground

    +
    +
    +
    + + + +
    +
    +
    +
    + + + +
    +
    +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/apply-the-default-bootstrap-button-style.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/apply-the-default-bootstrap-button-style.arabic.md new file mode 100644 index 0000000000..d2de1cab81 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/apply-the-default-bootstrap-button-style.arabic.md @@ -0,0 +1,71 @@ +--- +id: bad87fee1348bd9aec908850 +title: Apply the Default Bootstrap Button Style +challengeType: 0 +guideUrl: 'https://arabic.freecodecamp.org/guide/certificates/apply-the-default-bootstrap-button-style' +videoUrl: '' +localeTitle: '' +--- + +## Description +
    يحتوي Bootstrap فئة زر آخر يسمى btn-default . قم btn فئات btn و btn-default على كل عنصر من عناصر button الخاص بك.
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: قم btn فئة btn على كل عنصر من عناصر button الخاص بك. + testString: 'assert($(".btn").length > 5, "Apply the btn class to each of your button elements.");' + - text: قم btn-default فئة btn-default على كل عنصر من عناصر button الخاص بك. + testString: 'assert($(".btn-default").length > 5, "Apply the btn-default class to each of your button elements.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html +
    +

    jQuery Playground

    +
    +
    +
    + + + +
    +
    +
    +
    + + + +
    +
    +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/call-out-optional-actions-with-btn-info.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/call-out-optional-actions-with-btn-info.arabic.md new file mode 100644 index 0000000000..9144dcfa12 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/call-out-optional-actions-with-btn-info.arabic.md @@ -0,0 +1,112 @@ +--- +id: bad87fee1348cd8acef08813 +title: Call out Optional Actions with btn-info +challengeType: 0 +videoUrl: '' +localeTitle: استدعاء الإجراءات الاختيارية مع btn-info +--- + +## Description +
    يأتي Bootstrap مع العديد من الألوان المحددة مسبقًا للأزرار. يتم استخدام فئة btn-info للفت الانتباه إلى الإجراءات الاختيارية التي يمكن للمستخدم اتخاذها. قم بإنشاء زر Bootstrap جديد على مستوى الكتلة أسفل الزر "أعجبني" مع النص "Info" ، وأضف تصنيفات btn-info و btn-block إلى Bootstrap. لاحظ أن هذه الأزرار لا تزال بحاجة إلى فئات btn و btn-block .
    + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: إنشاء عنصر button جديد مع النص "معلومات". + testString: 'assert(new RegExp("info","gi").test($("button").text()), "Create a new button element with the text "Info".");' + - text: '' + testString: 'assert($("button.btn-block.btn").length > 1, "Both of your Bootstrap buttons should have the btn and btn-block classes.");' + - text: '' + testString: 'assert($("button").hasClass("btn-info"), "Your new button should have the class btn-info.");' + - text: تأكد من أن جميع عناصر button لديك بها علامة إغلاق. + testString: 'assert(code.match(/<\/button>/g) && code.match(/
    + +## Challenge Seed +
    + +
    + +```html + + + +
    +

    CatPhotoApp

    + +

    Click here for cat photos.

    + + A cute orange cat lying on its back. + + Three kittens running towards the camera. + +

    Things cats love:

    +
      +
    • cat nip
    • +
    • laser pointers
    • +
    • lasagna
    • +
    +

    Top 3 things cats hate:

    +
      +
    1. flea treatment
    2. +
    3. thunder
    4. +
    5. other cats
    6. +
    +
    + + + + + + + +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/center-text-with-bootstrap.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/center-text-with-bootstrap.arabic.md new file mode 100644 index 0000000000..d9966255ee --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/center-text-with-bootstrap.arabic.md @@ -0,0 +1,108 @@ +--- +id: bad87fee1348bd8acde08812 +title: Center Text with Bootstrap +challengeType: 0 +videoUrl: '' +localeTitle: مركز النص مع Bootstrap +--- + +## Description +
    والآن بعد أن استخدمنا Bootstrap ، يمكننا تركيز عنصر العنوان الخاص بنا لجعله يبدو أفضل. كل ما نحتاج إليه هو إضافة مركز text-center إلى عنصر h2 . تذكر أنه يمكنك إضافة عدة فئات إلى نفس العنصر عن طريق فصل كل منها بمسافة ، مثل: <h2 class="red-text text-center">your text</h2>
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: يجب توسيط عنصر h2 عن طريق تطبيق text-center للصف + testString: 'assert($("h2").hasClass("text-center"), "Your h2 element should be centered by applying the class text-center");' + - text: يجب أن h2 عنصر h2 red-text للفصل + testString: 'assert($("h2").hasClass("red-text"), "Your h2 element should still have the class red-text");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + + +
    +

    CatPhotoApp

    + +

    Click here for cat photos.

    + + A cute orange cat lying on its back. + + Three kittens running towards the camera. +

    Things cats love:

    +
      +
    • cat nip
    • +
    • laser pointers
    • +
    • lasagna
    • +
    +

    Top 3 things cats hate:

    +
      +
    1. flea treatment
    2. +
    3. thunder
    4. +
    5. other cats
    6. +
    +
    + + + + + + + +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/create-a-block-element-bootstrap-button.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/create-a-block-element-bootstrap-button.arabic.md new file mode 100644 index 0000000000..90c6fe8be5 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/create-a-block-element-bootstrap-button.arabic.md @@ -0,0 +1,111 @@ +--- +id: bad87fee1348cd8acef08812 +title: Create a Block Element Bootstrap Button +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +
    عادةً ، تكون عناصر button الخاصة بك مع فئات btn و btn-default عريضة مثل النص الذي تحتوي عليه. على سبيل المثال: <button class="btn btn-default">Submit</button> سيكون هذا الزر عريضًا مثل كلمة "إرسال". طريق جعلها تحجب العناصر مع فئة إضافية من btn-block ، سوف يمتد الزر الخاص بك لملء المساحة الأفقية بالكامل لصفحتك وستتدفق أية عناصر تتبعها إلى "سطر جديد" أسفل الكتلة. <button class="btn btn-default btn-block">Submit</button> سيشغل هذا الزر نسبة 100٪ من العرض المتاح. ملاحظة أن هذه الأزرار لا تزال بحاجة إلى فئة btn . إضافة فئة btn-block الخاص Bootstrap إلى الزر Bootstrap الخاص بك.
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert($("button").hasClass("btn") && $("button").hasClass("btn-default"), "Your button should still have the btn and btn-default classes.");' + - text: '' + testString: 'assert($("button").hasClass("btn-block"), "Your button should have the class btn-block.");' + - text: تأكد من أن جميع عناصر button لديك بها علامة إغلاق. + testString: 'assert(code.match(/<\/button>/g) && code.match(/
    + +## Challenge Seed +
    + +
    + +```html + + + +
    +

    CatPhotoApp

    + +

    Click here for cat photos.

    + + A cute orange cat lying on its back. + + Three kittens running towards the camera. + +

    Things cats love:

    +
      +
    • cat nip
    • +
    • laser pointers
    • +
    • lasagna
    • +
    +

    Top 3 things cats hate:

    +
      +
    1. flea treatment
    2. +
    3. thunder
    4. +
    5. other cats
    6. +
    +
    + + + + + + + +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/create-a-bootstrap-button.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/create-a-bootstrap-button.arabic.md new file mode 100644 index 0000000000..fbc4925860 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/create-a-bootstrap-button.arabic.md @@ -0,0 +1,111 @@ +--- +id: bad87fee1348cd8acdf08812 +title: Create a Bootstrap Button +challengeType: 0 +videoUrl: '' +localeTitle: إنشاء زر Bootstrap +--- + +## Description +
    يحتوي Bootstrap على أنماطه الخاصة لعناصر button ، والتي تبدو أفضل بكثير من تلك الخاصة بتنسيق HTML العادي. أنشئ عنصرًا button جديدًا أسفل صورتك الكبيرة المضحكة. اعطها فئات btn و btn-default ، بالإضافة إلى نص "Like".
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: إنشاء عنصر button جديد مع النص "أعجبني". + testString: 'assert(new RegExp("like","gi").test($("button").text()) && ($("img.img-responsive + button.btn").length > 0), "Create a new button element with the text "Like".");' + - text: 'يجب أن يحتوي الزر الجديد على فئتين: btn و btn-default .' + testString: 'assert($("button").hasClass("btn") && $("button").hasClass("btn-default"), "Your new button should have two classes: btn and btn-default.");' + - text: تأكد من أن جميع عناصر button لديك بها علامة إغلاق. + testString: 'assert(code.match(/<\/button>/g) && code.match(/
    + +## Challenge Seed +
    + +
    + +```html + + + +
    +

    CatPhotoApp

    + +

    Click here for cat photos.

    + + A cute orange cat lying on its back. + + Three kittens running towards the camera. + +

    Things cats love:

    +
      +
    • cat nip
    • +
    • laser pointers
    • +
    • lasagna
    • +
    +

    Top 3 things cats hate:

    +
      +
    1. flea treatment
    2. +
    3. thunder
    4. +
    5. other cats
    6. +
    +
    + + + + + + + +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/create-a-bootstrap-headline.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/create-a-bootstrap-headline.arabic.md new file mode 100644 index 0000000000..c79fc7980d --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/create-a-bootstrap-headline.arabic.md @@ -0,0 +1,57 @@ +--- +id: bad87fee1348bd9aec908846 +title: Create a Bootstrap Headline +challengeType: 0 +videoUrl: '' +localeTitle: قم بإنشاء عنوان Bootstrap +--- + +## Description +
    الآن دعونا نبني شيئًا ما من الصفر لممارسة مهارات HTML و CSS و Bootstrap. سنقوم ببناء ملعب jQuery ، والذي سنستخدمه قريبًا في تحديات jQuery. للبدء ، أنشئ عنصر h3 ، باستخدام jQuery Playground للنص. قم h3 عنصر h3 الخاص بك مع فئة Bootstrap text-primary ، وقم بتوسيطها مع فئة Bootstrap في مركز text-center .
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: أضف عنصر h3 إلى صفحتك. + testString: 'assert($("h3") && $("h3").length > 0, "Add a h3 element to your page.");' + - text: تأكد من أن عنصر h3 يحتوي على علامة إغلاق. + testString: 'assert(code.match(/<\/h3>/g) && code.match(/

    /g).length === code.match(/

    h3 element has a closing tag.");' + - text: يجب أن يكون لون عنصر h3 الخاص بك عن طريق تطبيق الفصل الدراسي text-primary + testString: 'assert($("h3").hasClass("text-primary"), "Your h3 element should be colored by applying the class text-primary");' + - text: يجب توسيط عنصر h3 الخاص بك من خلال تطبيق text-center الفصل + testString: 'assert($("h3").hasClass("text-center"), "Your h3 element should be centered by applying the class text-center");' + - text: '' + testString: 'assert.isTrue((/jquery(\s)+playground/gi).test($("h3").text()), "Your h3 element should have the text jQuery Playground.");' + +``` + +

    + +## Challenge Seed +
    + +
    + +```html + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/create-a-bootstrap-row.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/create-a-bootstrap-row.arabic.md new file mode 100644 index 0000000000..eda04b1a1f --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/create-a-bootstrap-row.arabic.md @@ -0,0 +1,58 @@ +--- +id: bad87fee1348bd9bec908846 +title: Create a Bootstrap Row +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +
    سنقوم الآن بإنشاء صف Bootstrap لعناصر المضمنة الخاصة بنا. أنشئ عنصر div أسفل علامة h3 ، مع فئة row .
    + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: أضف عنصر div أسفل عنصر h3 . + testString: 'assert(($("div").length > 1) && ($("div.row h3.text-primary").length == 0) && ($("div.row + h3.text-primary").length == 0) && ($("h3.text-primary + div.row").length > 0), "Add a div element below your h3 element.");' + - text: '' + testString: 'assert($("div").hasClass("row"), "Your div element should have the class row");' + - text: يجب أن يتداخل row div داخل container-fluid div + testString: 'assert($("div.container-fluid div.row").length > 0, "Your row div should be nested inside the container-fluid div");' + - text: '' + testString: 'assert(code.match(/<\/div>/g) && code.match(/
    /g).length === code.match(/
    div element has a closing tag.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html +
    +

    jQuery Playground

    + +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/create-a-class-to-target-with-jquery-selectors.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/create-a-class-to-target-with-jquery-selectors.arabic.md new file mode 100644 index 0000000000..19594b813f --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/create-a-class-to-target-with-jquery-selectors.arabic.md @@ -0,0 +1,67 @@ +--- +id: bad87fee1348bd9aec908852 +title: Create a Class to Target with jQuery Selectors +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: قم target الفئة target على كل عنصر من عناصر button الخاص بك. + testString: 'assert($(".target").length > 5, "Apply the target class to each of your button elements.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html +
    +

    jQuery Playground

    +
    +
    +
    + + + +
    +
    +
    +
    + + + +
    +
    +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/create-a-custom-heading.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/create-a-custom-heading.arabic.md new file mode 100644 index 0000000000..de1185390c --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/create-a-custom-heading.arabic.md @@ -0,0 +1,109 @@ +--- +id: bad87fee1348bd9aede08845 +title: Create a Custom Heading +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +
    سنجعل عنوانًا بسيطًا لتطبيق Cat Photo App من خلال وضع العنوان وصور الاسترخاء في نفس الصف. تذكر ، يستخدم Bootstrap نظام شبكة استجابة ، مما يجعل من السهل وضع العناصر في صفوف وتحديد العرض النسبي لكل عنصر. يمكن تطبيق معظم طبقات Bootstrap على عنصر div . عيّن الصورة الأولى والعنصر h2 عنصر <div class="row"> . ضع العنصر h2 في <div class="col-xs-8"> وصورتك في <div class="col-xs-4"> بحيث تكون على نفس السطر. لاحظ كيف أصبحت الصورة الآن الحجم المناسب لتناسب النص؟
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: يجب أن h2 عنصر h2 وعنصر img العلوي معًا داخل عنصر div مع row . + testString: 'assert($("div.row:has(h2)").length > 0 && $("div.row:has(img)").length > 0, "Your h2 element and topmost img element should both be nested together within a div element with the class row.");' + - text: '' + testString: 'assert($("div.col-xs-4:has(img)").length > 0 && $("div.col-xs-4:has(div)").length === 0, "Nest your topmost img element within a div with the class col-xs-4.");' + - text: ضع العنصر h2 في div باستخدام الفئة col-xs-8 . + testString: 'assert($("div.col-xs-8:has(h2)").length > 0 && $("div.col-xs-8:has(div)").length === 0, "Nest your h2 element within a div with the class col-xs-8.");' + - text: تأكد من أن كل عنصر من عناصر div لديه علامة إغلاق. + testString: 'assert(code.match(/<\/div>/g) && code.match(/
    /g).length === code.match(/
    div elements has a closing tag.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + + + +
    +

    CatPhotoApp

    + + A cute orange cat lying on its back. + + Three kittens running towards the camera. +
    +
    + +
    +
    + +
    +
    + +
    +
    +

    Things cats love:

    +
      +
    • cat nip
    • +
    • laser pointers
    • +
    • lasagna
    • +
    +

    Top 3 things cats hate:

    +
      +
    1. flea treatment
    2. +
    3. thunder
    4. +
    5. other cats
    6. +
    +
    + + + + + + + +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/create-bootstrap-wells.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/create-bootstrap-wells.arabic.md new file mode 100644 index 0000000000..01e20df606 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/create-bootstrap-wells.arabic.md @@ -0,0 +1,64 @@ +--- +id: bad87fee1348bd9aec908848 +title: Create Bootstrap Wells +challengeType: 0 +videoUrl: '' +localeTitle: إنشاء Bootstrap Wells +--- + +## Description +
    يحتوي Bootstrap على فئة تسمى well يمكن أن تخلق إحساسًا بصريًا بالعمق لأعمدتك. وضع عنصر div واحدًا مع الصف well داخل كل عنصر من عناصر div col-xs-6 div .
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: إضافة عنصر div مع الصف well داخل كل عنصر من عناصر div مع الفئة "col-xs-6" + testString: 'assert($("div.col-xs-6").not(":has(>div.well)").length < 1, "Add a div element with the class well inside each of your div elements with the class "col-xs-6"");' + - text: عش كل من عناصر div الخاصة بك مع الفئة "col-xs-6" داخل عنصر div الخاص بك مع الصف "row" . + testString: 'assert($("div.row > div.col-xs-6").length > 1, "Nest both of your div elements with the class "col-xs-6" within your div element with the class "row".");' + - text: تأكد من أن جميع عناصر div لديك علامات إغلاق. + testString: 'assert(code.match(/<\/div>/g) && code.match(/
    /g).length === code.match(/
    div elements have closing tags.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html +
    +

    jQuery Playground

    +
    +
    + +
    +
    + +
    +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/ditch-custom-css-for-bootstrap.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/ditch-custom-css-for-bootstrap.arabic.md new file mode 100644 index 0000000000..45087525f0 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/ditch-custom-css-for-bootstrap.arabic.md @@ -0,0 +1,124 @@ +--- +id: bad87fee1347bd9aedf08845 +title: Ditch Custom CSS for Bootstrap +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +
    يمكننا تنظيف الكود الخاص بنا وجعل تطبيق Cat Photo App يبدو أكثر تقليدية باستخدام الأنماط المضمنة في Bootstrap بدلاً من الأنماط المخصصة التي أنشأناها سابقًا. لا تقلق - سيكون هناك متسع من الوقت لتخصيص CSS في وقت لاحق. قم بحذف .red-text و p و .smaller-image من عنصر style الخاص بك بحيث تكون التصريحات الوحيدة المتبقية في عنصر style الخاص بك هي h2 thick-green-border . ثم احذف العنصر p الذي يحتوي على رابط خامد. ثم قم بإزالة فئة red-text من عنصر h2 واستبدله بفئة Bootstrap text-primary . أخيرًا ، أزل فئة "الصورة الأصغر" من عنصر img الأول img بفئة img-responsive .
    + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: يجب ألا يحتوي عنصر h2 red-text للفئة. + testString: 'assert(!$("h2").hasClass("red-text"), "Your h2 element should no longer have the class red-text.");' + - text: يجب أن يكون عنصر h2 الخاص بك يحتوي الآن على text-primary . + testString: 'assert($("h2").hasClass("text-primary"), "Your h2 element should now have the class text-primary.");' + - text: لم يعد يجب استخدام عناصر الفقرة الخط Monospace . + testString: 'assert(!$("p").css("font-family").match(/monospace/i), "Your paragraph elements should no longer use the font Monospace.");' + - text: أزل فئة smaller-image من صورتك العلوية. + testString: 'assert(!$("img").hasClass("smaller-image"), "Remove the smaller-image class from your top image.");' + - text: أضف فئة img-responsive إلى أعلى صورة. + testString: 'assert($(".img-responsive").length > 1, "Add the img-responsive class to your top image.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + + +
    +

    CatPhotoApp

    + +

    Click here for cat photos.

    + + A cute orange cat lying on its back. + + Three kittens running towards the camera. +
    +
    + +
    +
    + +
    +
    + +
    +
    +

    Things cats love:

    +
      +
    • cat nip
    • +
    • laser pointers
    • +
    • lasagna
    • +
    +

    Top 3 things cats hate:

    +
      +
    1. flea treatment
    2. +
    3. thunder
    4. +
    5. other cats
    6. +
    +
    + + + + + + + +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/give-each-element-a-unique-id.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/give-each-element-a-unique-id.arabic.md new file mode 100644 index 0000000000..0e57c38fd7 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/give-each-element-a-unique-id.arabic.md @@ -0,0 +1,80 @@ +--- +id: bad87fee1348bd9aec908855 +title: Give Each Element a Unique id +challengeType: 0 +videoUrl: '' +localeTitle: منح كل عنصر معرف فريد +--- + +## Description +
    كما أننا سنرغب أيضًا في استخدام jQuery لاستهداف كل زر بمعرفه الفريد. امنح كل من الأزرار target6 فريدًا ، بدءًا من target1 وتنتهي بـ target6 . تأكد من أن target1 to target3 في #left-well ، وأن target4 to target6 في #right-well .
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert($("#left-well").children("#target1") && $("#left-well").children("#target1").length > 0, "One button element should have the id target1.");' + - text: '' + testString: 'assert($("#left-well").children("#target2") && $("#left-well").children("#target2").length > 0, "One button element should have the id target2.");' + - text: يجب أن يكون عنصر واحد button معرف target3 . + testString: 'assert($("#left-well").children("#target3") && $("#left-well").children("#target3").length > 0, "One button element should have the id target3.");' + - text: يجب أن يحتوي عنصر button الواحد على معرف target4 . + testString: 'assert($("#right-well").children("#target4") && $("#right-well").children("#target4").length > 0, "One button element should have the id target4.");' + - text: يجب أن يكون عنصر button الواحد هو target5 . + testString: 'assert($("#right-well").children("#target5") && $("#right-well").children("#target5").length > 0, "One button element should have the id target5.");' + - text: يجب أن يكون عنصر button الواحد هو target6 . + testString: 'assert($("#right-well").children("#target6") && $("#right-well").children("#target6").length > 0, "One button element should have the id target6.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html +
    +

    jQuery Playground

    +
    +
    +

    #left-well

    +
    + + + +
    +
    +
    +

    #right-well

    +
    + + + +
    +
    +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/house-our-page-within-a-bootstrap-container-fluid-div.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/house-our-page-within-a-bootstrap-container-fluid-div.arabic.md new file mode 100644 index 0000000000..695df4f049 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/house-our-page-within-a-bootstrap-container-fluid-div.arabic.md @@ -0,0 +1,54 @@ +--- +id: bad87fee1348bd9aec908746 +title: House our page within a Bootstrap container-fluid div +challengeType: 0 +videoUrl: '' +localeTitle: قم بتضمين صفحتنا داخل div-fluid حاوية سائل +--- + +## Description +
    الآن ، دعنا نتأكد من استجابة جميع المحتوى على صفحتك للجوّال. لنقم h3 عنصر h3 عنصر div باستخدام container-fluid الصف.
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert($("div").hasClass("container-fluid"), "Your div element should have the class container-fluid.");' + - text: تأكد من أن كل عنصر من عناصر div لديه علامة إغلاق. + testString: 'assert(code.match(/<\/div>/g) && code.match(/
    /g).length === code.match(/
    div elements has a closing tag.");' + - text: '' + testString: 'assert($("div").children("h3").length >0, "Nest your h3 element inside a div element.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html +

    jQuery Playground

    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/label-bootstrap-buttons.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/label-bootstrap-buttons.arabic.md new file mode 100644 index 0000000000..f7bd960540 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/label-bootstrap-buttons.arabic.md @@ -0,0 +1,80 @@ +--- +id: bad87fee1348bd9aec908856 +title: Label Bootstrap Buttons +challengeType: 0 +videoUrl: '' +localeTitle: تسمية أزرار Bootstrap +--- + +## Description +
    تمامًا كما وصفنا آبارنا ، نريد تسمية أزرارنا. امنح كل عنصر من عناصر button الخاص بك نصًا يتوافق مع محدد id الخاص به.
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: 'إعطاء الخاص بك button عنصر مع معرف target1 النص #target1 .' + testString: 'assert(new RegExp("#target1","gi").test($("#target1").text()), "Give your button element with the id target1 the text #target1.");' + - text: 'امنح عنصر button الخاص بك بـ target2 النص #target2 .' + testString: 'assert(new RegExp("#target2","gi").test($("#target2").text()), "Give your button element with the id target2 the text #target2.");' + - text: 'أعط عنصر button الخاص بك مع معرف target3 النص #target3 .' + testString: 'assert(new RegExp("#target3","gi").test($("#target3").text()), "Give your button element with the id target3 the text #target3.");' + - text: 'امنح عنصر button الخاص بك بـ target4 النص #target4 .' + testString: 'assert(new RegExp("#target4","gi").test($("#target4").text()), "Give your button element with the id target4 the text #target4.");' + - text: 'امنح عنصر button الخاص بك بـ target5 النص #target5 .' + testString: 'assert(new RegExp("#target5","gi").test($("#target5").text()), "Give your button element with the id target5 the text #target5.");' + - text: 'امنح عنصر button الخاص بك بـ target6 the #target6 .' + testString: 'assert(new RegExp("#target6","gi").test($("#target6").text()), "Give your button element with the id target6 the text #target6.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html +
    +

    jQuery Playground

    +
    +
    +

    #left-well

    +
    + + + +
    +
    +
    +

    #right-well

    +
    + + + +
    +
    +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/label-bootstrap-wells.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/label-bootstrap-wells.arabic.md new file mode 100644 index 0000000000..575020da2d --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/label-bootstrap-wells.arabic.md @@ -0,0 +1,76 @@ +--- +id: bad87fee1348bd9aec908854 +title: Label Bootstrap Wells +challengeType: 0 +videoUrl: '' +localeTitle: تسمية Bootstrap ويلز +--- + +## Description +
    من أجل الوضوح ، دعونا تسمية كل من آبارنا مع هوياتهم. فوق بئر يسارك ، داخل عنصر col-xs-6 div ، أضف عنصر h4 بالنص #left-well . فوق بئر اليمين ، داخل عنصر col-xs-6 div ، أضف عنصر h4 بالنص #right-well .
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: أضف عنصر h4 إلى كل عنصر من عناصر <div class="col-xs-6"> . + testString: 'assert($(".col-xs-6").children("h4") && $(".col-xs-6").children("h4").length > 1, "Add an h4 element to each of your <div class="col-xs-6"> elements.");' + - text: 'يجب أن يحتوي عنصر h4 على النص #left-well .' + testString: 'assert(new RegExp("#left-well","gi").test($("h4").text()), "One h4 element should have the text #left-well.");' + - text: 'يجب أن يحتوي عنصر h4 على النص #right-well .' + testString: 'assert(new RegExp("#right-well","gi").test($("h4").text()), "One h4 element should have the text #right-well.");' + - text: تأكد من أن جميع عناصر h4 لديك علامات إغلاق. + testString: 'assert(code.match(/<\/h4>/g) && code.match(/

    /g).length === code.match(/

    h4 elements have closing tags.");' + +``` + +

    + +## Challenge Seed +
    + +
    + +```html +
    +

    jQuery Playground

    +
    +
    + +
    + + + +
    +
    +
    + +
    + + + +
    +
    +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/line-up-form-elements-responsively-with-bootstrap.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/line-up-form-elements-responsively-with-bootstrap.arabic.md new file mode 100644 index 0000000000..e7d9b7b62d --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/line-up-form-elements-responsively-with-bootstrap.arabic.md @@ -0,0 +1,130 @@ +--- +id: bad87fee1348bd9aec908845 +title: Line up Form Elements Responsively with Bootstrap +required: + - link: 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.css' + raw: true +challengeType: 0 +videoUrl: '' +localeTitle: يصطف عناصر النموذج بشكل مستجيب مع Bootstrap +--- + +## Description +
    الآن دعنا نحصل على input النموذج الخاص بك button الإرسال على نفس السطر. سنقوم بذلك بالطريقة نفسها التي استخدمناها سابقًا: باستخدام عنصر div مع row ، وعناصر div الأخرى داخله باستخدام فئة col-xs-* . عش كل من النص النموذج الخاص بك input وتقديم button داخل div مع الطبقة row . أدخل input النص للنموذج ضمن div مع فئة col-xs-7 . وضع button إرسال النموذج الخاص بك في div مع الفئة col-xs-5 . هذا هو التحدي الأخير الذي سنفعله لتطبيق Cat Photo App في الوقت الحالي. نأمل أن تكون قد استمتعت بتعلم Font Awesome و Bootstrap والتصميم سريع الاستجابة!
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: وضع زر إرسال النموذج وإدخال النص في div مع row . + testString: 'assert($("div.row:has(input[type=\"text\"])").length > 0 && $("div.row:has(button[type=\"submit\"])").length > 0, "Nest your form submission button and text input in a div with class row.");' + - text: ضع نصًا لإدخال النص في div باستخدام col-xs-7 . + testString: 'assert($("div.col-xs-7:has(input[type=\"text\"])").length > 0, "Nest your form text input in a div with the class col-xs-7.");' + - text: وضع الزر "إرسال النموذج" في div باستخدام الفئة col-xs-5 . + testString: 'assert($("div.col-xs-5:has(button[type=\"submit\"])").length > 0, "Nest your form submission button in a div with the class col-xs-5.");' + - text: تأكد من أن كل عنصر من عناصر div لديه علامة إغلاق. + testString: 'assert(code.match(/<\/div>/g) && code.match(/
    /g).length === code.match(/
    div elements has a closing tag.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + + +
    +
    +
    +

    CatPhotoApp

    +
    +
    + A cute orange cat lying on its back. +
    +
    + Three kittens running towards the camera. +
    +
    + +
    +
    + +
    +
    + +
    +
    +

    Things cats love:

    +
      +
    • cat nip
    • +
    • laser pointers
    • +
    • lasagna
    • +
    +

    Top 3 things cats hate:

    +
      +
    1. flea treatment
    2. +
    3. thunder
    4. +
    5. other cats
    6. +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + + +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/make-images-mobile-responsive.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/make-images-mobile-responsive.arabic.md new file mode 100644 index 0000000000..e891ffecc7 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/make-images-mobile-responsive.arabic.md @@ -0,0 +1,113 @@ +--- +id: bad87fee1348bd9acde08812 +title: Make Images Mobile Responsive +challengeType: 0 +videoUrl: '' +localeTitle: جعل الصور موبايل متجاوب +--- + +## Description +
    أولاً ، أضف صورة جديدة أسفل الصورة الحالية. تعيين السمة src الخاصة به إلى https://bit.ly/fcc-running-cats . سيكون من الرائع أن تكون هذه الصورة بالضبط شاشة شاشة الهاتف الخاصة بنا. لحسن الحظ ، مع Bootstrap ، كل ما نحتاج إليه هو إضافة فئة img-responsive إلى صورتك. افعل ذلك ، ويجب أن تتناسب الصورة تمامًا مع عرض صفحتك.
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يكون لديك ما مجموعه صورتين. + testString: 'assert($("img").length === 2, "You should have a total of two images.");' + - text: يجب أن تكون صورتك الجديدة أقل من صورتك القديمة وأن يكون لديك متفاعل img-responsive . + testString: 'assert($("img:eq(1)").hasClass("img-responsive"), "Your new image should be below your old one and have the class img-responsive.");' + - text: يجب ألا تحتوي صورتك الجديدة على صور smaller-image الفصل. + testString: 'assert(!$("img:eq(1)").hasClass("smaller-image"), "Your new image should not have the class smaller-image.");' + - text: 'يجب أن تحتوي صورتك الجديدة على src من https://bit.ly/fcc-running-cats .' + testString: 'assert($("img:eq(1)").attr("src") === "https://bit.ly/fcc-running-cats", "Your new image should have a src of https://bit.ly/fcc-running-cats.");' + - text: تأكد من أن عنصر img الجديد يحتوي على قوس زاوية إغلاق. + testString: 'assert(code.match(//g).length === 2 && code.match(/img element has a closing angle bracket.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + + +
    +

    CatPhotoApp

    + +

    Click here for cat photos.

    + + A cute orange cat lying on its back. + +

    Things cats love:

    +
      +
    • cat nip
    • +
    • laser pointers
    • +
    • lasagna
    • +
    +

    Top 3 things cats hate:

    +
      +
    1. flea treatment
    2. +
    3. thunder
    4. +
    5. other cats
    6. +
    +
    + + + + + + + +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/responsively-style-checkboxes.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/responsively-style-checkboxes.arabic.md new file mode 100644 index 0000000000..97211b7c90 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/responsively-style-checkboxes.arabic.md @@ -0,0 +1,120 @@ +--- +id: bad87fee1348bd9aeda08845 +title: Responsively Style Checkboxes +required: + - link: 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.css' + raw: true +challengeType: 0 +videoUrl: '' +localeTitle: Checkbox Style Responsively +--- + +## Description +
    يمكنك استخدام صفوف col-xs-* في Bootstrap على عناصر form أيضًا! بهذه الطريقة ، سيتم توزيع مربعات الاختيار الخاصة بنا بشكل متساوٍ عبر الصفحة ، بغض النظر عن مدى اتساع دقة الشاشة. وضع علامة على جميع ثلاثة من مربعات الاختيار في عنصر <div class="row"> . ثم تداخل كل منها في عنصر <div class="col-xs-4"> .
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: استبدل جميع مربعات الاختيار داخل div واحد row . + testString: 'assert($("div.row:has(input[type=\"checkbox\"])").length > 0, "Nest all of your checkboxes inside one div with the class row.");' + - text: عش كل من مربعات الاختيار داخل div الخاص بها باستخدام فئة col-xs-4 . + testString: 'assert($("div.col-xs-4:has(input[type=\"checkbox\"])").length > 2, "Nest each of your checkboxes inside its own div with the class col-xs-4.");' + - text: تأكد من أن كل عنصر من عناصر div لديه علامة إغلاق. + testString: 'assert(code.match(/<\/div>/g) && code.match(/
    /g).length === code.match(/
    div elements has a closing tag.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + + +
    +
    +
    +

    CatPhotoApp

    +
    +
    + A cute orange cat lying on its back. +
    +
    + Three kittens running towards the camera. +
    +
    + +
    +
    + +
    +
    + +
    +
    +

    Things cats love:

    +
      +
    • cat nip
    • +
    • laser pointers
    • +
    • lasagna
    • +
    +

    Top 3 things cats hate:

    +
      +
    1. flea treatment
    2. +
    3. thunder
    4. +
    5. other cats
    6. +
    +
    +
    +
    + +
    +
    + +
    +
    + + + + + +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/responsively-style-radio-buttons.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/responsively-style-radio-buttons.arabic.md new file mode 100644 index 0000000000..c9f5228c3b --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/responsively-style-radio-buttons.arabic.md @@ -0,0 +1,113 @@ +--- +id: bad87fee1348bd9aedb08845 +title: Responsively Style Radio Buttons +required: + - link: 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.css' + raw: true +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +
    يمكنك استخدام صفوف col-xs-* في Bootstrap على عناصر form أيضًا! بهذه الطريقة ، سيتم توزيع أزرار الراديو الخاصة بنا بشكل متساوٍ عبر الصفحة ، بغض النظر عن مدى اتساع دقة الشاشة. ضع كلا من أزرار الراديو داخل عنصر <div class="row"> . ثم تداخل كل منها داخل عنصر <div class="col-xs-6"> . ملاحظة: كتذكير ، تعد أزرار الاختيار عناصر input من نوع radio .
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert($("div.row:has(input[type=\"radio\"])").length > 0, "Nest all of your radio buttons inside one div with the class row.");' + - text: '' + testString: 'assert($("div.col-xs-6:has(input[type=\"radio\"])").length > 1, "Nest each of your radio buttons inside its own div with the class col-xs-6.");' + - text: تأكد من أن كل عنصر من عناصر div لديه علامة إغلاق. + testString: 'assert(code.match(/<\/div>/g) && code.match(/
    /g).length === code.match(/
    div elements has a closing tag.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + + +
    +
    +
    +

    CatPhotoApp

    +
    +
    + A cute orange cat lying on its back. +
    +
    + Three kittens running towards the camera. +
    +
    + +
    +
    + +
    +
    + +
    +
    +

    Things cats love:

    +
      +
    • cat nip
    • +
    • laser pointers
    • +
    • lasagna
    • +
    +

    Top 3 things cats hate:

    +
      +
    1. flea treatment
    2. +
    3. thunder
    4. +
    5. other cats
    6. +
    +
    + + + + + + + +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/split-your-bootstrap-row.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/split-your-bootstrap-row.arabic.md new file mode 100644 index 0000000000..d121a013c8 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/split-your-bootstrap-row.arabic.md @@ -0,0 +1,58 @@ +--- +id: bad87fee1348bd9aec908847 +title: Split Your Bootstrap Row +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +
    الآن لدينا صف Bootstrap ، دعنا نقسمه إلى عمودين لإيواء عناصرنا. قم div عنصرين div داخل صفك ، كلاهما بـ col-xs-6 .
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: Nest two div class="col-xs-6" within div class="row" element. + testString: 'assert($("div.row > div.col-xs-6").length > 1, "Nest two div class="col-xs-6" elements within your div class="row" element.");' + - text: تأكد من أن جميع عناصر div لديك علامات إغلاق. + testString: 'assert(code.match(/<\/div>/g) && code.match(/
    /g).length === code.match(/
    div elements have closing tags.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html +
    +

    jQuery Playground

    +
    + + +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/style-text-inputs-as-form-controls.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/style-text-inputs-as-form-controls.arabic.md new file mode 100644 index 0000000000..0036e04016 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/style-text-inputs-as-form-controls.arabic.md @@ -0,0 +1,130 @@ +--- +id: bad87fee1348bd9aed908845 +title: Style Text Inputs as Form Controls +required: + - link: 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.css' + raw: true +challengeType: 0 +videoUrl: '' +localeTitle: مدخلات نمط النص مثل عناصر التحكم في النموذج +--- + +## Description +undefined + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert($("button[type=\"submit\"]").hasClass("btn btn-primary"), "Give the submit button in your form the classes btn btn-primary.");' + - text: '' + testString: 'assert($("button[type=\"submit\"]:has(i.fa.fa-paper-plane)").length > 0, "Add a <i class="fa fa-paper-plane"></i> within your submit button element.");' + - text: قم input النص في النموذج الخاص بك على form-control . + testString: 'assert($("input[type=\"text\"]").hasClass("form-control"), "Give the text input in your form the class form-control.");' + - text: تأكد من أن كل عنصر من عناصر i لديك علامة إغلاق. + testString: 'assert(code.match(/<\/i>/g) && code.match(/<\/i/g).length > 3, "Make sure each of your i elements has a closing tag.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + + +
    +
    +
    +

    CatPhotoApp

    +
    +
    + A cute orange cat lying on its back. +
    +
    + Three kittens running towards the camera. +
    +
    + +
    +
    + +
    +
    + +
    +
    +

    Things cats love:

    +
      +
    • cat nip
    • +
    • laser pointers
    • +
    • lasagna
    • +
    +

    Top 3 things cats hate:

    +
      +
    1. flea treatment
    2. +
    3. thunder
    4. +
    5. other cats
    6. +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + + +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/taste-the-bootstrap-button-color-rainbow.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/taste-the-bootstrap-button-color-rainbow.arabic.md new file mode 100644 index 0000000000..e8c94218aa --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/taste-the-bootstrap-button-color-rainbow.arabic.md @@ -0,0 +1,111 @@ +--- +id: bad87fee1348cd8acef08811 +title: Taste the Bootstrap Button Color Rainbow +challengeType: 0 +videoUrl: '' +localeTitle: طعم زر Bootstrap لون قوس قزح +--- + +## Description +
    فئة btn-primary هي اللون الأساسي الذي ستستخدمه في تطبيقك. من المفيد تمييز الإجراءات التي تريد أن يتخذها المستخدم. استبدل فئة btn-default في Bootstrap بواسطة btn-primary في الزر الخاص بك. لاحظ أن هذا الزر سيظل بحاجة إلى فئات btn و btn-block .
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert($("button").hasClass("btn-primary"), "Your button should have the class btn-primary.");' + - text: يجب أن يحتوي الزر الخاص بك btn-block فئات btn و btn-block . + testString: 'assert($("button").hasClass("btn-block") && $("button").hasClass("btn"), "Your button should still have the btn and btn-block classes.");' + - text: تأكد من أن جميع عناصر button لديك بها علامة إغلاق. + testString: 'assert(code.match(/<\/button>/g) && code.match(/
    + +## Challenge Seed +
    + +
    + +```html + + + +
    +

    CatPhotoApp

    + +

    Click here for cat photos.

    + + A cute orange cat lying on its back. + + Three kittens running towards the camera. + +

    Things cats love:

    +
      +
    • cat nip
    • +
    • laser pointers
    • +
    • lasagna
    • +
    +

    Top 3 things cats hate:

    +
      +
    1. flea treatment
    2. +
    3. thunder
    4. +
    5. other cats
    6. +
    +
    + + + + + + + +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/use-a-span-to-target-inline-elements.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/use-a-span-to-target-inline-elements.arabic.md new file mode 100644 index 0000000000..4d8a6bd761 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/use-a-span-to-target-inline-elements.arabic.md @@ -0,0 +1,109 @@ +--- +id: bad87fee1348bd9aedf08845 +title: Use a span to Target Inline Elements +challengeType: 0 +videoUrl: '' +localeTitle: استخدم مسافة للعناصر المضمنة الهدف +--- + +## Description +
    يمكنك استخدام الامتدادات لإنشاء عناصر مضمنة. أتذكر عندما استخدمنا فئة btn-block لجعل الزر يملأ الصف بأكمله؟ يوضح الفرق بين عنصر "inline" وعنصر "block". باستخدام عنصر span المضمن ، يمكنك وضع العديد من العناصر على نفس السطر ، وحتى وضع أجزاء مختلفة من نفس السطر بشكل مختلف. عش كلمة "love" في عنصر "Things cats love" الخاص بك أدناه داخل عنصر span . ثم إعطاء التي span الطبقة text-danger لجعل أحمر النص. في ما يلي كيفية القيام بذلك باستخدام عنصر "أهم ثلاثة أشياء للقطط التي تكره": <p>Top 3 things cats <span class="text-danger">hate:</span></p>
    + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert($("p span") && $("p span").length > 0, "Your span element should be inside your p element.");' + - text: يجب أن يحتوي عنصر span الخاص بك على نص love فقط. + testString: 'assert($("p span") && $("p span").text().match(/love/i) && !$("p span").text().match(/Things cats/i), "Your span element should have just the text love.");' + - text: '' + testString: 'assert($("span").hasClass("text-danger"), "Your span element should have class text-danger.");' + - text: '' + testString: 'assert(code.match(/<\/span>/g) && code.match(//g).length === code.match(/span element has a closing tag.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + + +
    +

    CatPhotoApp

    + + A cute orange cat lying on its back. + + Three kittens running towards the camera. +
    +
    + +
    +
    + +
    +
    + +
    +
    +

    Things cats love:

    +
      +
    • cat nip
    • +
    • laser pointers
    • +
    • lasagna
    • +
    +

    Top 3 things cats hate:

    +
      +
    1. flea treatment
    2. +
    3. thunder
    4. +
    5. other cats
    6. +
    +
    + + + + + + + +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/use-comments-to-clarify-code.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/use-comments-to-clarify-code.arabic.md new file mode 100644 index 0000000000..e352456e74 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/use-comments-to-clarify-code.arabic.md @@ -0,0 +1,75 @@ +--- +id: bad87fee1348bd9aec908857 +title: Use Comments to Clarify Code +challengeType: 0 +videoUrl: '' +localeTitle: '' +--- + +## Description +
    عندما نبدأ باستخدام jQuery ، سنقوم بتعديل عناصر HTML دون الحاجة إلى تغييرها فعليًا في HTML. دعونا نتأكد من أن الجميع يعرف أنه لا يجب عليهم تعديل أي من هذه الشفرات بشكل مباشر. تذكر أنه يمكنك بدء تعليق باستخدام <!-- وإنهاء تعليق باستخدام --> إضافة تعليق أعلى HTML الخاص بك يقول Only change code above this line.
    + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: بدء تعليق مع <!-- في أعلى HTML الخاص بك. + testString: 'assert(code.match(/^\s*.*this line))\s*.*this line.*\s*-->/gi), "Your comment should have the text Only change code above this line.");' + - text: تأكد من إغلاق تعليقك --> . + testString: 'assert(code.match(/-->.*\n+.+/g), "Be sure to close your comment with -->.");' + - text: يجب أن يكون لديك نفس العدد من الفتاحات والإغلاق. + testString: 'assert(code.match(//g).length, "You should have the same number of comment openers and closers.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html +
    +

    jQuery Playground

    +
    +
    +

    #left-well

    +
    + + + +
    +
    +
    +

    #right-well

    +
    + + + +
    +
    +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/use-responsive-design-with-bootstrap-fluid-containers.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/use-responsive-design-with-bootstrap-fluid-containers.arabic.md new file mode 100644 index 0000000000..e6f4d302e5 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/use-responsive-design-with-bootstrap-fluid-containers.arabic.md @@ -0,0 +1,107 @@ +--- +id: bad87fee1348bd9acde08712 +title: Use Responsive Design with Bootstrap Fluid Containers +challengeType: 0 +videoUrl: '' +localeTitle: استخدام تصميم متجاوب مع حاويات السوائل Bootstrap +--- + +## Description +
    في قسم HTML5 و CSS من برنامج FreeCodeCamp ، أنشأنا تطبيق صور Cat. الآن دعونا نعود إليها. في هذه المرة ، سنقوم بإعداده باستخدام إطار عمل Bootstrap المتجاوب لـ CSS. سيحدد Bootstrap مدى اتساع الشاشة ويستجيب عن طريق تغيير حجم عناصر HTML - ومن هنا يكون اسم " Responsive Design . مع تصميم متجاوب ، ليست هناك حاجة لتصميم نسخة محمولة من موقع الويب الخاص بك. سوف تبدو جيدة على الأجهزة ذات الشاشات من أي عرض. يمكنك إضافة Bootstrap إلى أي تطبيق بإضافة التعليمة البرمجية التالية إلى أعلى HTML: <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"/> في هذه الحالة ، قمنا بالفعل بإضافته لك إلى هذه الصفحة من وراء الكواليس. لاحظ أن استخدام > أو /> لإغلاق علامة link أمر مقبول. للبدء ، يجب علينا تضمين جميع HTML (باستثناء علامة link وعنصر style ) في عنصر div باستخدام container-fluid للفئة.
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يحتوي عنصر div container-fluid الفصل. + testString: 'assert($("div").hasClass("container-fluid"), "Your div element should have the class container-fluid.");' + - text: تأكد من أن عنصر div يحتوي على علامة إغلاق. + testString: 'assert(code.match(/<\/div>/g) && code.match(/
    /g).length === code.match(/
    div element has a closing tag.");' + - text: تأكد من تداخل جميع عناصر HTML بعد علامة style الإغلاق في .container-fluid . + testString: 'assert($(".container-fluid").children().length >= 8, "Make sure you have nested all HTML elements after the closing style tag in .container-fluid.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + + +

    CatPhotoApp

    + +

    Click here for cat photos.

    + +A cute orange cat lying on its back. + +

    Things cats love:

    + +

    Top 3 things cats hate:

    +
      +
    1. flea treatment
    2. +
    3. thunder
    4. +
    5. other cats
    6. +
    +
    + + + + + + + +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/use-the-bootstrap-grid-to-put-elements-side-by-side.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/use-the-bootstrap-grid-to-put-elements-side-by-side.arabic.md new file mode 100644 index 0000000000..721037ba4a --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/use-the-bootstrap-grid-to-put-elements-side-by-side.arabic.md @@ -0,0 +1,114 @@ +--- +id: bad88fee1348ce8acef08815 +title: Use the Bootstrap Grid to Put Elements Side By Side +challengeType: 0 +videoUrl: '' +localeTitle: استخدم شبكة Bootstrap لوضع عناصر جنبًا إلى جنب +--- + +## Description +
    يستخدم Bootstrap نظام شبكة متجاوزة من 12 عمودًا ، مما يجعل من السهل وضع العناصر في صفوف وتحديد العرض النسبي لكل عنصر. يمكن تطبيق معظم طبقات Bootstrap على عنصر div . يحتوي Bootstrap على خصائص عرض العمود المختلفة التي يستخدمها بناءً على مدى اتساع شاشة المستخدم. على سبيل المثال ، تشتمل الهواتف على شاشات ضيقة ، كما تحتوي أجهزة الكمبيوتر المحمولة على شاشات أوسع. خذ على سبيل المثال الطبقة col-md-* في Bootstrap. هنا ، md تعني medium ، و * هو رقم يحدد عدد الأعمدة التي يجب أن يكون العنصر فيها. في هذه الحالة ، يتم تحديد عرض العمود لعنصر على شاشة متوسطة الحجم ، مثل الكمبيوتر المحمول. في تطبيق Cat Photo الذي نقوم ببنائه ، سنستخدم col-xs-* ، حيث xs تعني مساحة صغيرة جدًا (مثل شاشة الهاتف المحمول الصغيرة جدًا) ، و * هو عدد الأعمدة التي تحدد عدد الأعمدة على نطاق واسع يجب أن يكون العنصر. ضع زري " Like و " Info و " Delete جنبًا إلى جنب من خلال تضمين كل ثلاثة منهم في عنصر واحد <div class="row"> ، ثم كل واحد منهم داخل عنصر <div class="col-xs-4"> . يتم تطبيق فئة row على div ، ويمكن أن تتداخل الأزرار نفسها داخلها.
    + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert($("div.row:has(button)").length > 0, "Your buttons should all be nested within the same div element with the class row.");' + - text: يجب أن يكون كل زر من أزرار Bootstrap متداخلًا داخل عنصر div الخاص به باستخدام الفئة col-xs-4 . + testString: 'assert($("div.col-xs-4:has(button)").length > 2, "Each of your Bootstrap buttons should be nested within its own div element with the class col-xs-4.");' + - text: '' + testString: 'assert(code.match(/<\/button>/g) && code.match(/
    + +## Challenge Seed +
    + +
    + +```html + + + +
    +

    CatPhotoApp

    + +

    Click here for cat photos.

    + + A cute orange cat lying on its back. + + Three kittens running towards the camera. + + + +

    Things cats love:

    +
      +
    • cat nip
    • +
    • laser pointers
    • +
    • lasagna
    • +
    +

    Top 3 things cats hate:

    +
      +
    1. flea treatment
    2. +
    3. thunder
    4. +
    5. other cats
    6. +
    +
    + + + + + + + +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/warn-your-users-of-a-dangerous-action-with-btn-danger.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/warn-your-users-of-a-dangerous-action-with-btn-danger.arabic.md new file mode 100644 index 0000000000..c2bdb27aeb --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/bootstrap/warn-your-users-of-a-dangerous-action-with-btn-danger.arabic.md @@ -0,0 +1,113 @@ +--- +id: bad87fee1348ce8acef08814 +title: Warn Your Users of a Dangerous Action with btn-danger +challengeType: 0 +videoUrl: '' +localeTitle: تحذير مستخدمي موقعك من عمل خطير مع خطر btn +--- + +## Description +
    يأتي Bootstrap مع العديد من الألوان المحددة مسبقًا للأزرار. فئة btn-danger هي لون الزر الذي ستستخدمه لإعلام المستخدمين بأن الزر يقوم بإجراء مدمر ، مثل حذف صورة قطة. إنشاء زر مع النص "حذف" وإعطائها فئة btn-danger . لاحظ أن هذه الأزرار لا تزال بحاجة إلى فئات btn و btn-block .
    + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: إنشاء عنصر button جديد مع النص "حذف". + testString: 'assert(new RegExp("Delete","gi").test($("button").text()), "Create a new button element with the text "Delete".");' + - text: '' + testString: 'assert($("button.btn-block.btn").length > 2, "All of your Bootstrap buttons should have the btn and btn-block classes.");' + - text: يجب أن يكون لديك الزر الجديد فئة btn-danger . + testString: 'assert($("button").hasClass("btn-danger"), "Your new button should have the class btn-danger.");' + - text: تأكد من أن جميع عناصر button لديك بها علامة إغلاق. + testString: 'assert(code.match(/<\/button>/g) && code.match(/
    + +## Challenge Seed +
    + +
    + +```html + + + +
    +

    CatPhotoApp

    + +

    Click here for cat photos.

    + + A cute orange cat lying on its back. + + Three kittens running towards the camera. + + +

    Things cats love:

    +
      +
    • cat nip
    • +
    • laser pointers
    • +
    • lasagna
    • +
    +

    Top 3 things cats hate:

    +
      +
    1. flea treatment
    2. +
    3. thunder
    4. +
    5. other cats
    6. +
    +
    + + + + + + + +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/front-end-libraries-projects/build-a-drum-machine.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/front-end-libraries-projects/build-a-drum-machine.arabic.md new file mode 100644 index 0000000000..8523f62f1c --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/front-end-libraries-projects/build-a-drum-machine.arabic.md @@ -0,0 +1,38 @@ +--- +id: 587d7dbc367417b2b2512bae +title: Build a Drum Machine +isRequired: true +challengeType: 3 +videoUrl: '' +localeTitle: بناء آلة طبل +--- + +## Description +
    الهدف: إنشاء تطبيق CodePen.io تشبه وظيفيًا هذا: https://codepen.io/freeCodeCamp/full/MJyNMd . تحقق من قصص المستخدمين أدناه واجتاز جميع الاختبارات. اعطها اسلوبك الشخصي. يمكنك استخدام أي مزيج من HTML و JavaScript و CSS و Bootstrap و SASS و React و Redux و jQuery لإكمال هذا المشروع. يجب عليك استخدام إطار الواجهة الأمامية (مثل React على سبيل المثال) لأن هذا القسم يدور حول تعلم إطارات الواجهة الأمامية. لا يوصى باستخدام تقنيات إضافية غير مدرجة أعلاه واستخدامها على مسؤوليتك الخاصة. نحن نتطلع إلى دعم أطر عمل الواجهة الأخرى مثل Angular و Vue ، ولكنها غير مدعومة حاليًا. سنقبل ونحاول إصلاح جميع تقارير المشكلات التي تستخدم مجموعة التكنولوجيا المقترحة لهذا المشروع. الترميز سعيدة! قصة المستخدم رقم 1: ينبغي أن أتمكن من رؤية حاوية خارجية تحتوي على id="drum-machine" أداة id="drum-machine" تحتوي على جميع العناصر الأخرى. قصة المستخدم رقم 2: داخل #drum-machine أستطيع أن أرى عنصرًا به id="display" مناظر id="display" . قصة المستخدم رقم 3: داخل #drum-machine يمكنني رؤية 9 عناصر لوحة اسطوانة قابلة للنقر ، لكل منها اسم صنف من drum-pad ، وهو معرف فريد يصف المقطع الصوتي الذي سيتم إعداده على لوحة السماعة ، النص الذي يتوافق مع أحد المفاتيح التالية على لوحة المفاتيح: Q ، W ، E ، A ، S ، D ، Z ، X ، C. يجب أن تكون وسادات الأسطوانة بهذا الترتيب. قصة المستخدم 4: داخل كل .drum-pad ، يجب أن يكون هناك عنصر audio HTML5 يحتوي على سمة src تشير إلى مقطع صوتي ، واسم clip ، ومعرف مطابق للنص الداخلي .drum-pad (على سبيل المثال id="Q" ، id="W" ، id="E" إلخ.). قصة المستخدم رقم 5: عندما أنقر على عنصر .drum-pad ، يجب تشغيل المقطع الصوتي الموجود في عنصر audio الطفل الخاص به. قصة المستخدم رقم 6: عندما أضغط مفتاح المشغل المرتبط بكل .drum-pad ، يجب تشغيل المقطع الصوتي الموجود في عنصر audio الطفل الخاص به (على سبيل المثال ، الضغط على المفتاح Q يؤدي إلى تشغيل لوحة الأسطوانة التي تحتوي على السلسلة "Q" ، الضغط على المفتاح W يجب أن يؤدي إلى تشغيل لوحة البراميل التي تحتوي على السلسلة "W" ، وما إلى ذلك). قصة المستخدم رقم 7: عندما يتم تشغيل .drum-pad يتم عرض سلسلة تصف المقطع الصوتي المرتبط كنص داخلي للعنصر #display (يجب أن تكون كل سلسلة فريدة). يمكنك بناء مشروعك عن طريق تسجيل قلم CodePen هذا . أو يمكنك استخدام رابط CDN هذا لتشغيل الاختبارات في أي بيئة تفضلها: https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js بمجرد الانتهاء ، أرسل عنوان URL إلى عملك مشروع مع كل اختباراتها تمر. تذكر استخدام طريقة Read-Search-Ask إذا واجهتك مشكلة.
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: [] + +``` + +
    + +## Challenge Seed +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/front-end-libraries-projects/build-a-javascript-calculator.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/front-end-libraries-projects/build-a-javascript-calculator.arabic.md new file mode 100644 index 0000000000..36536ed38e --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/front-end-libraries-projects/build-a-javascript-calculator.arabic.md @@ -0,0 +1,38 @@ +--- +id: bd7158d8c442eddfaeb5bd17 +title: Build a JavaScript Calculator +challengeType: 3 +isRequired: true +videoUrl: '' +localeTitle: بناء حاسبة جافا سكريبت +--- + +## Description +
    الهدف: إنشاء تطبيق CodePen.io تشبه وظيفيًا هذا: https://codepen.io/freeCodeCamp/full/wgGVVX . تحقق من قصص المستخدمين أدناه واجتاز جميع الاختبارات. اعطها اسلوبك الشخصي. يمكنك استخدام أي مزيج من HTML و JavaScript و CSS و Bootstrap و SASS و React و Redux و jQuery لإكمال هذا المشروع. يجب عليك استخدام إطار الواجهة الأمامية (مثل React على سبيل المثال) لأن هذا القسم يدور حول تعلم إطارات الواجهة الأمامية. لا يوصى باستخدام تقنيات إضافية غير مدرجة أعلاه واستخدامها على مسؤوليتك الخاصة. نحن نتطلع إلى دعم أطر عمل الواجهة الأخرى مثل Angular و Vue ، ولكنها غير مدعومة حاليًا. سنقبل ونحاول إصلاح جميع تقارير المشكلات التي تستخدم مجموعة التكنولوجيا المقترحة لهذا المشروع. الترميز سعيدة! قصة المستخدم رقم 1: يجب أن تحتوي الحاسبة الخاصة بي على عنصر قابل للنقر يحتوي على = (علامة مساواة) مع id="equals" مناظر id="equals" . قصة المستخدم رقم 2: يجب أن تحتوي الحاسبة الخاصة بي على 10 عناصر قابلة للنقر تحتوي على رقم واحد لكل من 0-9 ، مع المعرفات المقابلة التالية: id="zero" ، id="one" ، id="two" ، id="three" و id="four" و id="five" و id="six" و id="seven" و id="eight" و id="nine" . قصة المستخدم رقم 3: يجب أن تحتوي الحاسبة الخاصة بي على 4 عناصر قابلة للنقر تحتوي كل واحدة منها على واحدة من 4 عوامل رياضية أولية لها المعرفات المقابلة التالية: id="add" ، id="subtract" ، id="multiply" ، id="divide" . قصة المستخدم رقم 4: يجب أن تحتوي الحاسبة الخاصة بي على عنصر قابل للنقر يحتوي على . (علامة عشرية) مع id="decimal" المقابلة id="decimal" . قصة المستخدم رقم 5: يجب أن تحتوي الحاسبة الخاصة بي على عنصر قابل للنقر به id="clear" . قصة المستخدم رقم 6: يجب أن تحتوي الحاسبة الخاصة بي على عنصر لعرض قيم ذات id="display" مناظر id="display" . قصة المستخدم رقم 7: في أي وقت ، يؤدي الضغط على الزر "مسح" إلى مسح قيم المدخلات والمخرجات ، ثم إرجاع الآلة الحاسبة إلى حالتها المبدئية ؛ 0 يجب أن يظهر في العنصر مع معرف display . قصة المستخدم رقم 8: عندما أقوم بإدخال الأرقام ، ينبغي أن أتمكن من رؤية الإدخال الخاص بي في العنصر مع معرف display . قصة المستخدم رقم 9: في أي ترتيب ، يجب أن أتمكن من إضافة سلسلة من الأرقام بأي طول وطرحها وضربها وقسمتها ، وعندما أضغط = ، يجب أن تظهر النتيجة الصحيحة في العنصر ذي معرّف display . قصة المستخدم رقم 10: عند إدخال الأرقام ، يجب ألا تسمح الحاسبة الخاصة بي ببدء عدد من الأصفار متعددة. قصة العضو رقم 11: عند النقر فوق عنصر عشري، و . يجب إلحاقها بالقيمة المعروضة حاليًا ؛ اثنان . في رقم واحد لا ينبغي قبوله. قصة المستخدم رقم 12: يجب أن أتمكن من تنفيذ أي عملية (+ ، - ، * ، /) على الأرقام التي تحتوي على نقاط عشرية. قصة المستخدم رقم 13: إذا تم إدخال مشغلين أو أكثر على التوالي ، فيجب أن تكون العملية التي تم تنفيذها هي آخر مشغل تم إدخاله. قصة المستخدم رقم 14: الضغط على المشغل الذي يلي مباشرة = يجب أن يبدأ عملية حسابية جديدة تعمل على نتيجة التقييم السابق. قصة المستخدم رقم 15: يجب أن تحتوي الحاسبة الخاصة بي على عدة أماكن عشرية من الدقة عندما يتعلق الأمر بالتقريب (لاحظ أنه لا يوجد معيار دقيق ، ولكن يجب أن تكون قادرًا على التعامل مع العمليات الحسابية مثل 2 / 7 بدقة معقولة إلى 4 منازل عشرية على الأقل) . ملاحظة حول منطق الآلة الحاسبة: يجب ملاحظة أن هناك مدرستين أساسيتين للتفكير في منطق إدخال الآلة الحاسبة: منطق التنفيذ الفوري ومنطق الصيغة . يستخدم مثالنا منطق الصيغة ويلاحظ ترتيب عملية الأسبقية ، التنفيذ الفوري لا. أيهما مقبول ، ولكن يرجى ملاحظة أنه اعتمادا على الاختيار الذي تختاره ، قد تحقق الآلة الحاسبة نتائج مختلفة عن نتائج المعادلات الخاصة بنا (انظر المثال أدناه). طالما يمكن التحقق من الحساب الخاص بك بواسطة حاسبة إنتاج أخرى ، فالرجاء عدم اعتبار هذا خطأ. مثال: 3 + 5 x 6 - 2 / 4 =
    يمكنك بناء مشروعك عن طريق تسجيل قلم CodePen هذا . أو يمكنك استخدام رابط CDN هذا لتشغيل الاختبارات في أي بيئة تفضلها: https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js بمجرد الانتهاء ، أرسل عنوان URL إلى عملك مشروع مع كل اختباراتها تمر. تذكر استخدام طريقة Read-Search-Ask إذا واجهتك مشكلة.
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: [] + +``` + +
    + +## Challenge Seed +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/front-end-libraries-projects/build-a-markdown-previewer.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/front-end-libraries-projects/build-a-markdown-previewer.arabic.md new file mode 100644 index 0000000000..364f241eef --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/front-end-libraries-projects/build-a-markdown-previewer.arabic.md @@ -0,0 +1,38 @@ +--- +id: bd7157d8c242eddfaeb5bd13 +title: Build a Markdown Previewer +isRequired: true +challengeType: 3 +videoUrl: '' +localeTitle: بناء على Markdown Previewer +--- + +## Description +
    الهدف: إنشاء تطبيق CodePen.io تشبه وظيفيًا هذا: https://codepen.io/freeCodeCamp/full/GrZVVO . تحقق من قصص المستخدمين أدناه واجتاز جميع الاختبارات. اعطها اسلوبك الشخصي. يمكنك استخدام أي مزيج من HTML و JavaScript و CSS و Bootstrap و SASS و React و Redux و jQuery لإكمال هذا المشروع. يجب عليك استخدام إطار الواجهة الأمامية (مثل React على سبيل المثال) لأن هذا القسم يدور حول تعلم إطارات الواجهة الأمامية. لا يوصى باستخدام تقنيات إضافية غير مدرجة أعلاه واستخدامها على مسؤوليتك الخاصة. نحن نتطلع إلى دعم أطر عمل الواجهة الأخرى مثل Angular و Vue ، ولكنها غير مدعومة حاليًا. سنقبل ونحاول إصلاح جميع تقارير المشكلات التي تستخدم مجموعة التكنولوجيا المقترحة لهذا المشروع. الترميز سعيدة! قصة المستخدم رقم 1: يمكنني رؤية عنصر textarea مع id="editor" المقابلة id="editor" . قصة المستخدم رقم 2: يمكنني رؤية عنصر له id="preview" مناظر id="preview" . قصة المستخدم رقم 3: عند إدخال نص في عنصر #editor ، يتم تحديث عنصر #preview أثناء الكتابة لعرض محتوى النص. قصة المستخدم رقم 4: عندما أقوم بإدخال #editor GitHub في عنصر #editor ، يتم عرض النص على هيئة HTML في عنصر #preview أثناء الكتابة (HINT: لست بحاجة إلى تحليل Markdown بنفسك - يمكنك استيراد المكتبة المحددة لهذا: https://cdnjs.com/libraries/marked ). قصة المستخدم رقم 5: عندما يتم أولاً تحميل أداة معاينة #editor يجب أن يحتوي النص الافتراضي في الحقل #editor على #editor صالحة تمثل عنصرًا واحدًا على الأقل من كل عنصر من العناصر التالية: رأس (حجم H1) ، رأس فرعي (حجم H2) ، ورابط ، ورمز مضمّن ، وكتلة برمجية ، وبند قائمة ، وقطعة اقتباس ، وصورة ، ونص غامق. قصة المستخدم رقم 6: عندما يتم أولاً تحميل أداة معاينة #editor يجب أن يتم عرض #editor حقل #editor على #editor HTML في عنصر #preview . مكافأة اختيارية (لا تحتاج إلى إجراء اختبار تجريبي): يفسر أداة معاينة العلامة التجارية الخاصة بي إرجاع الإرجاع وتجعلها كعناصر br (فواصل الأسطر). يمكنك بناء مشروعك عن طريق تسجيل قلم CodePen هذا . أو يمكنك استخدام رابط CDN هذا لتشغيل الاختبارات في أي بيئة تفضلها: https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js بمجرد الانتهاء ، أرسل عنوان URL إلى عملك مشروع مع كل اختباراتها تمر. تذكر استخدام طريقة Read-Search-Ask إذا واجهتك مشكلة.
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: [] + +``` + +
    + +## Challenge Seed +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/front-end-libraries-projects/build-a-pomodoro-clock.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/front-end-libraries-projects/build-a-pomodoro-clock.arabic.md new file mode 100644 index 0000000000..2c743672f6 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/front-end-libraries-projects/build-a-pomodoro-clock.arabic.md @@ -0,0 +1,38 @@ +--- +id: bd7158d8c442eddfaeb5bd0f +title: Build a Pomodoro Clock +isRequired: true +challengeType: 3 +videoUrl: '' +localeTitle: بناء على مدار الساعة بومودورو +--- + +## Description +
    الهدف: إنشاء تطبيق CodePen.io تشبه وظيفيًا هذا: https://codepen.io/freeCodeCamp/full/XpKrrW . تحقق من قصص المستخدمين أدناه واجتاز جميع الاختبارات. اعطها اسلوبك الشخصي. يمكنك استخدام أي مزيج من HTML و JavaScript و CSS و Bootstrap و SASS و React و Redux و jQuery لإكمال هذا المشروع. يجب عليك استخدام إطار الواجهة الأمامية (مثل React على سبيل المثال) لأن هذا القسم يدور حول تعلم إطارات الواجهة الأمامية. لا يوصى باستخدام تقنيات إضافية غير مدرجة أعلاه واستخدامها على مسؤوليتك الخاصة. نحن نتطلع إلى دعم أطر عمل الواجهة الأخرى مثل Angular و Vue ، ولكنها غير مدعومة حاليًا. سنقبل ونحاول إصلاح جميع تقارير المشكلات التي تستخدم مجموعة التكنولوجيا المقترحة لهذا المشروع. الترميز سعيدة! قصة المستخدم رقم 1: يمكنني رؤية عنصر به id="break-label" يحتوي على سلسلة (مثل "Break Length"). قصة المستخدم رقم 2: يمكنني رؤية عنصر له id="session-label" يحتوي على سلسلة (مثل "طول الجلسة"). قصة المستخدم رقم 3: يمكنني رؤية عنصرين قابلين للنقر مع المعرفات المقابلة: id="break-decrement" و id="session-decrement" . قصة المستخدم رقم 4: يمكنني رؤية عنصرين قابلين للنقر مع المعرفات المقابلة: id="break-increment" و id="session-increment" . قصة المستخدم رقم 5: يمكنني رؤية عنصر له id="break-length" ، والذي يعرض افتراضيًا (عند التحميل) قيمة 5. قصة المستخدم رقم 6: يمكنني رؤية عنصر له id="session-length" مناظر id="session-length" ، والتي تعرض افتراضيًا قيمة 25. قصة المستخدم رقم 7: يمكنني رؤية عنصر له id="timer-label" المقابلة id="timer-label" ، يحتوي على سلسلة تشير إلى جلسة تمت تهيئتها (على سبيل المثال" جلسة ") . قصة المستخدم رقم 8: يمكنني رؤية عنصر له id="time-left" . ملاحظة: متوقفة مؤقتًا أو قيد التشغيل ، يجب دائمًا عرض القيمة في هذا الحقل بتنسيق mm:ss (أي 25:00). قصة المستخدم رقم 9: يمكنني رؤية عنصر قابل للنقر به id="start_stop" مناظر id="start_stop" . قصة المستخدم رقم 10: يمكنني رؤية عنصر قابل للنقر به id="reset" مناظر id="reset" . قصة المستخدم رقم 11: عندما أنقر على العنصر الذي يحتوي على معرف reset ، يجب إيقاف أي موقت تشغيل ، يجب أن ترجع القيمة في id="break-length" إلى 5 ، فيجب أن ترجع القيمة داخل id="session-length" إلى 25 ، والعنصر الذي له id="time-left" يجب إعادة تعيينه إلى حالته الافتراضية. قصة المستخدم رقم 12: عندما أنقر على العنصر بمعرّف break-decrement ، فإن القيمة ضمن break-decrement id="break-length" بقيمة 1 ، ويمكنني رؤية القيمة المحدّثة. قصة المستخدم رقم 13: عندما أنقر على العنصر الذي يحتوي على معرّف break-increment ، فإن القيمة ضمن break-increment id="break-length" بقيمة 1 ، ويمكنني رؤية القيمة المحدّثة. قصة المستخدم رقم 14: عندما أنقر على العنصر بمعرّف session-decrement ، فإن القيمة ضمن session-decrement id="session-length" بقيمة 1 ، ويمكنني رؤية القيمة المحدّثة. قصة المستخدم رقم 15: عندما أنقر على العنصر بمعرّف session-increment ، فإن القيمة ضمن قيمة id="session-length" بقيمة 1 ، ويمكنني رؤية القيمة المحدّثة. قصة المستخدم رقم 16: لا يجب أن أتمكن من تعيين جلسة أو طول للكسر إلى <= 0. قصة المستخدم رقم 17: لا ينبغي أن أتمكن من تعيين جلسة أو طول للكسر إلى> 60. قصة المستخدم رقم 18: عندما أكون أولاً ، انقر فوق العنصر مع id="start_stop" ، يجب أن يبدأ تشغيل جهاز ضبط الوقت من القيمة المعروضة حاليًا في id="session-length" ، حتى إذا تم زيادة القيمة أو إنقاصها من القيمة الأصلية لـ 25. قصة المستخدم رقم 19 : إذا كان المؤقت يعمل ، فيجب أن يعرض العنصر ذو معرف time-left الوقت المتبقي بتنسيق mm:ss (يتناقص بقيمة 1 وتحديث العرض كل 1000ms). قصة المستخدم رقم 20: إذا كان المؤقت يعمل id="start_stop" على العنصر الذي يحمل id="start_stop" ، فيجب أن يتوقف العد التنازلي. قصة المستخدم رقم 21: إذا تم إيقاف المؤقت مؤقتًا ، id="start_stop" على العنصر ذي id="start_stop" ، فيجب استئناف تشغيل العد التنازلي من النقطة التي تم إيقافها مؤقتًا فيها. قصة المستخدم رقم 22: عندما يصل العد التنازلي للجلسة إلى الصفر (ملاحظة: يجب أن يصل الموقت إلى 00:00) ، ويبدأ العد التنازلي الجديد ، يجب أن يعرض العنصر ذو معرف timer-label سلسلة تشير إلى بداية فاصل. قصة المستخدم رقم 23: عندما يصل العد التنازلي للجلسة إلى الصفر (ملاحظة: يجب أن يصل الموقت إلى 00:00) ، يجب أن يبدأ العد التنازلي للفصل الجديد ، مع احتسابه من القيمة المعروضة حاليًا في عنصر id="break-length" . قصة المستخدم رقم 24: عندما يصل العد التنازلي للكسر إلى الصفر (ملاحظة: يجب أن يصل الموقت إلى 00:00) ، ويبدأ العد التنازلي الجديد ، يجب أن يعرض العنصر ذو معرف timer-label سلسلة تشير إلى بدء جلسة. قصة المستخدم رقم 25: عندما يصل العد التنازلي للكسر إلى الصفر (ملاحظة: يجب أن يصل الموقت إلى 00:00) ، يجب أن يبدأ العد التنازلي للجلسة الجديدة ، مع احتساب القيمة من القيمة المعروضة حاليًا في عنصر id="session-length" . قصة المستخدم رقم 26: عندما يصل العد التنازلي إلى الصفر (ملاحظة: يجب أن يصل الموقت إلى 00:00) ، يجب تشغيل صوت يشير إلى أن الوقت قد انتهى. يجب أن يستخدم هذا علامة audio HTML5 ويكون له id="beep" . قصة المستخدم رقم 27: يجب أن يكون عنصر الصوت الذي يحتوي على id="beep" ثانية واحدة أو أكثر. قصة المستخدم رقم 28: يجب إيقاف تشغيل العنصر الصوتي بمعرف beep ويتم إعادة لفه إلى البداية عند النقر فوق العنصر الذي يحتوي على معرف reset التعيين. يمكنك بناء مشروعك عن طريق تسجيل قلم CodePen هذا . أو يمكنك استخدام رابط CDN هذا لتشغيل الاختبارات في أي بيئة تفضلها: https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js بمجرد الانتهاء ، أرسل عنوان URL إلى عملك مشروع مع كل اختباراتها تمر. تذكر استخدام طريقة Read-Search-Ask إذا واجهتك مشكلة.
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: [] + +``` + +
    + +## Challenge Seed +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/front-end-libraries-projects/build-a-random-quote-machine.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/front-end-libraries-projects/build-a-random-quote-machine.arabic.md new file mode 100644 index 0000000000..8515b02ae9 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/front-end-libraries-projects/build-a-random-quote-machine.arabic.md @@ -0,0 +1,38 @@ +--- +id: bd7158d8c442eddfaeb5bd13 +title: Build a Random Quote Machine +isRequired: true +challengeType: 3 +videoUrl: '' +localeTitle: بناء آلة اقتباس عشوائي +--- + +## Description +
    الهدف: إنشاء تطبيق CodePen.io تشبه وظيفيًا هذا: https://codepen.io/freeCodeCamp/full/qRZeGZ . تحقق من قصص المستخدمين أدناه واجتاز جميع الاختبارات. اعطها اسلوبك الشخصي. يمكنك استخدام أي مزيج من HTML و JavaScript و CSS و Bootstrap و SASS و React و Redux و jQuery لإكمال هذا المشروع. يجب عليك استخدام إطار الواجهة الأمامية (مثل React على سبيل المثال) لأن هذا القسم يدور حول تعلم إطارات الواجهة الأمامية. لا يوصى باستخدام تقنيات إضافية غير مدرجة أعلاه واستخدامها على مسؤوليتك الخاصة. نحن نتطلع إلى دعم أطر عمل الواجهة الأخرى مثل Angular و Vue ، ولكنها غير مدعومة حاليًا. سنقبل ونحاول إصلاح جميع تقارير المشكلات التي تستخدم مجموعة التكنولوجيا المقترحة لهذا المشروع. الترميز سعيدة! قصة المستخدم رقم 1: يمكنني رؤية عنصر مجمّع ذو id="quote-box" مناظر id="quote-box" . قصة المستخدم رقم 2: داخل #quote-box ، يمكنني رؤية عنصر له id="text" . قصة المستخدم رقم 3: داخل #quote-box ، يمكنني رؤية عنصر له id="author" . قصة المستخدم رقم 4: داخل #quote-box ، يمكنني رؤية عنصر قابل للنقر به id="new-quote" مناظر id="new-quote" . قصة المستخدم رقم 5: داخل #quote-box ، أستطيع أن أرى كلمة قابلة للنقر مع id="tweet-quote" المقابلة id="tweet-quote" . قصة المستخدم رقم 6: عند التحميل الأول ، يعرض جهاز عرض الأسعار اقتباسًا عشوائيًا في العنصر مع id="text" . قصة المستخدم رقم 7: عند التحميل الأول ، يعرض جهاز عرض الأسعار الخاص بي مؤلف الاقتباس العشوائي في العنصر مع id="author" . قصة المستخدم رقم 8: عندما يتم النقر على الزر #new-quote ، يجب أن يجلب جهاز عرض الأسعار الخاص بي عرض أسعار جديدًا #text عنصر #text . قصة المستخدم رقم 9: يجب أن تحضر جهاز عرض الأسعار الخاص بي مؤلف الاقتباس الجديد عندما يتم النقر على زر #new-quote وعرضه في عنصر #author . قصة المستخدم # 10: أستطيع أن تغرد الاقتباس الحالي بالضغط على #tweet-quote a العنصر. هذا a ينبغي أن تتضمن عنصرا من "twitter.com/intent/tweet" المسار في انها href السمة إلى تغرد الاقتباس الحالي. قصة المستخدم رقم 11: يجب أن يكون عنصر مجمّع #quote-box أفقيًا في الوسط. يرجى تشغيل اختبارات بمستوى التكبير في المتصفح بنسبة 100٪ وزيادة حجم الصفحة. يمكنك بناء مشروعك عن طريق تسجيل قلم CodePen هذا . أو يمكنك استخدام رابط CDN هذا لتشغيل الاختبارات في أي بيئة تفضلها: https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js بمجرد الانتهاء ، أرسل عنوان URL إلى عملك مشروع مع كل اختباراتها تمر. تذكر استخدام طريقة Read-Search-Ask إذا واجهتك مشكلة.
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: [] + +``` + +
    + +## Challenge Seed +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/jquery/change-text-inside-an-element-using-jquery.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/jquery/change-text-inside-an-element-using-jquery.arabic.md new file mode 100644 index 0000000000..7ff16c78a9 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/jquery/change-text-inside-an-element-using-jquery.arabic.md @@ -0,0 +1,87 @@ +--- +id: 564944c91be2204b269d51e3 +title: Change Text Inside an Element Using jQuery +challengeType: 6 +videoUrl: '' +localeTitle: '' +--- + +## Description +
    باستخدام jQuery ، يمكنك تغيير النص بين علامات البداية والنهاية للعنصر. يمكنك حتى تغيير ترميز HTML. يحتوي jQuery على وظيفة تسمى .html() تسمح لك بإضافة علامات HTML ونص داخل عنصر. سيتم استبدال أي محتوى سابق داخل العنصر تمامًا بالمحتوى الذي تقدمه باستخدام هذه الوظيفة. فيما يلي كيفية كتابة نص عنواننا والتأكيد عليه: $("h3").html("<em>jQuery Playground</em>"); يحتوي jQuery أيضًا على دالة مشابهة تُسمى .text() تقوم فقط بتغيير النص دون إضافة علامات. بمعنى آخر ، لن تقوم هذه الوظيفة بتقييم أية علامات HTML تم تمريرها إليها ، ولكن بدلاً من ذلك ستعاملها على أنها النص الذي تريد استبدال المحتوى الموجود به. تغيير الزر مع معرف target4 بواسطة التأكيد على النص الخاص به. تحقق هذا الرابط لمعرفة المزيد حول الفرق بين <i> و <em> واستخداماتها. لاحظ أنه في حين تم استخدام العلامة <i> للتأكيد على النص ، فقد تم استخدامه منذ ذلك الحين كعلامة للأيقونات. أصبحت العلامة <em> الآن مقبولة على نطاق واسع كعلامة للتأكيد. إما أن تعمل من أجل هذا التحدي.
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: قم target4 النص الموجود في الزر target4 الخاص بك بإضافة علامات HTML. + testString: 'assert.isTrue((/|\s*#target4\s*<\/em>|<\/i>/gi).test($("#target4").html()), "Emphasize the text in your target4 button by adding HTML tags.");' + - text: تأكد من أن النص لم يتغير. + testString: 'assert($("#target4") && $("#target4").text().trim() === "#target4", "Make sure the text is otherwise unchanged.");' + - text: '' + testString: 'assert.isFalse((/|/gi).test($("h3").html()), "Do not alter any other text.");' + - text: تأكد من أنك تستخدم .html() وليس .text() . + testString: 'assert(code.match(/\.html\(/g), "Make sure you are using .html() and not .text().");' + - text: '' + testString: 'assert(code.match(/\$\(\s*?(\"|\")#target4(\"|\")\s*?\)\.html\(/), "Make sure to select button id="target4" with jQuery.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + + + +
    +

    jQuery Playground

    +
    +
    +

    #left-well

    +
    + + + +
    +
    +
    +

    #right-well

    +
    + + + +
    +
    +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/jquery/change-the-css-of-an-element-using-jquery.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/jquery/change-the-css-of-an-element-using-jquery.arabic.md new file mode 100644 index 0000000000..caaf5cea19 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/jquery/change-the-css-of-an-element-using-jquery.arabic.md @@ -0,0 +1,85 @@ +--- +id: bad87fee1348bd9aed908826 +title: Change the CSS of an Element Using jQuery +required: + - link: 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.css' +challengeType: 6 +videoUrl: '' +localeTitle: تغيير CSS لعنصر باستخدام jQuery +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert($("#target1").css("color") === "rgb(255, 0, 0)", "Your target1 element should have red text.");' + - text: استخدم jQuery فقط لإضافة هذه الفئات إلى العنصر. + testString: 'assert(!code.match(/class.*animated/g), "Only use jQuery to add these classes to the element.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + + + +
    +

    jQuery Playground

    +
    +
    +

    #left-well

    +
    + + + +
    +
    +
    +

    #right-well

    +
    + + + +
    +
    +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/jquery/clone-an-element-using-jquery.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/jquery/clone-an-element-using-jquery.arabic.md new file mode 100644 index 0000000000..9ccd25645f --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/jquery/clone-an-element-using-jquery.arabic.md @@ -0,0 +1,86 @@ +--- +id: bad87fee1348bd9aed508826 +title: Clone an Element Using jQuery +challengeType: 6 +videoUrl: '' +localeTitle: '' +--- + +## Description +
    بالإضافة إلى نقل العناصر ، يمكنك أيضًا نسخها من مكان إلى آخر. jQuery يحتوي على وظيفة تسمى clone() التي تجعل نسخة من عنصر. على سبيل المثال ، إذا أردنا نسخ target2 من left-well إلى $("#target2").clone().appendTo("#right-well"); right-well ، فسوف نستخدم: $("#target2").clone().appendTo("#right-well"); هل لاحظت هذا ينطوي على الالتصاق اثنين من وظائف jQuery معا؟ وهذا ما يسمى function chaining وهي طريقة ملائمة لإنجاز المهام باستخدام jQuery. target5 عنصر target5 left-well .
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يكون عنصر target5 داخل right-well . + testString: 'assert($("#right-well").children("#target5").length > 0, "Your target5 element should be inside your right-well.");' + - text: يجب أيضًا أن تكون نسخة من عنصر target5 داخل target5 left-well . + testString: 'assert($("#left-well").children("#target5").length > 0, "A copy of your target5 element should also be inside your left-well.");' + - text: '' + testString: 'assert(!code.match(/class.*animated/g), "Only use jQuery to move these elements.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + + + +
    +

    jQuery Playground

    +
    +
    +

    #left-well

    +
    + + + +
    +
    +
    +

    #right-well

    +
    + + + +
    +
    +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/jquery/delete-your-jquery-functions.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/jquery/delete-your-jquery-functions.arabic.md new file mode 100644 index 0000000000..80a3aca9e5 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/jquery/delete-your-jquery-functions.arabic.md @@ -0,0 +1,90 @@ +--- +id: bad87fee1348bd9aeda08726 +title: Delete Your jQuery Functions +required: + - link: 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.css' +challengeType: 6 +videoUrl: '' +localeTitle: حذف وظائف jQuery الخاصة بك +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: احذف جميع وظائف jQuery الثلاث من وظيفة document ready function . + testString: 'assert(code.match(/\{\s*\}\);/g), "Delete all three of your jQuery functions from your document ready function.");' + - text: '' + testString: 'assert(code.match(/ + + + +
    +

    jQuery Playground

    +
    +
    +

    #left-well

    +
    + + + +
    +
    +
    +

    #right-well

    +
    + + + +
    +
    +
    +
    + +``` + + + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/jquery/disable-an-element-using-jquery.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/jquery/disable-an-element-using-jquery.arabic.md new file mode 100644 index 0000000000..bdc57abdb9 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/jquery/disable-an-element-using-jquery.arabic.md @@ -0,0 +1,82 @@ +--- +id: bad87fee1348bd9aed808826 +title: Disable an Element Using jQuery +challengeType: 6 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: قم بتعطيل زر target1 الخاص بك. + testString: 'assert($("#target1") && $("#target1").prop("disabled") && code.match(/[""]disabled[""],( true|true)/g), "Disable your target1 button.");' + - text: لا تقم بتعطيل أي أزرار أخرى. + testString: 'assert($("#target2") && !$("#target2").prop("disabled"), "Do not disable any other buttons.");' + - text: استخدم jQuery فقط لإضافة هذه الفئات إلى العنصر. + testString: 'assert(!code.match(/disabled[^<]*>/g), "Only use jQuery to add these classes to the element.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + + + +
    +

    jQuery Playground

    +
    +
    +

    #left-well

    +
    + + + +
    +
    +
    +

    #right-well

    +
    + + + +
    +
    +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/jquery/learn-how-script-tags-and-document-ready-work.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/jquery/learn-how-script-tags-and-document-ready-work.arabic.md new file mode 100644 index 0000000000..6cfe1f9a94 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/jquery/learn-how-script-tags-and-document-ready-work.arabic.md @@ -0,0 +1,75 @@ +--- +id: bad87fee1348bd9acdd08826 +title: Learn How Script Tags and Document Ready Work +challengeType: 6 +videoUrl: '' +localeTitle: تعلم كيفية عمل علامات Script والوثيقة +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(code.match(/<\/script\s*>/g) && code.match(//g) && code.match(/<\/script\s*>/g).length === code.match(//g).length, "Create a script element making sure it is valid and has a closing tag.");' + - text: 'يجب إضافة $(document).ready (function() { إلى بداية عنصر script الخاص بك.' + testString: 'assert(code.match(/\$\s*?\(\s*?document\s*?\)\.ready\s*?\(\s*?function\s*?\(\s*?\)\s*?\{/g), "You should add $(document).ready(function() { to the beginning of your script element.");' + - text: '' + testString: 'assert(code.match(/\n*?\s*?\}\s*?\);/g), "Close your $(document).ready(function() { function with });");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + +
    +

    jQuery Playground

    +
    +
    +

    #left-well

    +
    + + + +
    +
    +
    +

    #right-well

    +
    + + + +
    +
    +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/jquery/remove-an-element-using-jquery.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/jquery/remove-an-element-using-jquery.arabic.md new file mode 100644 index 0000000000..85a05fbd2a --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/jquery/remove-an-element-using-jquery.arabic.md @@ -0,0 +1,81 @@ +--- +id: bad87fee1348bd9aed708826 +title: Remove an Element Using jQuery +challengeType: 6 +videoUrl: '' +localeTitle: إزالة عنصر باستخدام jQuery +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert($("#target4").length === 0 && code.match(/\$\([""]#target4[""]\).remove\(\)/g), "Use jQuery to remove your target4 element from your page.");' + - text: استخدم jQuery فقط لإزالة هذا العنصر. + testString: 'assert(code.match(/id="target4/g) && !code.match(//g) && $("#right-well").length > 0, "Only use jQuery to remove this element.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + + + +
    +

    jQuery Playground

    +
    +
    +

    #left-well

    +
    + + + +
    +
    +
    +

    #right-well

    +
    + + + +
    +
    +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/jquery/remove-classes-from-an-element-with-jquery.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/jquery/remove-classes-from-an-element-with-jquery.arabic.md new file mode 100644 index 0000000000..fbba166166 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/jquery/remove-classes-from-an-element-with-jquery.arabic.md @@ -0,0 +1,87 @@ +--- +id: bad87fee1348bd9aed918626 +title: Remove Classes from an Element with jQuery +required: + - link: 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.css' +challengeType: 6 +videoUrl: '' +localeTitle: إزالة فئات من عنصر مع jQuery +--- + +## Description +
    بنفس الطريقة يمكنك إضافة فئات إلى عنصر مع addClass() jQuery ، يمكنك إزالتها باستخدام وظيفة removeClass() jQuery's. فيما يلي كيفية القيام بذلك لزر محدد: $("#target2").removeClass("btn-default"); لنقم بإزالة فئة btn-default من كافة عناصر button بنا.
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: قم بإزالة فئة btn-default من كافة عناصر button الخاصة بك. + testString: 'assert($(".btn-default").length === 0, "Remove the btn-default class from all of your button elements.");' + - text: استخدم jQuery فقط لإزالة هذه الفئة من العنصر. + testString: 'assert(code.match(/btn btn-default/g), "Only use jQuery to remove this class from the element.");' + - text: قم بإزالة فئة btn-default . + testString: 'assert(code.match(/\.[\v\s]*removeClass[\s\v]*\([\s\v]*("|")\s*btn-default\s*("|")[\s\v]*\)/gm), "Only remove the btn-default class.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + + + +
    +

    jQuery Playground

    +
    +
    +

    #left-well

    +
    + + + +
    +
    +
    +

    #right-well

    +
    + + + +
    +
    +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/jquery/target-a-specific-child-of-an-element-using-jquery.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/jquery/target-a-specific-child-of-an-element-using-jquery.arabic.md new file mode 100644 index 0000000000..5205938aa8 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/jquery/target-a-specific-child-of-an-element-using-jquery.arabic.md @@ -0,0 +1,92 @@ +--- +id: bad87fee1348bd9aed108826 +title: Target a Specific Child of an Element Using jQuery +required: + - link: 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.css' +challengeType: 6 +videoUrl: '' +localeTitle: استهداف طفل معين من عنصر باستخدام jQuery +--- + +## Description +
    لقد رأيت لماذا تكون سمات المعرفات ملائمة للغاية للاستهداف باستخدام محددات jQuery. ولكنك لن تمتلك دائمًا معرفات نظيفة. لحسن الحظ ، jQuery لديه بعض الحيل الأخرى لاستهداف العناصر الصحيحة. يستخدم jQuery محددات CSS لاستهداف العناصر. target:nth-child(n) يسمح لك CSS بتحديد كل العناصر nth مع الفئة المستهدفة أو نوع العنصر. في ما يلي كيفية إعطاء العنصر الثالث في كل فئة من فئات الارتداد: $(".target:nth-child(3)").addClass("animated bounce"); اجعل الطفل الثاني في كل عنصر من عناصرك ترتد. يجب عليك تحديد عناصر العناصر مع الفئة target .
    + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert($(".target:nth-child(2)").hasClass("animated") && $(".target:nth-child(2)").hasClass("bounce"), "The second element in your target elements should bounce.");' + - text: فقط اثنان عناصر سوفت ارتدت. + testString: 'assert($(".animated.bounce").length === 2, "Only two elements should bounce.");' + - text: 'يجب استخدام محدد :nth-child() لتعديل هذه العناصر.' + testString: 'assert(code.match(/\:nth-child\(/g), "You should use the :nth-child() selector to modify these elements.");' + - text: '' + testString: 'assert(code.match(/\$\(".target:nth-child\(2\)"\)/g) || code.match(/\$\(".target:nth-child\(2\)"\)/g) || code.match(/\$\(".target"\).filter\(":nth-child\(2\)"\)/g) || code.match(/\$\(".target"\).filter\(":nth-child\(2\)"\)/g), "Only use jQuery to add these classes to the element.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + + + +
    +

    jQuery Playground

    +
    +
    +

    #left-well

    +
    + + + +
    +
    +
    +

    #right-well

    +
    + + + +
    +
    +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/jquery/target-elements-by-class-using-jquery.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/jquery/target-elements-by-class-using-jquery.arabic.md new file mode 100644 index 0000000000..1540015fce --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/jquery/target-elements-by-class-using-jquery.arabic.md @@ -0,0 +1,81 @@ +--- +id: bad87fee1348bd9aedc08826 +title: Target Elements by Class Using jQuery +required: + - link: 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.css' +challengeType: 6 +videoUrl: '' +localeTitle: '' +--- + +## Description +
    ترى كيف يمكننا جعل كل من لديك button عناصر ترتد؟ لقد اخترناها بـ $("button") ، ثم أضفنا بعض فئات CSS إليها باستخدام .addClass("animated bounce"); . لقد استخدمت للتو وظيفة .addClass() jQuery's ، والتي تسمح لك بإضافة فئات إلى العناصر. أولاً ، دعنا نستهدف عناصر div مع الفصل well باستخدام محدد $(".well") . لاحظ أنه مثلما هو الحال مع إعلانات CSS ، فإنك تكتب a . قبل اسم الفصل. ثم استخدم مسج ل .addClass() وظيفة لإضافة فئات animated و shake . على سبيل المثال ، يمكنك جعل جميع العناصر ذات اهتزاز text-primary عن طريق إضافة ما يلي إلى document ready function : $(".text-primary").addClass("animated shake");
    + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert($(".well").hasClass("animated") && $(".well").hasClass("shake"), "Use the jQuery addClass() function to give the classes animated and shake to all your elements with the class well.");' + - text: استخدم jQuery فقط لإضافة هذه الفئات إلى العنصر. + testString: 'assert(!code.match(/class\.\*animated/g), "Only use jQuery to add these classes to the element.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + + + +
    +

    jQuery Playground

    +
    +
    +

    #left-well

    +
    + + + +
    +
    +
    +

    #right-well

    +
    + + + +
    +
    +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/jquery/target-elements-by-id-using-jquery.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/jquery/target-elements-by-id-using-jquery.arabic.md new file mode 100644 index 0000000000..288a4d4fc2 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/jquery/target-elements-by-id-using-jquery.arabic.md @@ -0,0 +1,86 @@ +--- +id: bad87fee1348bd9aeda08826 +title: Target Elements by id Using jQuery +required: + - link: 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.css' +challengeType: 6 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert($("#target3").hasClass("animated"), "Select the button element with the id of target3 and use the jQuery addClass() function to give it the class of animated.");' + - text: '' + testString: 'assert(($("#target3").hasClass("fadeOut") || $("#target3").hasClass("fadeout")) && code.match(/\$\(\s*.#target3.\s*\)/g), "Target the element with the id target3 and use the jQuery addClass() function to give it the class fadeOut.");' + - text: '' + testString: 'assert(!code.match(/class.*animated/g), "Only use jQuery to add these classes to the element.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + + + +
    +

    jQuery Playground

    +
    +
    +

    #left-well

    +
    + + + +
    +
    +
    +

    #right-well

    +
    + + + +
    +
    +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/jquery/target-even-elements-using-jquery.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/jquery/target-even-elements-using-jquery.arabic.md new file mode 100644 index 0000000000..fc831bad96 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/jquery/target-even-elements-using-jquery.arabic.md @@ -0,0 +1,92 @@ +--- +id: bad87fee1348bd9aed008826 +title: Target Even Elements Using jQuery +required: + - link: 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.css' +challengeType: 6 +videoUrl: '' +localeTitle: الهدف حتى العناصر باستخدام jQuery +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: جميع العناصر target التي يعتقد jQuery أنها يجب أن تهتز. + testString: 'assert($(".target:even").hasClass("animated") && $(".target:even").hasClass("shake"), "All of the target elements that jQuery considers to be even should shake.");' + - text: 'يجب عليك استخدام :even selector لتعديل هذه العناصر.' + testString: 'assert(code.match(/\:even/g), "You should use the :even selector to modify these elements.");' + - text: استخدم jQuery فقط لإضافة هذه الفئات إلى العنصر. + testString: 'assert(code.match(/\$\(".target:even"\)/g) || code.match(/\$\(".target:even"\)/g) || code.match(/\$\(".target"\).filter\(":even"\)/g) || code.match(/\$\(".target"\).filter\(":even"\)/g), "Only use jQuery to add these classes to the element.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + + + +
    +

    jQuery Playground

    +
    +
    +

    #left-well

    +
    + + + +
    +
    +
    +

    #right-well

    +
    + + + +
    +
    +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/jquery/target-html-elements-with-selectors-using-jquery.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/jquery/target-html-elements-with-selectors-using-jquery.arabic.md new file mode 100644 index 0000000000..4ac6b02844 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/jquery/target-html-elements-with-selectors-using-jquery.arabic.md @@ -0,0 +1,84 @@ +--- +id: bad87fee1348bd9bedc08826 +title: Target HTML Elements with Selectors Using jQuery +required: + - link: 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.css' +challengeType: 6 +videoUrl: '' +localeTitle: عناصر HTML الهدف مع المحددات باستخدام jQuery +--- + +## Description +
    الآن لدينا document ready function . الآن دعونا نكتب أول بيان jQuery الخاص بي. تبدأ جميع وظائف jQuery بـ $ ، يشار إليه عادةً dollar sign operator ، أو bling . غالبًا ما يحدد jQuery عنصر HTML مع selector ، ثم يقوم بشيء لهذا العنصر. على سبيل المثال، دعونا جعل كل من لديك button عناصر ترتد. ما عليك $("button").addClass("animated bounce"); إضافة هذا الرمز داخل الدالة الجاهزة للمستند: $("button").addClass("animated bounce"); لاحظ أننا قمنا بالفعل بتضمين مكتبة jQuery ومكتبة Animate.css في الخلفية حتى يمكنك استخدامها في المحرر. لذا فأنت تستخدم jQuery لتطبيق فئة bounce Animate.css على عناصر button .
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: استخدم الدالة jQuery addClass() لإعطاء الطبقات animated bounce إلى عناصر button . + testString: 'assert($("button").hasClass("animated") && $("button").hasClass("bounce"), "Use the jQuery addClass() function to give the classes animated and bounce to your button elements.");' + - text: استخدم jQuery فقط لإضافة هذه الألوان إلى العنصر. + testString: 'assert(!code.match(/class.*animated/g), "Only use jQuery to add these colors to the element.");' + - text: يجب أن يكون رمز jQuery الخاص بك ضمن $(document).ready(); وظيفة. + testString: 'assert(code.match(/\$\(document\)\.ready\(function.*(\s|\n)*.*button.*.addClass.*\);/g), "Your jQuery code should be within the $(document).ready(); function.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + + + +
    +

    jQuery Playground

    +
    +
    +

    #left-well

    +
    + + + +
    +
    +
    +

    #right-well

    +
    + + + +
    +
    +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/jquery/target-the-children-of-an-element-using-jquery.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/jquery/target-the-children-of-an-element-using-jquery.arabic.md new file mode 100644 index 0000000000..7aac4d4d2b --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/jquery/target-the-children-of-an-element-using-jquery.arabic.md @@ -0,0 +1,87 @@ +--- +id: bad87fee1348bd9aed208826 +title: Target the Children of an Element Using jQuery +challengeType: 6 +videoUrl: '' +localeTitle: استهدف أطفال عنصر باستخدام jQuery +--- + +## Description +
    عندما يتم وضع عناصر HTML في مستوى واحد تحت مستوى آخر ، يتم تسمية children هذا العنصر. على سبيل المثال ، عناصر الزر في هذا التحدي بالنص "# target1" و "# target2" و "# target3" كلها children من عنصر <div class="well" id="left-well"> . jQuery لديه وظيفة تسمى children() تسمح لك بالوصول إلى أطفال أي عنصر قمت بتحديده. في ما يلي مثال على كيفية استخدامك الدالة children() لمنح أطفال عنصر left-well اللون blue : $("#left-well").children().css("color", "blue")
    + +## Instructions +
    امنح جميع أطفال عنصر right-well اللون باللون البرتقالي.
    + +## Tests +
    + +```yml +tests: + - text: 'يجب أن يكون لدى جميع أطفال #right-well نص برتقالي.' + testString: 'assert($("#right-well").children().css("color") === "rgb(255, 165, 0)", "All children of #right-well should have orange text.");' + - text: '' + testString: 'assert(code.match(/\.children\(\)\.css/g), "You should use the children() function to modify these elements.");' + - text: استخدم jQuery فقط لإضافة هذه الفئات إلى العنصر. + testString: 'assert(code.match(/
    /g), "Only use jQuery to add these classes to the element.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + + + +
    +

    jQuery Playground

    +
    +
    +

    #left-well

    +
    + + + +
    +
    +
    +

    #right-well

    +
    + + + +
    +
    +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/jquery/target-the-parent-of-an-element-using-jquery.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/jquery/target-the-parent-of-an-element-using-jquery.arabic.md new file mode 100644 index 0000000000..99e16a32c4 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/jquery/target-the-parent-of-an-element-using-jquery.arabic.md @@ -0,0 +1,91 @@ +--- +id: bad87fee1348bd9aed308826 +title: Target the Parent of an Element Using jQuery +challengeType: 6 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يكون لعنصر left-well خلفية حمراء. + testString: 'assert($("#left-well").css("background-color") === "red" || $("#left-well").css("background-color") === "rgb(255, 0, 0)" || $("#left-well").css("background-color").toLowerCase() === "#ff0000" || $("#left-well").css("background-color").toLowerCase() === "#f00", "Your left-well element should have a red background.");' + - text: يجب عليك استخدام الدالة .parent() لتعديل هذا العنصر. + testString: 'assert(code.match(/\.parent\s*\(\s*\)\s*\.css/g), "You should use the .parent() function to modify this element.");' + - text: '' + testString: 'assert(code.match(/\$\s*?\(\s*?(?:"|")\s*?#target1\s*?(?:"|")\s*?\)\s*?\.parent/gi), "The .parent() method should be called on the #target1 element.");' + - text: '' + testString: 'assert(code.match(/
    /g), "Only use jQuery to add these classes to the element.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + + + + +
    +

    jQuery Playground

    +
    +
    +

    #left-well

    +
    + + + +
    +
    +
    +

    #right-well

    +
    + + + +
    +
    +
    +
    + + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/jquery/target-the-same-element-with-multiple-jquery-selectors.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/jquery/target-the-same-element-with-multiple-jquery-selectors.arabic.md new file mode 100644 index 0000000000..7ba855fe05 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/jquery/target-the-same-element-with-multiple-jquery-selectors.arabic.md @@ -0,0 +1,90 @@ +--- +id: bad87fee1348bd9aed908626 +title: Target the Same Element with Multiple jQuery Selectors +required: + - link: 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.css' +challengeType: 6 +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: استخدم محدد $("button") . + testString: 'assert(code.match(/\$\s*?\(\s*?(?:"|")\s*?button\s*?(?:"|")/gi), "Use the $("button") selector.");' + - text: استخدم محدد $(".btn") . + testString: 'assert(code.match(/\$\s*?\(\s*?(?:"|")\s*?\.btn\s*?(?:"|")/gi), "Use the $(".btn") selector.");' + - text: 'استخدم محدد $("#target1") .' + testString: 'assert(code.match(/\$\s*?\(\s*?(?:"|")\s*?#target1\s*?(?:"|")/gi), "Use the $("#target1") selector.");' + - text: أضف فئة واحدة فقط مع كل من الثلاثة المحددات. + testString: 'assert(code.match(/addClass/g) && code.match(/addClass\s*?\(\s*?("|")\s*?[\w-]+\s*?\1\s*?\)/g).length > 2, "Only add one class with each of your three selectors.");' + - text: 'يجب أن #target1 عنصر #target1 الخاص بك على الفئات animatedshake و btn-primary .' + testString: 'assert($("#target1").hasClass("animated") && $("#target1").hasClass("shake") && $("#target1").hasClass("btn-primary"), "Your #target1 element should have the classes animatedshake and btn-primary.");' + - text: استخدم jQuery فقط لإضافة هذه الفئات إلى العنصر. + testString: 'assert(!code.match(/class.*animated/g), "Only use jQuery to add these classes to the element.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + + + +
    +

    jQuery Playground

    +
    +
    +

    #left-well

    +
    + + + +
    +
    +
    +

    #right-well

    +
    + + + +
    +
    +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/jquery/use-appendto-to-move-elements-with-jquery.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/jquery/use-appendto-to-move-elements-with-jquery.arabic.md new file mode 100644 index 0000000000..41dca499ed --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/jquery/use-appendto-to-move-elements-with-jquery.arabic.md @@ -0,0 +1,85 @@ +--- +id: bad87fee1348bd9aed608826 +title: Use appendTo to Move Elements with jQuery +challengeType: 6 +videoUrl: '' +localeTitle: استخدم appendTo لنقل العناصر باستخدام jQuery +--- + +## Description +
    الآن دعنا نحاول نقل العناصر من div إلى آخر. يحتوي jQuery على وظيفة تسمى appendTo() تسمح لك بتحديد عناصر HTML appendTo() بعنصر آخر. على سبيل المثال ، إذا أردنا نقل target4 من اليمين إلى اليسار بشكل جيد ، $("#target4").appendTo("#left-well"); : $("#target4").appendTo("#left-well"); انقل عنصر target2 من left-well right-well .
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: يجب ألا يكون عنصر target2 داخل target2 left-well . + testString: 'assert($("#left-well").children("#target2").length === 0, "Your target2 element should not be inside your left-well.");' + - text: يجب أن يكون عنصر target2 داخل right-well . + testString: 'assert($("#right-well").children("#target2").length > 0, "Your target2 element should be inside your right-well.");' + - text: استخدم jQuery فقط لنقل هذه العناصر. + testString: 'assert(!code.match(/class.*animated/g), "Only use jQuery to move these elements.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + + + +
    +

    jQuery Playground

    +
    +
    +

    #left-well

    +
    + + + +
    +
    +
    +

    #right-well

    +
    + + + +
    +
    +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/jquery/use-jquery-to-modify-the-entire-page.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/jquery/use-jquery-to-modify-the-entire-page.arabic.md new file mode 100644 index 0000000000..f10470eb88 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/jquery/use-jquery-to-modify-the-entire-page.arabic.md @@ -0,0 +1,90 @@ +--- +id: bad87fee1348bd9aecb08826 +title: Use jQuery to Modify the Entire Page +required: + - link: 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.css' +challengeType: 6 +videoUrl: '' +localeTitle: استخدم jQuery لتعديل الصفحة بأكملها +--- + +## Description +
    لقد انتهينا من اللعب في ملعب jQuery. دعونا تمزيقه! يمكن أن يستهدف jQuery عنصر body أيضًا. إليكم كيف سنجعل الجسم بأكمله يتلاشى: $("body").addClass("animated fadeOut"); لكن لنفعل شيئًا أكثر دراماتيكية. أضف الطبقات animated hinge إلى عنصر body .
    + +## Instructions +
    +
    + +## Tests +
    + +```yml +tests: + - text: أضف الطبقات animated hinge إلى عنصر body . + testString: 'assert($("body").hasClass("animated") && $("body").hasClass("hinge"), "Add the classes animated and hinge to your body element.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```html + + + + +
    +

    jQuery Playground

    +
    +
    +

    #left-well

    +
    + + + +
    +
    +
    +

    #right-well

    +
    + + + +
    +
    +
    +
    + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/connect-redux-to-react.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/connect-redux-to-react.arabic.md new file mode 100644 index 0000000000..b07a835af5 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/connect-redux-to-react.arabic.md @@ -0,0 +1,93 @@ +--- +id: 5a24c314108439a4d4036147 +title: Connect Redux to React +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: قم بتوصيل Redux بالرد +--- + +## Description +
    الآن بعد أن قمت بكتابة mapStateToProps() mapDispatchToProps() ، يمكنك استخدامها لتعيين state dispatch إلى props لأحد مكونات React الخاصة بك. يمكن لأسلوب connect من React Redux التعامل مع هذه المهمة. تأخذ هذه الطريقة الوسيطتين الاختياريتين ، mapStateToProps() و mapDispatchToProps() . وهي اختيارية لأنه قد يكون لديك مكون يحتاج فقط إلى الوصول إلى state ولكنه لا يحتاج إلى إرسال أي إجراءات أو العكس. لاستخدام هذه الطريقة ، قم بتمرير الدوال كوسائط ، واتصل على الفور بالمكون الخاص بك. بناء الجملة هذا غير معتاد قليلاً ويشبه: connect(mapStateToProps, mapDispatchToProps)(MyComponent) ملاحظة: إذا كنت ترغب في حذف إحدى الوسيطات لأسلوب connect ، فأنت تقوم null في مكانها.
    + +## Instructions +
    يحتوي محرر التعليمات البرمجية على mapStateToProps() و mapDispatchToProps() جديد يسمى Presentational . قم بتوصيل هذا المكون بـ Redux باستخدام طريقة connect من الكائن العالمي ReactRedux ، وقم ReactRedux فورًا على مكون Presentational . تعيين النتيجة إلى const جديدة تسمى ConnectedComponent يمثل المكون المتصل. هذا كل شيء ، الآن أنت متصل بـ Redux! حاول تغيير أي من وسائط connect إلى null ولاحظ نتائج الاختبار.
    + +## Tests +
    + +```yml +tests: + - text: يجب Presentational مكون Presentational . + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(AppWrapper)); return mockedComponent.find("Presentational").length === 1; })(), "The Presentational component should render.");' + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(AppWrapper)); const props = mockedComponent.find("Presentational").props(); return props.messages === "__INITIAL__STATE__"; })(), "The Presentational component should receive a prop messages via connect.");' + - text: يجب أن يتلقى المكون Presentational a prop submitNewMessage عبر connect . + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(AppWrapper)); const props = mockedComponent.find("Presentational").props(); return typeof props.submitNewMessage === "function"; })(), "The Presentational component should receive a prop submitNewMessage via connect.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +const addMessage = (message) => { + return { + type: 'ADD', + message: message + } +}; + +const mapStateToProps = (state) => { + return { + messages: state + } +}; + +const mapDispatchToProps = (dispatch) => { + return { + submitNewMessage: (message) => { + dispatch(addMessage(message)); + } + } +}; + +class Presentational extends React.Component { + constructor(props) { + super(props); + } + render() { + return

    This is a Presentational Component

    + } +}; + +const connect = ReactRedux.connect; +// change code below this line + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/connect-redux-to-the-messages-app.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/connect-redux-to-the-messages-app.arabic.md new file mode 100644 index 0000000000..8b48f76f13 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/connect-redux-to-the-messages-app.arabic.md @@ -0,0 +1,161 @@ +--- +id: 5a24c314108439a4d4036148 +title: Connect Redux to the Messages App +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: '' +--- + +## Description +
    الآن بعد أن فهمت كيفية استخدام connect للاتصال بـ React to Redux ، يمكنك تطبيق ما تعلمته على مكون React الذي يتعامل مع الرسائل. في الدرس الأخير ، تم تسمية المكون الذي اتصلت به إلى Redux باسم Presentational ، ولم يكن هذا العنصر تعسفياً. يشير هذا المصطلح عمومًا إلى مكونات React غير المتصلة بشكل مباشر بـ Redux. فهم مسؤولون ببساطة عن عرض واجهة المستخدم ويقومون بذلك كدالة للدعائم التي يتلقونها. على النقيض من ذلك ، يتم توصيل مكونات الحاوية إلى Redux. عادة ما تكون هذه مسؤولة عن إرسال إجراءات إلى المخزن وغالبًا ما تتجاوز حالة المخزن إلى مكونات الأطفال كدعامات.
    + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: يجب أن يتم عرض AppWrapper إلى الصفحة. + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(AppWrapper)); return mockedComponent.find("AppWrapper").length === 1; })(), "The AppWrapper should render to the page.");' + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(AppWrapper)); return mockedComponent.find("Presentational").length === 1; })(), "The Presentational component should render an h2, input, button, and ul elements.");' + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(AppWrapper)); const PresentationalComponent = mockedComponent.find("Presentational"); return ( PresentationalComponent.find("div").length === 1 && PresentationalComponent.find("h2").length === 1 && PresentationalComponent.find("button").length === 1 && PresentationalComponent.find("ul").length === 1 ); })(), "The Presentational component should render an h2, input, button, and ul elements.");' + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(AppWrapper)); const PresentationalComponent = mockedComponent.find("Presentational"); const props = PresentationalComponent.props(); return Array.isArray(props.messages); })(), "The Presentational component should receive messages from the Redux store as a prop.");' + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(AppWrapper)); const PresentationalComponent = mockedComponent.find("Presentational"); const props = PresentationalComponent.props(); return typeof props.submitNewMessage === "function"; })(), "The Presentational component should receive the submitMessage action creator as a prop.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +// Redux: +const ADD = 'ADD'; + +const addMessage = (message) => { + return { + type: ADD, + message: message + } +}; + +const messageReducer = (state = [], action) => { + switch (action.type) { + case ADD: + return [ + ...state, + action.message + ]; + default: + return state; + } +}; + +const store = Redux.createStore(messageReducer); + +// React: +class Presentational extends React.Component { + constructor(props) { + super(props); + this.state = { + input: ", + messages: [] + } + this.handleChange = this.handleChange.bind(this); + this.submitMessage = this.submitMessage.bind(this); + } + handleChange(event) { + this.setState({ + input: event.target.value + }); + } + submitMessage() { + const currentMessage = this.state.input; + this.setState({ + input: ", + messages: this.state.messages.concat(currentMessage) + }); + } + render() { + return ( +
    +

    Type in a new Message:

    +
    + +
      + {this.state.messages.map( (message, idx) => { + return ( +
    • {message}
    • + ) + }) + } +
    +
    + ); + } +}; + +// React-Redux: +const mapStateToProps = (state) => { + return { messages: state } +}; + +const mapDispatchToProps = (dispatch) => { + return { + submitNewMessage: (newMessage) => { + dispatch(addMessage(newMessage)) + } + } +}; + +const Provider = ReactRedux.Provider; +const connect = ReactRedux.connect; + +// define the Container component here: + + +class AppWrapper extends React.Component { + constructor(props) { + super(props); + } + render() { + // complete the return statement: + return (null); + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/extract-local-state-into-redux.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/extract-local-state-into-redux.arabic.md new file mode 100644 index 0000000000..7450c70aae --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/extract-local-state-into-redux.arabic.md @@ -0,0 +1,168 @@ +--- +id: 5a24c314108439a4d4036149 +title: Extract Local State into Redux +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: '' +--- + +## Description +
    أنت على وشك الإنتهاء! تذكر أنك كتبت كل رمز Redux بحيث يمكن لـ Redux التحكم في إدارة حالة تطبيق رسائل React. الآن بعد أن تم توصيل Redux ، تحتاج إلى استخراج إدارة الحالة من مكون Presentational وإلى Redux. حالياً ، لديك Redux متصل ، لكنك تتعامل مع الحالة محليًا داخل مكون Presentational .
    + +## Instructions +
    في مكون Presentational أولاً ، قم بإزالة خاصية messages في state المحلية. ستتم إدارة هذه الرسائل بواسطة Redux. بعد ذلك ، قم بتعديل طريقة submitMessage() بحيث يتم إرسال submitNewMessage() من this.props ، وتمرير الإدخال الحالي للرسالة من state المحلية كوسيطة. نظرًا لأنك أزلت messages من الحالة المحلية ، فأزل خاصية messages من المكالمة إلى this.setState() هنا أيضًا. وأخيرًا ، قم بتعديل طريقة العرض render() بحيث يتم تعيينها على الرسائل المستلمة من props بدلاً من state . بمجرد إجراء هذه التغييرات ، سيستمر التطبيق في العمل كما هو ، باستثناء أن يقوم Redux بإدارة الحالة. يوضح هذا المثال أيضا كيف يمكن أن يكون المكون المحلي state : مكون الخاص بك لا يزال يتابع إدخال المستخدم محليا في الخاصة به state . يمكنك أن ترى كيف يوفر Redux إطارًا مفيدًا لإدارة الدولة أعلى React. لقد حققت النتيجة نفسها باستخدام حالة React المحلية فقط في البداية ، وهذا ممكن عادة باستخدام تطبيقات بسيطة. ومع ذلك ، عندما تصبح تطبيقاتك أكبر وأكثر تعقيدًا ، كذلك فإن إدارة الولاية لديك ، وهذه هي المشكلة التي يحلها Redux.
    + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(AppWrapper)); return mockedComponent.find("AppWrapper").length === 1; })(), "The AppWrapper should render to the page.");' + - text: يجب أن يقوم مكون Presentational بعرض عناصر h2 و input و button و ul . + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(AppWrapper)); return mockedComponent.find("Presentational").length === 1; })(), "The Presentational component should render an h2, input, button, and ul elements.");' + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(AppWrapper)); const PresentationalComponent = mockedComponent.find("Presentational"); return ( PresentationalComponent.find("div").length === 1 && PresentationalComponent.find("h2").length === 1 && PresentationalComponent.find("button").length === 1 && PresentationalComponent.find("ul").length === 1 ); })(), "The Presentational component should render an h2, input, button, and ul elements.");' + - text: يجب أن يتلقى المكون Presentational messages من مخزن Redux كدعم. + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(AppWrapper)); const PresentationalComponent = mockedComponent.find("Presentational"); const props = PresentationalComponent.props(); return Array.isArray(props.messages); })(), "The Presentational component should receive messages from the Redux store as a prop.");' + - text: يجب أن يتلقى المكون Presentational منشئ إجراء submitMessage كدعم. + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(AppWrapper)); const PresentationalComponent = mockedComponent.find("Presentational"); const props = PresentationalComponent.props(); return typeof props.submitNewMessage === "function"; })(), "The Presentational component should receive the submitMessage action creator as a prop.");' + - text: يجب أن تحتوي حالة المكون Presentational على خاصية واحدة ، input ، والتي تتم تهيئتها إلى سلسلة فارغة. + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(AppWrapper)); const PresentationalState = mockedComponent.find("Presentational").instance().state; return typeof PresentationalState.input === "string" && Object.keys(PresentationalState).length === 1; })(), "The state of the Presentational component should contain one property, input, which is initialized to an empty string.");' + - text: '' + testString: 'async () => { const mockedComponent = Enzyme.mount(React.createElement(AppWrapper)); const testValue = "__MOCK__INPUT__"; const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 100)); const causeChange = (c, v) => c.find("input").simulate("change", { target: { value: v }}); let initialInput = mockedComponent.find("Presentational").find("input"); const changed = () => { causeChange(mockedComponent, testValue); return waitForIt(() => mockedComponent )}; const updated = await changed(); const updatedInput = updated.find("Presentational").find("input"); assert(initialInput.props().value === "" && updatedInput.props().value === "__MOCK__INPUT__", "Typing in the input element should update the state of the Presentational component."); }; ' + - text: يجب أن يؤدي إرسال submitMessage على مكون Presentational تحديث مخزن Redux ومسح الإدخال في الحالة المحلية. + testString: 'async () => { const mockedComponent = Enzyme.mount(React.createElement(AppWrapper)); const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 100)); let beforeProps = mockedComponent.find("Presentational").props(); const testValue = "__TEST__EVENT__INPUT__"; const causeChange = (c, v) => c.find("input").simulate("change", { target: { value: v }}); const changed = () => { causeChange(mockedComponent, testValue); return waitForIt(() => mockedComponent )}; const clickButton = () => { mockedComponent.find("button").simulate("click"); return waitForIt(() => mockedComponent )}; const afterChange = await changed(); const afterChangeInput = afterChange.find("input").props().value; const afterClick = await clickButton(); const afterProps = mockedComponent.find("Presentational").props(); assert(beforeProps.messages.length === 0 && afterChangeInput === testValue && afterProps.messages.pop() === testValue && afterClick.find("input").props().value === "", "Dispatching the submitMessage on the Presentational component should update Redux store and clear the input in local state."); }; ' + - text: يجب أن يقوم المكون Presentational بعرض messages من مخزن Redux. + testString: 'async () => { const mockedComponent = Enzyme.mount(React.createElement(AppWrapper)); const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 100)); let beforeProps = mockedComponent.find("Presentational").props(); const testValue = "__TEST__EVENT__INPUT__"; const causeChange = (c, v) => c.find("input").simulate("change", { target: { value: v }}); const changed = () => { causeChange(mockedComponent, testValue); return waitForIt(() => mockedComponent )}; const clickButton = () => { mockedComponent.find("button").simulate("click"); return waitForIt(() => mockedComponent )}; const afterChange = await changed(); const afterChangeInput = afterChange.find("input").props().value; const afterClick = await clickButton(); const afterProps = mockedComponent.find("Presentational").props(); assert(beforeProps.messages.length === 0 && afterChangeInput === testValue && afterProps.messages.pop() === testValue && afterClick.find("input").props().value === "" && afterClick.find("ul").childAt(0).text() === testValue, "The Presentational component should render the messages from the Redux store."); }; ' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +// Redux: +const ADD = 'ADD'; + +const addMessage = (message) => { + return { + type: ADD, + message: message + } +}; + +const messageReducer = (state = [], action) => { + switch (action.type) { + case ADD: + return [ + ...state, + action.message + ]; + default: + return state; + } +}; + +const store = Redux.createStore(messageReducer); + +// React: +const Provider = ReactRedux.Provider; +const connect = ReactRedux.connect; + +// Change code below this line +class Presentational extends React.Component { + constructor(props) { + super(props); + this.state = { + input: ", + messages: [] + } + this.handleChange = this.handleChange.bind(this); + this.submitMessage = this.submitMessage.bind(this); + } + handleChange(event) { + this.setState({ + input: event.target.value + }); + } + submitMessage() { + this.setState({ + input: ", + messages: this.state.messages.concat(this.state.input) + }); + } + render() { + return ( +
    +

    Type in a new Message:

    +
    + +
      + {this.state.messages.map( (message, idx) => { + return ( +
    • {message}
    • + ) + }) + } +
    +
    + ); + } +}; +// Change code above this line + +const mapStateToProps = (state) => { + return {messages: state} +}; + +const mapDispatchToProps = (dispatch) => { + return { + submitNewMessage: (message) => { + dispatch(addMessage(message)) + } + } +}; + +const Container = connect(mapStateToProps, mapDispatchToProps)(Presentational); + +class AppWrapper extends React.Component { + render() { + return ( + + + + ); + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/extract-state-logic-to-redux.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/extract-state-logic-to-redux.arabic.md new file mode 100644 index 0000000000..b252cb5f31 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/extract-state-logic-to-redux.arabic.md @@ -0,0 +1,60 @@ +--- +id: 5a24c314108439a4d4036143 +title: Extract State Logic to Redux +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: استخراج الدولة المنطق إلى Redux +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(ADD === "ADD", "The const ADD should exist and hold a value equal to the string ADD");' + - text: '' + testString: 'assert((function() { const addAction = addMessage("__TEST__MESSAGE__"); return addAction.type === ADD && addAction.message === "__TEST__MESSAGE__"; })(), "The action creator addMessage should return an object with type equal to ADD and message equal to the message that is passed in.");' + - text: messageReducer يجب أن تكون وظيفة. + testString: 'assert(typeof messageReducer === "function", "messageReducer should be a function.");' + - text: '' + testString: 'assert((function() { const initialState = store.getState(); return typeof store === "object" && initialState.length === 0; })(), "The store should exist and have an initial state set to an empty array.");' + - text: '' + testString: 'assert((function() { const initialState = store.getState(); const isFrozen = DeepFreeze(initialState); store.dispatch(addMessage("__A__TEST__MESSAGE")); const addState = store.getState(); return (isFrozen && addState[0] === "__A__TEST__MESSAGE"); })(), "Dispatching addMessage against the store should immutably add a new message to the array of messages held in state.");' + - text: يجب أن تقوم messageReducer بإرجاع الحالة الحالية إذا تمت دعوتها مع أي إجراءات أخرى. + testString: 'assert((function() { const addState = store.getState(); store.dispatch({type: "FAKE_ACTION"}); const testState = store.getState(); return (addState === testState); })(), "The messageReducer should return the current state if called with any other actions.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +// define ADD, addMessage(), messageReducer(), and store here: + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/getting-started-with-react-redux.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/getting-started-with-react-redux.arabic.md new file mode 100644 index 0000000000..97ac2ff356 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/getting-started-with-react-redux.arabic.md @@ -0,0 +1,69 @@ +--- +id: 5a24c314108439a4d4036141 +title: Getting Started with React Redux +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: الابتداء مع React Redux +--- + +## Description +
    تقدم هذه السلسلة من التحديات كيفية استخدام Redux مع React. أولاً ، إليك مراجعة لبعض المبادئ الأساسية لكل تقنية. React هي مكتبة ملفات شخصية تقدمها مع البيانات ، ثم تعرض طريقة العرض بطريقة فعالة ويمكن التنبؤ بها. Redux هو إطار عمل لإدارة الولاية يمكنك استخدامه لتبسيط إدارة حالة التطبيق الخاص بك. عادةً ، في تطبيق React Redux ، يمكنك إنشاء متجر Redux واحد يدير حالة تطبيقك بالكامل. تشترك مكونات React الخاص بك في أجزاء البيانات الموجودة في المتجر ذات الصلة بدورها فقط. بعد ذلك ، يمكنك إرسال الإجراءات مباشرة من مكونات React ، والتي تؤدي بعد ذلك إلى تشغيل تحديثات المتجر. على الرغم من أن مكونات React تستطيع إدارة حالتها محليًا ، عندما يكون لديك تطبيق معقد ، فمن الأفضل بشكل عام الاحتفاظ بحالة التطبيق في موقع واحد باستخدام Redux. هناك استثناءات عندما تكون المكونات الفردية لها حالة محلية خاصة بها فقط. أخيرًا ، نظرًا لأن Redux غير مصمم للعمل مع React out of the box ، فأنت بحاجة إلى استخدام حزمة react-redux . وهو يوفر طريقة لتمرير مسترجع state و dispatch لديك رد فعل المكونات كما props . خلال التحديات القليلة التالية ، أولاً ، ستقوم بإنشاء مكون React بسيط يسمح لك بإدخال رسائل نصية جديدة. تتم إضافة هذه إلى صفيف معروض في طريقة العرض. هذا يجب أن يكون مراجعة لطيفة لما تعلمته في دروس React. بعد ذلك ، ستقوم بإنشاء مخزن وإجراءات Redux التي تدير حالة مصفوفة الرسائل. وأخيرًا ، ستستخدم react-redux لتوصيل مخزن Redux بالمكون الخاص بك ، وبالتالي استخراج الحالة المحلية في مخزن Redux.
    + +## Instructions +
    ابدأ بمكون DisplayMessages . أضف مُنشئًا إلى هذا المكوّن وأعد تهيئة هذه الحالة بحالة تحتوي على خاصيتين: input ، يتم تعيينها على سلسلة فارغة ، messages ، يتم تعيينها على مصفوفة فارغة.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يقوم مكون DisplayMessages بعرض عنصر div فارغ. + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(DisplayMessages)); return mockedComponent.find("div").text() === "" })(), "The DisplayMessages component should render an empty div element.");' + - text: يجب استدعاء منشئ DisplayMessages بشكل صحيح مع super ، يمر في props . + testString: 'getUserInput => assert((function() { const noWhiteSpace = getUserInput("index").replace(/\s/g,""); return noWhiteSpace.includes("constructor(props)") && noWhiteSpace.includes("super(props"); })(), "The DisplayMessages constructor should be called properly with super, passing in props.");' + - text: 'يجب أن يكون لمكون DisplayMessages حالة أولية تساوي {input: "", messages: []} .' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(DisplayMessages)); const initialState = mockedComponent.state(); return typeof initialState === "object" && initialState.input === "" && Array.isArray(initialState.messages) && initialState.messages.length === 0; })(), "The DisplayMessages component should have an initial state equal to {input: "", messages: []}.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +class DisplayMessages extends React.Component { + // change code below this line + + // change code above this line + render() { + return
    + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/manage-state-locally-first.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/manage-state-locally-first.arabic.md new file mode 100644 index 0000000000..16cd7ec5c9 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/manage-state-locally-first.arabic.md @@ -0,0 +1,88 @@ +--- +id: 5a24c314108439a4d4036142 +title: Manage State Locally First +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: إدارة الدولة محليا أولا +--- + +## Description +
    هنا ستنتهي من إنشاء مكون DisplayMessages .
    + +## Instructions +
    أولاً ، في الطريقة render() ، اجعل المكون يعرض عنصر input ، عنصر button ، وعنصر ul . عندما يتغير عنصر input ، يجب أن يقوم بتشغيل أسلوب handleChange() . أيضًا ، يجب أن يعرض عنصر input قيمة input في حالة المكوِّن. يجب أن يقوم عنصر button بتشغيل طريقة submitMessage() عند النقر عليها. ثانيًا ، اكتب هذين الأسلوبين. يجب أن تقوم الطريقة handleChange() بتحديث input بما handleChange() المستخدم. يجب أن تسلسل طريقة submitMessage() الرسالة الحالية (المخزنة في input ) إلى مصفوفة messages في الحالة المحلية ، ومسح قيمة input . وأخيرًا ، استخدم ul لتعيين أكثر من مجموعة من messages وعرضها على الشاشة كقائمة من عناصر li .
    + +## Tests +
    + +```yml +tests: + - text: 'يجب تهيئة مكون DisplayMessages بحالة مساوية { input: "", messages: [] } .' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(DisplayMessages)); const initialState = mockedComponent.state(); return ( typeof initialState === "object" && initialState.input === "" && initialState.messages.length === 0); })(), "The DisplayMessages component should initialize with a state equal to { input: "", messages: [] }.");' + - text: يجب أن يقوم مكون DisplayMessages بعرض div يحتوي على عنصر h2 ، وعنصر button ، وعنصر ul ، وعناصر li كأطفال. + testString: 'async () => { const mockedComponent = Enzyme.mount(React.createElement(DisplayMessages)); const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 100)); const state = () => { mockedComponent.setState({messages: ["__TEST__MESSAGE"]}); return waitForIt(() => mockedComponent )}; const updated = await state(); assert(updated.find("div").length === 1 && updated.find("h2").length === 1 && updated.find("button").length === 1 && updated.find("ul").length === 1, "The DisplayMessages component should render a div containing an h2 element, a button element, a ul element, and li elements as children."); }; ' + - text: يجب أن يؤدي عنصر input عرض قيمة input في الحالة المحلية. + testString: 'async () => { const mockedComponent = Enzyme.mount(React.createElement(DisplayMessages)); const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 100)); const causeChange = (c, v) => c.find("input").simulate("change", { target: { value: v }}); const testValue = "__TEST__EVENT__INPUT"; const changed = () => { causeChange(mockedComponent, testValue); return waitForIt(() => mockedComponent )}; const updated = await changed(); assert(updated.find("input").props().value === testValue, "The input element should render the value of input in local state."); }; ' + - text: يجب استدعاء الأسلوب handleChange تحديث قيمة input في الحالة إلى الإدخال الحالي. + testString: 'async () => { const mockedComponent = Enzyme.mount(React.createElement(DisplayMessages)); const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 100)); const causeChange = (c, v) => c.find("input").simulate("change", { target: { value: v }}); const initialState = mockedComponent.state(); const testMessage = "__TEST__EVENT__MESSAGE__"; const changed = () => { causeChange(mockedComponent, testMessage); return waitForIt(() => mockedComponent )}; const afterInput = await changed(); assert(initialState.input === "" && afterInput.state().input === "__TEST__EVENT__MESSAGE__", "Calling the method handleChange should update the input value in state to the current input."); }; ' + - text: يجب النقر فوق الزر " Add message استدعاء الأسلوب submitMessage الذي يجب إضافة input الحالي إلى صفيف messages في الحالة. + testString: 'async () => { const mockedComponent = Enzyme.mount(React.createElement(DisplayMessages)); const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 100)); const causeChange = (c, v) => c.find("input").simulate("change", { target: { value: v }}); const initialState = mockedComponent.state(); const testMessage_1 = "__FIRST__MESSAGE__"; const firstChange = () => { causeChange(mockedComponent, testMessage_1); return waitForIt(() => mockedComponent )}; const firstResult = await firstChange(); const firstSubmit = () => { mockedComponent.find("button").simulate("click"); return waitForIt(() => mockedComponent )}; const afterSubmit_1 = await firstSubmit(); const submitState_1 = afterSubmit_1.state(); const testMessage_2 = "__SECOND__MESSAGE__"; const secondChange = () => { causeChange(mockedComponent, testMessage_2); return waitForIt(() => mockedComponent )}; const secondResult = await secondChange(); const secondSubmit = () => { mockedComponent.find("button").simulate("click"); return waitForIt(() => mockedComponent )}; const afterSubmit_2 = await secondSubmit(); const submitState_2 = afterSubmit_2.state(); assert(initialState.messages.length === 0 && submitState_1.messages.length === 1 && submitState_2.messages.length === 2 && submitState_2.messages[1] === testMessage_2, "Clicking the Add message button should call the method submitMessage which should add the current input to the messages array in state."); }; ' + - text: يجب أن تقوم طريقة submitMessage بمسح الإدخال الحالي. + testString: 'async () => { const mockedComponent = Enzyme.mount(React.createElement(DisplayMessages)); const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 100)); const causeChange = (c, v) => c.find("input").simulate("change", { target: { value: v }}); const initialState = mockedComponent.state(); const testMessage = "__FIRST__MESSAGE__"; const firstChange = () => { causeChange(mockedComponent, testMessage); return waitForIt(() => mockedComponent )}; const firstResult = await firstChange(); const firstState = firstResult.state(); const firstSubmit = () => { mockedComponent.find("button").simulate("click"); return waitForIt(() => mockedComponent )}; const afterSubmit = await firstSubmit(); const submitState = afterSubmit.state(); assert(firstState.input === testMessage && submitState.input === "", "The submitMessage method should clear the current input."); }; ' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +class DisplayMessages extends React.Component { + constructor(props) { + super(props); + this.state = { + input: ", + messages: [] + } + } + // add handleChange() and submitMessage() methods here + + render() { + return ( +
    +

    Type in a new Message:

    + { /* render an input, button, and ul here */ } + + { /* change code above this line */ } +
    + ); + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/map-dispatch-to-props.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/map-dispatch-to-props.arabic.md new file mode 100644 index 0000000000..7a8d402274 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/map-dispatch-to-props.arabic.md @@ -0,0 +1,63 @@ +--- +id: 5a24c314108439a4d4036146 +title: Map Dispatch to Props +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert((function() { const addMessageTest = addMessage(); return ( addMessageTest.hasOwnProperty("type") && addMessageTest.hasOwnProperty("message")); })(), "addMessage should return an object with keys type and message.");' + - text: '' + testString: 'assert(typeof mapDispatchToProps === "function", "mapDispatchToProps should be a function.");' + - text: يجب أن ترجع mapDispatchToProps كائن. + testString: 'assert(typeof mapDispatchToProps() === "object", "mapDispatchToProps should return an object.");' + - text: '' + testString: 'assert((function() { let testAction; const dispatch = (fn) => { testAction = fn; }; let dispatchFn = mapDispatchToProps(dispatch); dispatchFn.submitNewMessage("__TEST__MESSAGE__"); return (testAction.type === "ADD" && testAction.message === "__TEST__MESSAGE__"); })(), "Dispatching addMessage with submitNewMessage from mapDispatchToProps should return a message to the dispatch function.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +const addMessage = (message) => { + return { + type: 'ADD', + message: message + } +}; + +// change code below this line + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/map-state-to-props.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/map-state-to-props.arabic.md new file mode 100644 index 0000000000..575f055e2c --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/map-state-to-props.arabic.md @@ -0,0 +1,58 @@ +--- +id: 5a24c314108439a4d4036145 +title: Map State to Props +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: خريطة الدولة إلى الدعائم +--- + +## Description +undefined + +## Instructions +
    قم بإنشاء mapStateToProps() دالة. يجب أن تأخذ هذه الدالة state كوسيطة ، ثم تقوم بإرجاع كائن يقوم بتعيين هذه الحالة إلى أسماء خصائص محددة. ستصبح هذه الخصائص متاحة للمكون الخاص بك عبر props . نظرًا لأن هذا المثال يحافظ على الحالة الكاملة للتطبيق في صفيف واحد ، فيمكنك تمرير هذه الحالة بأكملها إلى المكون الخاص بك. قم بإنشاء messages خاصية في الكائن الذي يتم إرجاعه وتعيينه إلى state .
    + +## Tests +
    + +```yml +tests: + - text: وCONST state يجب أن تكون مجموعة فارغة. + testString: 'assert(Array.isArray(state) && state.length === 0, "The const state should be an empty array.");' + - text: '' + testString: 'assert(typeof mapStateToProps === "function", "mapStateToProps should be a function.");' + - text: '' + testString: 'assert(typeof mapStateToProps() === "object", "mapStateToProps should return an object.");' + - text: '' + testString: 'assert(mapStateToProps(["messages"]).messages.pop() === "messages", "Passing an array as state to mapStateToProps should return this array assigned to a key of messages.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +const state = []; + +// change code below this line + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/moving-forward-from-here.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/moving-forward-from-here.arabic.md new file mode 100644 index 0000000000..cea4af5c15 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/moving-forward-from-here.arabic.md @@ -0,0 +1,71 @@ +--- +id: 5a24c314108439a4d403614a +title: Moving Forward From Here +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: '' +--- + +## Description +
    تهانينا! لقد أنهيت الدروس في React و Redux. هناك عنصر أخير يستحق الإشارة إليه قبل الانتقال. عادة ، لن تكتب تطبيقات React في محرر رمز مثل هذا. يمنحك هذا التحدي لمحة عن الشكل الذي تبدو عليه إذا كنت تعمل مع npm ونظام ملفات على جهازك الخاص. يجب أن تبدو التعليمات البرمجية مشابهة ، فيما عدا استخدام عبارات import (هذه السحب في كافة التبعيات التي تم توفيرها لك في التحديات). يغطي قسم "إدارة الحزم باستخدام npm" npm بمزيد من التفاصيل. وأخيرًا ، تتطلب كتابة React و Redux code بشكل عام بعض التهيئة. هذا يمكن أن تتعقد بسرعة. إذا كنت مهتمًا بالتجربة على جهازك الخاص ، فإن تطبيق "إنشاء التفاعلات" يأتي مهيئًا ومستعدًا للانطلاق. بدلاً من ذلك ، يمكنك تمكين Babel باعتباره المعالج المسبق لـ JavaScript في CodePen ، وإضافة React و ReactDOM كموارد جافا سكريبت خارجية ، والعمل هناك أيضًا.
    + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(editor.getValue().includes("console.log("Now I know React and Redux!")") || editor.getValue().includes("console.log(\"Now I know React and Redux!\")"), "The message Now I know React and Redux! should be logged to the console.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +// import React from 'react' +// import ReactDOM from 'react-dom' +// import { Provider, connect } from 'react-redux' +// import { createStore, combineReducers, applyMiddleware } from 'redux' +// import thunk from 'redux-thunk' + +// import rootReducer from './redux/reducers' +// import App from './components/App' + +// const store = createStore( +// rootReducer, +// applyMiddleware(thunk) +// ); + +// ReactDOM.render( +// +// +// , +// document.getElementById('root') +// ); + +// change code below this line + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/use-provider-to-connect-redux-to-react.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/use-provider-to-connect-redux-to-react.arabic.md new file mode 100644 index 0000000000..b3b16cd392 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react-and-redux/use-provider-to-connect-redux-to-react.arabic.md @@ -0,0 +1,141 @@ +--- +id: 5a24c314108439a4d4036144 +title: Use Provider to Connect Redux to React +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: '' +--- + +## Description +
    في التحدي الأخير ، قمت بإنشاء مخزن Redux للتعامل مع صفيف الرسائل وقمت بإنشاء إجراء لإضافة رسائل جديدة. الخطوة التالية هي توفير إمكانية الوصول إلى متجر Redux والإجراءات التي يحتاجها لإرسال التحديثات. يقدم React Redux حزمة react-redux للمساعدة في إنجاز هذه المهام. يوفر React Redux واجهة برمجة تطبيقات صغيرة مع ميزتين رئيسيتين: Provider connect . تحد آخر يشمل connect . Provider عبارة عن مكون مجمّع من React Redux يلف تطبيق React. يتيح لك هذا المجمّع بعد ذلك الوصول إلى store Redux ووظائف dispatch عبر شجرة المكونات. يأخذ Provider اثنين من الأدوات الدعائية ، وهما متجر Redux والمكونات الفرعية لتطبيقك. قد يبدو تعريف Provider أحد مكونات التطبيق كما يلي:
    <provider store = {store}>
    <التطبيق />
    </ مزود>
    + +## Instructions +
    يعرض محرر الشفرة الآن جميع رموز Redux و React من التحديات العديدة الماضية. يتضمن مخزن Redux والإجراءات ومكون DisplayMessages . والجزء الجديد الوحيد هو مكون AppWrapper في الجزء السفلي. استخدم مكون المستوى الأعلى هذا لعرض Provider من ReactRedux ، وتمرير مخزن Redux كدعم. ثم عرض مكون DisplayMessages كطفل. بمجرد الانتهاء ، سترى مكون React الخاص بك مقدم إلى الصفحة. ملاحظة: React Redux متاح كمتغير شامل هنا ، حتى تتمكن من الوصول إلى مقدم الخدمة باستخدام ميزة التدوين النقطي. التعليمات البرمجية في المحرر الاستفادة من هذا وتعيينه إلى Provider ثابت لك لاستخدامه في طريقة تقديم AppWrapper .
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يتم عرض AppWrapper . + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(AppWrapper)); return mockedComponent.find("AppWrapper").length === 1; })(), "The AppWrapper should render.");' + - text: يجب أن يكون مكون مجمّع Provider يحتوي على store دعامة تم تمريره إليه ، يساوي مخزن Redux. + testString: 'getUserInput => assert((function() { const mockedComponent = Enzyme.mount(React.createElement(AppWrapper)); return getUserInput("index").replace(/\s/g,"").includes(""); })(), "The Provider wrapper component should have a prop of store passed to it, equal to the Redux store.");' + - text: يجب أن يتم عرض DisplayMessages كطفل من AppWrapper . + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(AppWrapper)); return mockedComponent.find("AppWrapper").find("DisplayMessages").length === 1; })(), "DisplayMessages should render as a child of AppWrapper.");' + - text: يجب أن يقوم مكون DisplayMessages بعرض عنصر h2 و input و button و ul . + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(AppWrapper)); return mockedComponent.find("div").length === 1 && mockedComponent.find("h2").length === 1 && mockedComponent.find("button").length === 1 && mockedComponent.find("ul").length === 1; })(), "The DisplayMessages component should render an h2, input, button, and ul element.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +// Redux Code: +const ADD = 'ADD'; + +const addMessage = (message) => { + return { + type: ADD, + message + } +}; + +const messageReducer = (state = [], action) => { + switch (action.type) { + case ADD: + return [ + ...state, + action.message + ]; + default: + return state; + } +}; + + + +const store = Redux.createStore(messageReducer); + +// React Code: + +class DisplayMessages extends React.Component { + constructor(props) { + super(props); + this.state = { + input: ", + messages: [] + } + this.handleChange = this.handleChange.bind(this); + this.submitMessage = this.submitMessage.bind(this); + } + handleChange(event) { + this.setState({ + input: event.target.value + }); + } + submitMessage() { + const currentMessage = this.state.input; + this.setState({ + input: ", + messages: this.state.messages.concat(currentMessage) + }); + } + render() { + return ( +
    +

    Type in a new Message:

    +
    + +
      + {this.state.messages.map( (message, idx) => { + return ( +
    • {message}
    • + ) + }) + } +
    +
    + ); + } +}; + +const Provider = ReactRedux.Provider; + +class AppWrapper extends React.Component { + // render the Provider here + + // change code above this line +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/access-props-using-this.props.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/access-props-using-this.props.arabic.md new file mode 100644 index 0000000000..5b0aa2221f --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/access-props-using-this.props.arabic.md @@ -0,0 +1,99 @@ +--- +id: 5a24c314108439a4d403616e +title: Access Props Using this.props +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: '' +--- + +## Description +
    غطت التحديات الأخيرة عدة الطرق الأساسية لتمرير الدعائم لمكونات الطفل. ولكن ماذا لو كان المكون الفرعي الذي تقوم بتمرير دعم له مكون فئة ES6 بدلاً من مكون وظيفي عديم الحالة؟ يستخدم مكون الفئة ES6 اصطلاحًا مختلفًا قليلاً للوصول إلى الدعائم. في أي وقت تشير إلى مكون فئة داخل نفسه ، يمكنك استخدام this الكلمة. للوصول إلى الدعائم داخل مكون فئة ، يمكنك تهيئة الرمز الذي تستخدمه للوصول إليه باستخدام this العنصر. على سبيل المثال ، إذا كان مكون فئة ES6 يحتوي على دعامة تسمى data ، {this.props.data} في {this.props.data} .
    + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(ResetPassword)); return mockedComponent.children().type() === "div"; })(), "The ResetPassword component should return a single div element.");' + - text: الطفل الرابع من ResetPassword يجب أن يكون ReturnTempPassword المكون. + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(ResetPassword)); return mockedComponent.children().childAt(3).name() === "ReturnTempPassword"; })(), "The fourth child of ResetPassword should be the ReturnTempPassword component.");' + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(ResetPassword)); return mockedComponent.find("ReturnTempPassword").props().tempPassword; })(), "The ReturnTempPassword component should have a prop called tempPassword.");' + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(ResetPassword)); const temp = mockedComponent.find("ReturnTempPassword").props().tempPassword; return typeof temp === "string" && temp.length >= 8; })(), "The tempPassword prop of ReturnTempPassword should be equal to a string of at least 8 characters.");' + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(ResetPassword)); return mockedComponent.find("strong").text() === mockedComponent.find("ReturnTempPassword").props().tempPassword; })(), "The ReturnTempPassword component should display the password you create as the tempPassword prop within strong tags.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +class ReturnTempPassword extends React.Component { + constructor(props) { + super(props); + + } + render() { + return ( +
    + { /* change code below this line */ } +

    Your temporary password is:

    + { /* change code above this line */ } +
    + ); + } +}; + +class ResetPassword extends React.Component { + constructor(props) { + super(props); + + } + render() { + return ( +
    +

    Reset Password

    +

    We've generated a new temporary password for you.

    +

    Please reset this password from your account settings ASAP.

    + { /* change code below this line */ } + + { /* change code above this line */ } +
    + ); + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/add-comments-in-jsx.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/add-comments-in-jsx.arabic.md new file mode 100644 index 0000000000..4abd9ab189 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/add-comments-in-jsx.arabic.md @@ -0,0 +1,69 @@ +--- +id: 5a24bbe0dba28a8d3cbd4c5e +title: Add Comments in JSX +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +
    يحتوي محرر التعليمة البرمجية على عنصر JSX مشابه لما قمت بإنشائه في التحدي الأخير. أضف تعليقًا في مكان ما داخل عنصر div المقدم ، بدون تعديل عناصر h1 أو p الحالية.
    + +## Tests +
    + +```yml +tests: + - text: يجب على JSX المستمر إرجاع عنصر div . + testString: 'assert(JSX.type === "div", "The constant JSX should return a div element.");' + - text: يجب أن يحتوي div على علامة h1 باعتبارها العنصر الأول. + testString: 'assert(JSX.props.children[0].type === "h1", "The div should contain an h1 tag as the first element.");' + - text: يجب أن يحتوي div على علامة p كعنصر ثانٍ. + testString: 'assert(JSX.props.children[1].type === "p", "The div should contain a p tag as the second element.");' + - text: يجب أن تتضمن JSX تعليقًا. + testString: 'getUserInput => assert(getUserInput("index").includes("/*") && getUserInput("index").includes("*/"), "The JSX should include a comment.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +const JSX = ( +
    +

    This is a block of JSX

    +

    Here's a subtitle

    +
    +); + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/add-event-listeners.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/add-event-listeners.arabic.md new file mode 100644 index 0000000000..4808b6d52d --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/add-event-listeners.arabic.md @@ -0,0 +1,98 @@ +--- +id: 5a24c314108439a4d403617e +title: Add Event Listeners +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: اضافة المستمعين الحدث +--- + +## Description +
    تعد طريقة componentDidMount() هي أيضًا أفضل مكان لإرفاق أي مستمعين للحدث تحتاج إلى إضافته للحصول على وظائف محددة. يوفر React نظام أحداث تركيبية يلتف حول نظام الأحداث الأصلي في المتصفحات. هذا يعني أن نظام الأحداث الاصطناعية يتصرف بالضبط نفس الشيء بغض النظر عن متصفح المستخدم - حتى لو كانت الأحداث الأصلية قد تتصرف بشكل مختلف بين المتصفحات المختلفة. لقد سبق لك استخدام بعض معالجات الأحداث الاصطناعية هذه ، مثل onClick() . يعد نظام الحدث الصناعي React رائعًا لاستخدامه لمعظم التفاعلات التي ستديرها على عناصر DOM. ومع ذلك ، إذا كنت تريد إرفاق معالج أحداث إلى كائنات المستند أو النافذة ، يجب عليك القيام بذلك مباشرة.
    + +## Instructions +
    إرفاق مستمع حدث في أسلوب componentDidMount() لأحداث keydown وقم بتشغيل هذه الأحداث handleKeyPress() callback. يمكنك استخدام document.addEventListener() الذي يأخذ الحدث (بين علامتي الاقتباس) كوسيطة أولى والاستدعاء كالوسيطة الثانية. ثم ، في componentWillUnmount() ، إزالة هذا الإصغاء الحدث نفسه. يمكنك تمرير الوسيطات نفسها إلى document.removeEventListener() . من الممارسات الجيدة استخدام طريقة دورة الحياة هذه للقيام بأي تنظيف على مكونات React قبل أن يتم إزالتها وتدميرها. تعد إزالة مستمعي الحدث مثالاً على أحد إجراءات التنظيف.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يقوم MyComponent بعرض عنصر div يلف علامة h1 . + testString: 'assert((() => { const mockedComponent = Enzyme.mount(React.createElement(MyComponent)); return mockedComponent.find("div").children().find("h1").length === 1; })(), "MyComponent should render a div element which wraps an h1 tag.");' + - text: يجب إرفاق مستمع في keydown للمستند في componentDidMount . + testString: 'assert((() => { const mockedComponent = Enzyme.mount(React.createElement(MyComponent)); const didMountString = mockedComponent.instance().componentDidMount.toString(); return new RegExp("document\.addEventListener(.|\n|\r)+keydown(.|\n|\r)+this\.handleKeyPress").test(didMountString); })(), "A keydown listener should be attached to the document in componentDidMount.");' + - text: يجب إزالة مستمع الملف الشخصي من الوثيقة في componentWillUnmount . + testString: 'assert((() => { const mockedComponent = Enzyme.mount(React.createElement(MyComponent)); const willUnmountString = mockedComponent.instance().componentWillUnmount.toString(); return new RegExp("document\.removeEventListener(.|\n|\r)+keydown(.|\n|\r)+this\.handleKeyPress").test(willUnmountString); })(), "The keydown listener should be removed from the document in componentWillUnmount.");' + - text: بمجرد تركيب المكون ، يجب أن يؤدي الضغط على enter تحديث حالته وعلامة h1 المقدمة. + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(MyComponent)); const beforeState = mockedComponent.state("message"); const beforeText = mockedComponent.find("h1").text(); const pressEnterKey = () => { mockedComponent.instance().handleKeyPress({ keyCode: 13 }); return waitForIt(() => { mockedComponent.update(); return { state: mockedComponent.state("message"), text: mockedComponent.find("h1").text()}; });}; const afterKeyPress = await pressEnterKey(); assert(beforeState !== afterKeyPress.state && beforeText !== afterKeyPress.text, "Once the component has mounted, pressing enter should update its state and the rendered h1 tag."); }; ' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +class MyComponent extends React.Component { + constructor(props) { + super(props); + this.state = { + message: " + }; + this.handleEnter = this.handleEnter.bind(this); + this.handleKeyPress = this.handleKeyPress.bind(this); + } + // change code below this line + componentDidMount() { + + } + componentWillUnmount() { + + } + // change code above this line + handleEnter() { + this.setState({ + message: this.state.message + 'You pressed the enter key! ' + }); + } + handleKeyPress(event) { + if (event.keyCode === 13) { + this.handleEnter(); + } + } + render() { + return ( +
    +

    {this.state.message}

    +
    + ); + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/add-inline-styles-in-react.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/add-inline-styles-in-react.arabic.md new file mode 100644 index 0000000000..30d8312fa2 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/add-inline-styles-in-react.arabic.md @@ -0,0 +1,78 @@ +--- +id: 5a24c314108439a4d4036182 +title: Add Inline Styles in React +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: إضافة أنماط مضمنة في React +--- + +## Description +
    ربما لاحظت في التحدي الأخير أن هناك العديد من الاختلافات في بناء الجملة من أنماط HTML المضمنة بالإضافة إلى تعيين سمة style إلى كائن جافا سكريبت. أولاً ، تستخدم أسماء بعض خصائص أنماط CSS حالة الجمل. على سبيل المثال ، تعيين التحدي الأخير حجم الخط مع fontSize بدلاً من font-size . الكلمات الواصلة مثل font-size هي بنية غير صالحة لخصائص كائن جافا سكريبت ، لذا يستخدم React حالة الجمل. وكقاعدة عامة ، تتم كتابة أي خصائص نمط متصل باستخدام حالة الجمل في JSX. من المفترض أن تكون جميع وحدات قيمة قيمة الخاصية (مثل height width fontSize ) في px ما لم يتم تحديد خلاف ذلك. إذا كنت تريد استخدام em ، على سبيل المثال ، يمكنك التفاف القيمة والوحدات بين علامات اقتباس ، مثل {fontSize: "4em"} . بخلاف قيم الطول الافتراضية إلى px ، يجب أن يتم التفاف جميع قيم الخصائص الأخرى بين علامتي اقتباس.
    + +## Instructions +
    إذا كان لديك مجموعة كبيرة من الأنماط ، فيمكنك تعيين object نمط على ثابت للحفاظ على تنظيم التعليمات البرمجية الخاصة بك. uncomment في styles الثابتة وتعلن عن object له ثلاث خصائص النمط والقيم الخاصة بهم. إعطاء div لون "purple" ، حجم خط من 40 ، وحدود من "2px solid purple" . ثم قم بتعيين سمة style تساوي ثابت styles .
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يكون متغير styles object له ثلاث خصائص. + testString: 'assert(Object.keys(styles).length === 3, "The styles variable should be an object with three properties.");' + - text: يجب أن يكون لمتغير styles خاصية color معين بقيمة purple . + testString: 'assert(styles.color === "purple", "The styles variable should have a color property set to a value of purple.");' + - text: '' + testString: 'assert(styles.fontSize === 40, "The styles variable should have a fontSize property set to a value of 40.");' + - text: '' + testString: 'assert(styles.border === "2px solid purple", "The styles variable should have a border property set to a value of 2px solid purple.");' + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.shallow(React.createElement(Colorful)); return mockedComponent.type() === "div"; })(), "The component should render a div element.");' + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.shallow(React.createElement(Colorful)); return (mockedComponent.props().style.color === "purple" && mockedComponent.props().style.fontSize === 40 && mockedComponent.props().style.border === "2px solid purple"); })(), "The div element should have its styles defined by the styles object.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +// const styles = +// change code above this line +class Colorful extends React.Component { + render() { + // change code below this line + return ( +
    Style Me!
    + ); + // change code above this line + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/bind-this-to-a-class-method.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/bind-this-to-a-class-method.arabic.md new file mode 100644 index 0000000000..56cd3962ab --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/bind-this-to-a-class-method.arabic.md @@ -0,0 +1,87 @@ +--- +id: 5a24c314108439a4d4036174 +title: Bind 'this' to a Class Method +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: '' +--- + +## Description +
    بالإضافة إلى إعداد وتحديث state ، يمكنك أيضًا تحديد طرق لفئة مكونك. عادةً ما تحتاج طريقة الصف إلى استخدام this الكلمة الرئيسية حتى تتمكن من الوصول إلى الخصائص على الفئة (مثل state props ) داخل نطاق الطريقة. هناك عدة طرق للسماح لطرق صفك بالوصول إلى this . إحدى الطرق الشائعة هي ربط this بشكل صريح في المُنشئ بحيث يصبح this مرتبطًا بطرق الفئة عند تهيئة المكون. ربما تكون قد لاحظت التحدي الأخير الذي استخدمه this.handleClick = this.handleClick.bind(this) لأسلوب handleClick الخاص به في المُنشئ. ثم ، عند استدعاء دالة مثل هذا this.setState() داخل أسلوب الفصل ، يشير this إلى الفئة ولن يكون undefined . ملاحظة: تعتبر this الكلمة الرئيسية واحدة من أكثر جوانب جافا سكريبت مربكة ولكنها تلعب دورًا مهمًا في التفاعل. على الرغم من أن سلوكه هنا طبيعي تمامًا ، إلا أن هذه الدروس ليست المكان المناسب لمراجعة متعمقة this لذا يرجى الرجوع إلى دروس أخرى إذا كان ما سبق مثيرًا للإرباك!
    + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: يجب أن يقوم MyComponent بإرجاع عنصر div يلف عنصرين ، زر و عنصر h1 ، بهذا الترتيب. + testString: 'assert(Enzyme.mount(React.createElement(MyComponent)).find("div").length === 1 && Enzyme.mount(React.createElement(MyComponent)).find("div").childAt(0).type() === "button" && Enzyme.mount(React.createElement(MyComponent)).find("div").childAt(1).type() === "h1", "MyComponent should return a div element which wraps two elements, a button and an h1 element, in that order.");' + - text: 'يجب تهيئة حالة MyComponent مع زوج القيمة الرئيسية { itemCount: 0 } .' + testString: 'assert(Enzyme.mount(React.createElement(MyComponent)).state("itemCount") === 0, "The state of MyComponent should initialize with the key value pair { itemCount: 0 }.");' + - text: بالنقر على button يجب أن عنصر تشغيل addItem طريقة وزيادة الدولة itemCount من 1 . + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(MyComponent)); const first = () => { mockedComponent.setState({ itemCount: 0 }); return waitForIt(() => mockedComponent.state("itemCount")); }; const second = () => { mockedComponent.find("button").simulate("click"); return waitForIt(() => mockedComponent.state("itemCount")); }; const firstValue = await first(); const secondValue = await second(); assert(firstValue === 0 && secondValue === 1, "Clicking the button element should run the addItem method and increment the state itemCount by 1."); };' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +class MyComponent extends React.Component { + constructor(props) { + super(props); + this.state = { + itemCount: 0 + }; + // change code below this line + + // change code above this line + } + addItem() { + this.setState({ + itemCount: this.state.itemCount + 1 + }); + } + render() { + return ( +
    + { /* change code below this line */ } + + { /* change code above this line */ } +

    Current Item Count: {this.state.itemCount}

    +
    + ); + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/change-inline-css-conditionally-based-on-component-state.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/change-inline-css-conditionally-based-on-component-state.arabic.md new file mode 100644 index 0000000000..92a41480eb --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/change-inline-css-conditionally-based-on-component-state.arabic.md @@ -0,0 +1,95 @@ +--- +id: 5a24c314108439a4d4036189 +title: Change Inline CSS Conditionally Based on Component State +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: تغيير CSS المضمنة بناء على حالة المكون +--- + +## Description +
    في هذه المرحلة ، كنت قد رأيت عدة تطبيقات من تقديم الشرطي واستخدام أنماط مضمنة. إليك مثال آخر يجمع بين هذين الموضوعين. يمكنك أيضًا عرض CSS استنادًا إلى حالة مكون React. للقيام بذلك ، تحقق من شرط ، وإذا تم استيفاء هذا الشرط ، يمكنك تعديل كائن الأنماط الذي تم تعيينه لعناصر JSX في طريقة العرض. هذا النموذج مهم لفهمه لأنه تحول مثير عن النهج التقليدي لتطبيق الأنماط عن طريق تعديل عناصر DOM مباشرة (وهو أمر شائع جدًا مع jQuery ، على سبيل المثال). في هذا النهج ، يجب عليك تتبع متى تتغير العناصر وكذلك التعامل مع التلاعب الفعلي مباشرة. قد يصعب عليك تتبع التغييرات ، مما قد يجعل واجهة المستخدم الخاصة بك غير قابلة للتنبؤ. عندما تقوم بتعيين كائن نمط يستند إلى شرط ، فإنك تصف كيف يجب أن تبدو واجهة المستخدم كدالة لحالة التطبيق. هناك تدفق واضح للمعلومات يتحرك فقط في اتجاه واحد. هذه هي الطريقة المفضلة عند كتابة التطبيقات باستخدام React.
    + +## Instructions +
    يحتوي محرر التعليمة البرمجية على مكون إدخال بسيط يتحكم فيه مع حدود منسقة. تريد نمط أحمر الحدود هذا إذا كان المستخدم يكتب أكثر من 15 حرفًا من النص في مربع الإدخال. أضف شرطًا للتحقق من ذلك ، وإذا كان الشرط صالحًا ، 3px solid red نمط حدود الإدخال إلى 3px solid red . يمكنك تجربتها عن طريق إدخال النص في الإدخال.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يقوم مكون GateKeeper بعرض عنصر div . + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(GateKeeper)); return mockedComponent.find("div").length === 1; })(), "The GateKeeper component should render a div element.");' + - text: يجب أن يتم تهيئة المكون GateKeeper مع مفتاح input الرئيسي الذي تم تعيينه إلى سلسلة فارغة. + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(GateKeeper)); return mockedComponent.state().input === ""; })(), "The GateKeeper component should be initialized with a state key input set to an empty string.");' + - text: يجب أن يقوم مكون GateKeeper بعرض علامة h3 وعلامة input . + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(GateKeeper)); return mockedComponent.find("h3").length === 1 && mockedComponent.find("input").length === 1; })(), "The GateKeeper component should render an h3 tag and an input tag.");' + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(GateKeeper)); return mockedComponent.find("input").props().style.border === "1px solid black"; })(), "The input tag should initially have a style of 1px solid black for the border property.");' + - text: يجب أن تكون علامة input على شكل حد 3px solid red إذا كانت قيمة الإدخال في الحالة أطول من 15 حرفًا. + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 100)); const mockedComponent = Enzyme.mount(React.createElement(GateKeeper)); const simulateChange = (el, value) => el.simulate("change", {target: {value}}); let initialStyle = mockedComponent.find("input").props().style.border; const state_1 = () => { mockedComponent.setState({input: "this is 15 char" }); return waitForIt(() => mockedComponent.find("input").props().style.border )}; const state_2 = () => { mockedComponent.setState({input: "A very long string longer than 15 characters." }); return waitForIt(() => mockedComponent.find("input").props().style.border )}; const style_1 = await state_1(); const style_2 = await state_2(); assert(initialStyle === "1px solid black" && style_1 === "1px solid black" && style_2 === "3px solid red", "The input tag should be styled with a border of 3px solid red if the input value in state is longer than 15 characters."); }; ' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +class GateKeeper extends React.Component { + constructor(props) { + super(props); + this.state = { + input: " + }; + this.handleChange = this.handleChange.bind(this); + } + handleChange(event) { + this.setState({ input: event.target.value }) + } + render() { + let inputStyle = { + border: '1px solid black' + }; + // change code below this line + + // change code above this line + return ( +
    +

    Don't Type Too Much:

    + +
    + ); + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/compose-react-components.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/compose-react-components.arabic.md new file mode 100644 index 0000000000..f28bdd9d09 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/compose-react-components.arabic.md @@ -0,0 +1,147 @@ +--- +id: 5a24c314108439a4d4036166 +title: Compose React Components +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(TypesOfFood)); return mockedComponent.children().type() === "div"; })(), "The TypesOfFood component should return a single div element.");' + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(TypesOfFood)); return mockedComponent.children().childAt(1).name() === "Fruits"; })(), "The TypesOfFood component should return the Fruits component.");' + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(TypesOfFood)); return (mockedComponent.find("Fruits").children().find("NonCitrus").length === 1 && mockedComponent.find("Fruits").children().find("Citrus").length === 1); })(), "The Fruits component should return the NonCitrus component and the Citrus component.");' + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(TypesOfFood)); return mockedComponent.children().childAt(2).name() === "Vegetables"; })(), "The TypesOfFood component should return the Vegetables component below the Fruits component.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +class Fruits extends React.Component { + constructor(props) { + super(props); + } + render() { + return ( +
    +

    Fruits:

    + { /* change code below this line */ } + + { /* change code above this line */ } +
    + ); + } +}; + +class TypesOfFood extends React.Component { + constructor(props) { + super(props); + } + render() { + return ( +
    +

    Types of Food:

    + { /* change code below this line */ } + + { /* change code above this line */ } + +
    + ); + } +}; + +``` + +
    + +### Before Test +
    + +```jsx +class NonCitrus extends React.Component { + render() { + return ( +
    +

    Non-Citrus:

    +
      +
    • Apples
    • +
    • Blueberries
    • +
    • Strawberries
    • +
    • Bananas
    • +
    +
    + ); + } +}; +class Citrus extends React.Component { + render() { + return ( +
    +

    Citrus:

    +
      +
    • Lemon
    • +
    • Lime
    • +
    • Orange
    • +
    • Grapefruit
    • +
    +
    + ); + } +}; +class Vegetables extends React.Component { + render() { + return ( +
    +

    Vegetables:

    +
      +
    • Brussel Sprouts
    • +
    • Broccoli
    • +
    • Squash
    • +
    +
    + ); + } +}; + +``` + +
    + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/create-a-complex-jsx-element.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/create-a-complex-jsx-element.arabic.md new file mode 100644 index 0000000000..43be0e4fff --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/create-a-complex-jsx-element.arabic.md @@ -0,0 +1,66 @@ +--- +id: 5a24bbe0dba28a8d3cbd4c5d +title: Create a Complex JSX Element +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(JSX.type === "div", "The constant JSX should return a div element.");' + - text: '' + testString: 'assert(JSX.props.children[1].type === "p", "The div should contain a p tag as the second element.");' + - text: '' + testString: 'assert(JSX.props.children[2].type === "ul", "The div should contain a ul tag as the third element.");' + - text: '' + testString: 'assert(JSX.props.children[0].type === "h1", "The div should contain an h1 tag as the first element.");' + - text: يجب أن يحتوي الـ ul على ثلاثة عناصر من li . + testString: 'assert(JSX.props.children[2].props.children.length === 3, "The ul should contain three li elements.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +// write your code here + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/create-a-component-with-composition.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/create-a-component-with-composition.arabic.md new file mode 100644 index 0000000000..48e235604d --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/create-a-component-with-composition.arabic.md @@ -0,0 +1,85 @@ +--- +id: 5a24c314108439a4d4036164 +title: Create a Component with Composition +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: يجب أن يقوم مكون React بإرجاع عنصر div مفرد. + testString: 'assert((function() { var shallowRender = Enzyme.shallow(React.createElement(ParentComponent)); return shallowRender.type() === "div"; })(), "The React component should return a single div element.");' + - text: '' + testString: 'assert((function() { var shallowRender = Enzyme.shallow(React.createElement(ParentComponent)); return shallowRender.children().length === 2; })(), "The component should return two nested elements.");' + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(ParentComponent)); return mockedComponent.find("ParentComponent").find("ChildComponent").length === 1; })(), "The component should return the ChildComponent as its second child.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +const ChildComponent = () => { + return ( +
    +

    I am the child

    +
    + ); +}; + +class ParentComponent extends React.Component { + constructor(props) { + super(props); + } + render() { + return ( +
    +

    I am the parent

    + { /* change code below this line */ } + + + { /* change code above this line */ } +
    + ); + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/create-a-controlled-form.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/create-a-controlled-form.arabic.md new file mode 100644 index 0000000000..3131617a03 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/create-a-controlled-form.arabic.md @@ -0,0 +1,101 @@ +--- +id: 5a24c314108439a4d4036179 +title: Create a Controlled Form +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: إنشاء نموذج التحكم +--- + +## Description +
    أظهر التحدي الأخير أن React يمكنه التحكم في الحالة الداخلية لعناصر معينة مثل input و textarea ، مما يجعلها مكونات متحكم فيها. ينطبق هذا على عناصر النموذج الأخرى أيضًا ، بما في ذلك عنصر form HTML المعتاد.
    + +## Instructions +
    تم إعداد المكون MyForm form فارغ باستخدام معالج إرسال. سيتم استدعاء معالج الإرسال عند إرسال النموذج. لقد أضفنا زرًا يرسل النموذج. يمكنك أن ترى أنه قد تم تعيين type submit يشير إلى أنه الزر الذي يتحكم في النموذج. إضافة عنصر input في form وتعيين value وخصائص onChange() مثل التحدي الأخير. يجب عليك ثم أكمل handleSubmit طريقة بحيث يضع ممتلكات الدولة المكونة submit إلى قيمة المدخلات الحالية في المحلية state . ملاحظة: يجب عليك أيضًا استدعاء event.preventDefault() في معالج event.preventDefault() ، لمنع سلوك إرسال النموذج الافتراضي الذي سيؤدي إلى تحديث صفحة الويب. وأخيرا، إنشاء h1 بعد علامة form مما يجعل submit القيمة من المكون state . يمكنك بعد ذلك كتابة النموذج والنقر فوق الزر (أو الضغط على Enter) ، ويجب أن تشاهد الإدخال الخاص بك تم تقديمه إلى الصفحة.
    + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert((() => { const mockedComponent = Enzyme.mount(React.createElement(MyForm)); return (mockedComponent.find("div").children().find("form").length === 1 && mockedComponent.find("div").children().find("h1").length === 1 && mockedComponent.find("form").children().find("input").length === 1 && mockedComponent.find("form").children().find("button").length === 1) })(), "MyForm should return a div element which contains a form and an h1 tag. The form should include an input and a button.");' + - text: '' + testString: 'assert(Enzyme.mount(React.createElement(MyForm)).state("input") === "" && Enzyme.mount(React.createElement(MyForm)).state("submit") === "", "The state of MyForm should initialize with input and submit properties, both set to empty strings.");' + - text: '' + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(MyForm)); const _1 = () => { mockedComponent.setState({ input: "" }); return waitForIt(() => mockedComponent.state("input"))}; const _2 = () => { mockedComponent.find("input").simulate("change", { target: { value: "TestInput" }}); return waitForIt(() => ({ state: mockedComponent.state("input"), inputVal: mockedComponent.find("input").props().value }))}; const before = await _1(); const after = await _2(); assert(before === "" && after.state === "TestInput" && after.inputVal === "TestInput", "Typing in the input element should update the input property of the component's state."); }; ' + - text: يجب تقديم نموذج تشغيل handleSubmit التي ينبغي أن تحدد submit العقارات في دولة تساوي المدخلات الحالية. + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(MyForm)); const _1 = () => { mockedComponent.setState({ input: "" }); mockedComponent.setState({submit: ""}); mockedComponent.find("input").simulate("change", {target: {value: "SubmitInput"}}); return waitForIt(() => mockedComponent.state("submit"))}; const _2 = () => { mockedComponent.find("form").simulate("submit"); return waitForIt(() => mockedComponent.state("submit"))}; const before = await _1(); const after = await _2(); assert(before === "" && after === "SubmitInput", "Submitting the form should run handleSubmit which should set the submit property in state equal to the current input."); };' + - text: يجب أن يعرض رأس h1 قيمة حقل " submit من حالة المكوِّن. + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(MyForm)); const _1 = () => { mockedComponent.setState({ input: "" }); mockedComponent.setState({submit: ""}); mockedComponent.find("input").simulate("change", {target: {value: "TestInput"}}); return waitForIt(() => mockedComponent.find("h1").text())}; const _2 = () => { mockedComponent.find("form").simulate("submit"); return waitForIt(() => mockedComponent.find("h1").text())}; const before = await _1(); const after = await _2(); assert(before === "" && after === "TestInput", "The h1 header should render the value of the submit field from the component's state."); }; ' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +class MyForm extends React.Component { + constructor(props) { + super(props); + this.state = { + input: ", + submit: " + }; + this.handleChange = this.handleChange.bind(this); + this.handleSubmit = this.handleSubmit.bind(this); + } + handleChange(event) { + this.setState({ + input: event.target.value + }); + } + handleSubmit(event) { + // change code below this line + + // change code above this line + } + render() { + return ( +
    +
    + { /* change code below this line */ } + + { /* change code above this line */ } + +
    + { /* change code below this line */ } + + { /* change code above this line */ } +
    + ); + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/create-a-controlled-input.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/create-a-controlled-input.arabic.md new file mode 100644 index 0000000000..cdaf98872b --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/create-a-controlled-input.arabic.md @@ -0,0 +1,86 @@ +--- +id: 5a24c314108439a4d4036178 +title: Create a Controlled Input +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: يجب أن يعرض ControlledInput عنصر div يحتوي على input وعلامة p . + testString: 'assert(Enzyme.mount(React.createElement(ControlledInput)).find("div").children().find("input").length === 1 && Enzyme.mount(React.createElement(ControlledInput)).find("div").children().find("p").length === 1, "ControlledInput should return a div element which contains an input and a p tag.");' + - text: يجب تهيئة حالة ControlledInput مع خاصية input لتعيين سلسلة فارغة. + testString: 'assert.strictEqual(Enzyme.mount(React.createElement(ControlledInput)).state("input"), "", "The state of ControlledInput should initialize with an input property set to an empty string.");' + - text: يجب أن تؤدي الكتابة في عنصر الإدخال إلى تحديث الحالة وقيمة الإدخال ، ويجب أن يعرض العنصر p هذه الحالة أثناء الكتابة. + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(ControlledInput)); const _1 = () => { mockedComponent.setState({ input: "" }); return waitForIt(() => mockedComponent.state("input"))}; const _2 = () => { mockedComponent.find("input").simulate("change", { target: { value: "TestInput" }}); return waitForIt(() => ({ state: mockedComponent.state("input"), text: mockedComponent.find("p").text(), inputVal: mockedComponent.find("input").props().value }))}; const before = await _1(); const after = await _2(); assert(before === "" && after.state === "TestInput" && after.text === "TestInput" && after.inputVal === "TestInput", "Typing in the input element should update the state and the value of the input, and the p element should render this state as you type."); }; ' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +class ControlledInput extends React.Component { + constructor(props) { + super(props); + this.state = { + input: " + }; + // change code below this line + + // change code above this line + } + // change code below this line + + // change code above this line + render() { + return ( +
    + { /* change code below this line */} + + { /* change code above this line */} +

    Controlled Input:

    +

    {this.state.input}

    +
    + ); + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/create-a-react-component.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/create-a-react-component.arabic.md new file mode 100644 index 0000000000..17223c03d5 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/create-a-react-component.arabic.md @@ -0,0 +1,73 @@ +--- +id: 5a24c314108439a4d4036163 +title: Create a React Component +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: إنشاء مكون React +--- + +## Description +
    والطريقة الأخرى لتعريف مكون React تكون مع بنية class ES6. في المثال التالي ، يقوم Kitten بتوسيع React.Component :
    class Kitten يمد React.Component {
    منشئ (الدعائم) {
    السوبر (الدعائم)؛
    }

    يجعل() {
    إرجاع (
    <h1> تحليل مرحبا </ H1>

    }
    }
    هذا ينشئ فئة ES6 Kitten الذي يمتد فئة React.Component . لذا ، أصبح بإمكان فئة Kitten الآن الوصول إلى العديد من ميزات React المفيدة ، مثل الخطافات المحلية ودورة الحياة. لا تقلق إذا لم تكن على دراية بهذه الشروط حتى الآن ، سيتم تغطيتها بمزيد من التفصيل في تحديات لاحقة. لاحظ أيضًا أن فئة Kitten بها constructor مُعرَّف داخلها يستدعي super() . ويستخدم super() لاستدعاء منشئ الفئة الأصل ، في هذه الحالة React.Component . المنشئ هو طريقة خاصة تستخدم أثناء تهيئة الكائنات التي يتم إنشاؤها باستخدام الكلمة الأساسية class . ومن أفضل الممارسات لاستدعاء المكون constructor مع super ، وتمرير props على حد سواء. هذا يجعل من تهيئة المكون بشكل صحيح. في الوقت الحالي ، اعلم أنه من المعتاد تضمين هذا الرمز. قريبا سترى استخدامات أخرى للمنشئ وكذلك props .
    + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: يجب أن يعيد مكون React عنصر div . + testString: 'assert(Enzyme.shallow(React.createElement(MyComponent)).type() === "div", "The React component should return a div element.");' + - text: يجب على div إرجاعه عرض رأس h1 بداخله. + testString: 'assert(/

    .*<\/h1><\/div>/.test(Enzyme.shallow(React.createElement(MyComponent)).html()), "The returned div should render an h1 header within it.");' + - text: يجب أن يحتوي رأس h1 على السلسلة Hello React! . + testString: 'assert(Enzyme.shallow(React.createElement(MyComponent)).html() === "

    Hello React!

    ", "The h1 header should contain the string Hello React!.");' + +``` + +

    + +## Challenge Seed +
    + +
    + +```jsx +class MyComponent extends React.Component { + constructor(props) { + super(props); + } + render() { + // change code below this line + + + + // change code above this line + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/create-a-simple-jsx-element.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/create-a-simple-jsx-element.arabic.md new file mode 100644 index 0000000000..8280316aeb --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/create-a-simple-jsx-element.arabic.md @@ -0,0 +1,60 @@ +--- +id: 587d7dbc367417b2b2512bb1 +title: Create a Simple JSX Element +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: إنشاء عنصر بسيط JSX +--- + +## Description +
    مقدمة: React هي مكتبة مفتوحة المصدر تم إنشاؤها بواسطة Facebook. إنها أداة رائعة لعرض واجهة المستخدم (UI) لتطبيقات الويب الحديثة. يستخدم React امتدادًا لغويًا لجافا سكريبت يُسمى JSX والذي يسمح لك بكتابة HTML مباشرةً داخل JavaScript. هذا له العديد من الفوائد. فهو يتيح لك استخدام القوة البرمجية الكاملة لجافا سكريبت في HTML ، ويساعد على إبقاء كودك قابلاً للقراءة. بالنسبة للجزء الأكبر ، تشبه JSX HTML الذي تعلمته بالفعل ، ولكن هناك بعض الاختلافات الأساسية التي سيتم تغطيتها خلال هذه التحديات. على سبيل المثال ، نظرًا لأن JSX عبارة عن امتداد نحوي لجافا سكريبت ، يمكنك في الواقع كتابة JavaScript مباشرة داخل JSX. للقيام بذلك ، ما عليك سوى تضمين الشفرة التي تريد معاملتها على هيئة JavaScript ضمن أقواس معقوفة: { 'this is treated as JavaScript code' } . ضع ذلك في الاعتبار ، نظرًا لأنه يُستخدم في العديد من التحديات المستقبلية. ومع ذلك ، نظرًا لأن JSX ليس جافا سكريبت صالحًا ، يجب ترجمة شفرة JSX إلى جافا سكريبت. أداة النقل المشذر Babel هي أداة شائعة لهذه العملية. من أجل راحتك ، تمت إضافة بالفعل خلف الكواليس لهذه التحديات. إذا حدث لك أن تكتب JSX غير صحيح من الناحية التركيبية ، فسترى أول اختبار في هذه التحديات يفشل. تجدر الإشارة إلى أنه تحت غطاء محرك السيارة التحديات تدعوا ReactDOM.render(JSX, document.getElementById('root')) . هذه الدعوة الدالة هي ما يضع JSX الخاص بك في تمثيل React خفيف الوزن الخاص بـ DOM. ثم تستخدم React لقطات من DOM الخاصة بها لتحسين تحديث أجزاء معينة فقط من DOM الفعلي.
    + +## Instructions +
    التعليمات: تستخدم الشفرة الحالية JSX لتعيين عنصر div إلى JSX المستمر. استبدل div بعنصر h1 وأضف النص Hello JSX! داخله.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يقوم JSX المستمر بإرجاع عنصر h1 . + testString: 'assert(JSX.type === "h1", "The constant JSX should return an h1 element.");' + - text: يجب أن تتضمن علامة h1 النص Hello JSX! + testString: 'assert(Enzyme.shallow(JSX).contains("Hello JSX!"), "The h1 tag should include the text Hello JSX!");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +const JSX =
    ; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/create-a-stateful-component.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/create-a-stateful-component.arabic.md new file mode 100644 index 0000000000..a87b547bf9 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/create-a-stateful-component.arabic.md @@ -0,0 +1,77 @@ +--- +id: 5a24c314108439a4d4036170 +title: Create a Stateful Component +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: إنشاء مكون Stateful +--- + +## Description +
    واحدة من أهم المواضيع في React هي state . تتكون الولاية من أي بيانات يحتاج معرفتك إلى معرفتها ، والتي يمكن أن تتغير بمرور الوقت. تريد أن تستجيب تطبيقاتك لتغييرات الحالة وأن تقدم واجهة مستخدم محدثة عند الضرورة. React يقدم حلا لطيفا لإدارة الدولة لتطبيقات الويب الحديثة. يمكنك إنشاء حالة في مكون React بواسطة تعريف خاصية state في فئة المكون في constructor . يقوم هذا بتهيئة المكون state عند إنشائه. يجب تعيين خاصية state إلى object JavaScript. الإعلان عن هذا الشكل:
    this.state = {
    // وصف الولاية الخاصة بك هنا
    } يمكنك الوصول إلى كائن state طوال عمر المكون الخاص بك. يمكنك تحديثه ، وجعله في واجهة المستخدم الخاصة بك ، وتمريره على شكل دعائم لمكونات الطفل. يمكن أن يكون كائن state معقدًا أو بسيطًا مثلما تحتاج إليه. لاحظ أنه يجب إنشاء مكون فئة بتوسيع React.Component لإنشاء state مثل هذا.
    + +## Instructions +
    هناك عنصر في محرر التعليمات البرمجية التي تحاول لتقديم name العقار من في state . ومع ذلك ، لا توجد state محددة. قم بتهيئة المكون state في constructor وتعيين اسمك إلى خاصية name .
    + +## Tests +
    + +```yml +tests: + - text: يجب أن توجد StatefulComponent ثم تقديم. + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(StatefulComponent)); return mockedComponent.find("StatefulComponent").length === 1; })(), "StatefulComponent should exist and render.");' + - text: يجب أن يقدم StatefulComponent div و عنصر h1 . + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(StatefulComponent)); return mockedComponent.find("div").length === 1 && mockedComponent.find("h1").length === 1; })(), "StatefulComponent should render a div and an h1 element.");' + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(StatefulComponent)); const initialState = mockedComponent.state(); return ( typeof initialState === "object" && typeof initialState.name === "string"); })(), "The state of StatefulComponent should be initialized with a property name set to a string.");' + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(StatefulComponent)); const initialState = mockedComponent.state(); return mockedComponent.find("h1").text() === initialState.name; })(), "The property name in the state of StatefulComponent should render in the h1 element.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +class StatefulComponent extends React.Component { + constructor(props) { + super(props); + // initialize state here + + } + render() { + return ( +
    +

    {this.state.name}

    +
    + ); + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/create-a-stateless-functional-component.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/create-a-stateless-functional-component.arabic.md new file mode 100644 index 0000000000..9ba6b2a889 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/create-a-stateless-functional-component.arabic.md @@ -0,0 +1,68 @@ +--- +id: 5a24c314108439a4d4036162 +title: Create a Stateless Functional Component +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: إنشاء مكون وظيفي عديم الحالة +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: يجب على MyComponent إرجاع JSX. + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(MyComponent)); return mockedComponent.length === 1; })(), "MyComponent should return JSX.");' + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(MyComponent)); return mockedComponent.children().type() === "div" })(), "MyComponent should return a div element.");' + - text: يجب أن يحتوي عنصر div على سلسلة من النص. + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(MyComponent)); return mockedComponent.find("div").text() !== ""; })(), "The div element should contain a string of text.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +const MyComponent = function() { + // change code below this line + + + + // change code above this line +} + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/define-an-html-class-in-jsx.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/define-an-html-class-in-jsx.arabic.md new file mode 100644 index 0000000000..bb07119f4c --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/define-an-html-class-in-jsx.arabic.md @@ -0,0 +1,64 @@ +--- +id: 5a24c314108439a4d4036160 +title: Define an HTML Class in JSX +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: تحديد فئة HTML في JSX +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert.strictEqual(JSX.type, "div", "The constant JSX should return a div element.");' + - text: '' + testString: 'assert.strictEqual(JSX.props.className, "myDiv", "The div has a class of myDiv.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +const JSX = ( +
    +

    Add a class to this div

    +
    +); + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/give-sibling-elements-a-unique-key-attribute.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/give-sibling-elements-a-unique-key-attribute.arabic.md new file mode 100644 index 0000000000..cdc0ae8a65 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/give-sibling-elements-a-unique-key-attribute.arabic.md @@ -0,0 +1,85 @@ +--- +id: 5a24c314108439a4d403618b +title: Give Sibling Elements a Unique Key Attribute +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(Enzyme.mount(React.createElement(Frameworks)).find("Frameworks").length === 1, "The Frameworks component should exist and render to the page.");' + - text: Frameworks يجب ان يجعل h1 عنصر. + testString: 'assert(Enzyme.mount(React.createElement(Frameworks)).find("h1").length === 1, "Frameworks should render an h1 element.");' + - text: '' + testString: 'assert(Enzyme.mount(React.createElement(Frameworks)).find("ul").length === 1, "Frameworks should render a ul element.");' + - text: '' + testString: 'assert(Enzyme.mount(React.createElement(Frameworks)).find("ul").children().length === 6 && Enzyme.mount(React.createElement(Frameworks)).find("ul").childAt(0).name() === "li" && Enzyme.mount(React.createElement(Frameworks)).find("li").length === 6, "The ul tag should render 6 child li elements.");' + - text: يجب أن يكون كل عنصر قائمة البند فريدة من نوعها key السمة. + testString: 'assert((() => { const ul = Enzyme.mount(React.createElement(Frameworks)).find("ul"); const keys = new Set([ ul.childAt(0).key(), ul.childAt(1).key(), ul.childAt(2).key(), ul.childAt(3).key(), ul.childAt(4).key(), ul.childAt(5).key(), ]); return keys.size === 6; })(), "Each list item element should have a unique key attribute.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +const frontEndFrameworks = [ + 'React', + 'Angular', + 'Ember', + 'Knockout', + 'Backbone', + 'Vue' +]; + +function Frameworks() { + const renderFrameworks = null; // change code here + return ( +
    +

    Popular Front End JavaScript Frameworks

    +
      + {renderFrameworks} +
    +
    + ); +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/introducing-inline-styles.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/introducing-inline-styles.arabic.md new file mode 100644 index 0000000000..af4b0ee482 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/introducing-inline-styles.arabic.md @@ -0,0 +1,68 @@ +--- +id: 5a24c314108439a4d4036181 +title: Introducing Inline Styles +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: '' +--- + +## Description +
    هناك مفاهيم معقدة أخرى تضيف إمكانات قوية لرمز React الخاص بك. ولكن قد تتساءل عن المشكلة الأكثر بساطة حول كيفية تصميم عناصر JSX التي تقوم بإنشائها في React. من المحتمل أنك تعلم أنه لن يكون بالضبط نفس العمل مع HTML بسبب طريقة تطبيق الطبقات على عناصر JSX . إذا قمت باستيراد أنماط من ورقة أنماط ، فإنها لا تختلف كثيرًا على الإطلاق. يمكنك تطبيق فئة على عنصر JSX باستخدام السمة className ، وتطبيق الأنماط على الفصل الدراسي في ورقة الأنماط. خيار آخر هو تطبيق الأنماط المضمنة ، والتي تكون شائعة جدًا في تطوير ReactJS. يمكنك تطبيق أنماط مضمنة على عناصر JSX مشابهة لطريقة عمل ذلك في HTML ، ولكن مع بعض الاختلافات في JSX. في ما يلي مثال لنمط مضمَّن في HTML: <div style="color: yellow; font-size: 16px">Mellow Yellow</div> تستخدم عناصر JSX سمة style ، ولكن نظرًا لطريقة تشفير JSX ، يمكنك قم بتعيين القيمة إلى string . بدلاً من ذلك ، يمكنك تعيينه يساوي object JavaScript. إليك مثال على ذلك: <div style={{color: "yellow", fontSize: 16}}>Mellow Yellow</div> لاحظ كيف نحصل على خاصية "fontSize"؟ وذلك لأن React لن يقبل مفاتيح حالة الكباب في كائن النمط. سيطبق React اسم الخاصية الصحيح لنا في HTML.
    + +## Instructions +
    أضف سمة style إلى div في محرر الشفرة لإعطاء النص لونًا أحمر وحجم خط يبلغ 72 بكسل. لاحظ أنه يمكنك تعيين حجم الخط بشكل اختياري ليكون رقمًا ، أو حذف الوحدات "px" ، أو كتابتها كـ "72px".
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يعرض المكون عنصر div . + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(Colorful)); return mockedComponent.children().type() === "div"; })(), "The component should render a div element.");' + - text: يجب أن يكون عنصر div بلون red . + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(Colorful)); return mockedComponent.children().props().style.color === "red"; })(), "The div element should have a color of red.");' + - text: يجب أن يكون حجم عنصر div بحجم 72px . + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(Colorful)); return (mockedComponent.children().props().style.fontSize === 72 || mockedComponent.children().props().style.fontSize === "72" || mockedComponent.children().props().style.fontSize === "72px"); })(), "The div element should have a font size of 72px.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +class Colorful extends React.Component { + render() { + return ( +
    Big Red
    + ); + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/learn-about-self-closing-jsx-tags.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/learn-about-self-closing-jsx-tags.arabic.md new file mode 100644 index 0000000000..aa3ca0adeb --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/learn-about-self-closing-jsx-tags.arabic.md @@ -0,0 +1,70 @@ +--- +id: 5a24c314108439a4d4036161 +title: Learn About Self-Closing JSX Tags +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: تعرف على علامات JSX ذاتية الإغلاق +--- + +## Description +
    لقد رأيت حتى الآن كيف يختلف JSX عن HTML بطريقة أساسية باستخدام className مقابل class لتعريف فئات HTML. هناك طريقة أخرى مهمة تختلف بها JSX عن HTML وهي فكرة العلامة ذاتية الإغلاق. في HTML ، تحتوي كل العلامات تقريبًا على علامة فتح وإغلاق: <div></div> ؛ تحتوي علامة الإغلاق دائمًا على شرطة مائلة للأمام قبل اسم العلامة الذي تقوم بإغلاقه. ومع ذلك ، هناك حالات خاصة في HTML تسمى "علامات الإغلاق الذاتي" ، أو العلامات التي لا تتطلب علامة فتح وإغلاق قبل أن تبدأ علامة أخرى. على سبيل المثال ، يمكن كتابة علامة فاصل الخط كـ <br> أو كـ <br /> ، ولكن لا يجب كتابتها أبدًا كـ <br></br> لأنها لا تحتوي على أي محتوى. في JSX ، تختلف القواعد قليلاً. يمكن كتابة أي عنصر JSX بعلامة إغلاق ذاتي ، ويجب إغلاق كل عنصر. على سبيل المثال ، يجب كتابة علامة فاصل الأسطر ، على سبيل المثال ، <br /> لكي تكون JSX سارية ويمكن تحريكها. يمكن كتابة <div> ، على الجانب الآخر ، كـ <div /> أو <div></div> . والفرق هو أنه في طريقة تركيب الجملة الأولى لا توجد طريقة لتضمين أي شيء في <div /> . سترى في تحديات لاحقة أن بناء الجملة هذا مفيد عند تقديم مكونات React.
    + +## Instructions +
    أصلح الأخطاء في محرر الشفرة بحيث تكون JSX صالحة وتنتهي بنجاح. تأكد من عدم تغيير أي محتوى - فأنت تحتاج فقط إلى إغلاق العلامات عند الحاجة إليها.
    + +## Tests +
    + +```yml +tests: + - text: يجب على JSX المستمر إرجاع عنصر div . + testString: 'assert.strictEqual(JSX.type, "div", "The constant JSX should return a div element.");' + - text: يجب أن يحتوي div على علامة br . + testString: 'assert(Enzyme.shallow(JSX).find("br").length === 1, "The div should contain a br tag.");' + - text: يجب أن يحتوي div على علامة hr . + testString: 'assert(Enzyme.shallow(JSX).find("hr").length === 1, "The div should contain an hr tag.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +const JSX = ( +
    + {/* remove comment and change code below this line +

    Welcome to React!


    +

    Be sure to close all tags!

    +
    + remove comment and change code above this line */} +
    +); + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/manage-updates-with-lifecycle-methods.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/manage-updates-with-lifecycle-methods.arabic.md new file mode 100644 index 0000000000..48fbe1e0a4 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/manage-updates-with-lifecycle-methods.arabic.md @@ -0,0 +1,100 @@ +--- +id: 5a24c314108439a4d403617f +title: Manage Updates with Lifecycle Methods +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: إدارة التحديثات باستخدام أساليب دورة الحياة +--- + +## Description +
    هناك طريقة أخرى لدورة الحياة هي componentWillReceiveProps() والتي يتم استدعاؤها كلما تلقى المكون الدعائم الجديدة. يتلقى هذا الأسلوب الدعائم الجديدة كوسيطة ، والتي عادة ما تتم كتابتها على شكل nextProps . يمكنك استخدام هذه الوسيطة ومقارنتها مع هذا this.props وتنفيذ الإجراءات قبل تحديث المكون. على سبيل المثال ، يمكنك استدعاء setState() محليًا قبل معالجة التحديث. طريقة أخرى هي componentDidUpdate() ، وتسمى على الفور بعد إعادة عرض المكون. لاحظ أن التقديم والتثبيت يعتبران أشياء مختلفة في دورة حياة المكونات. عندما يتم تحميل الصفحة أولاً ، يتم تحميل جميع المكونات وهذا هو المكان الذي يتم فيه استدعاء أساليب مثل componentWillMount() و componentDidMount() . بعد ذلك ، مع تغير الدولة ، تقوم المكونات بإعادة تقديم نفسها. التحدي التالي يغطي هذا بمزيد من التفصيل.
    + +## Instructions +
    يتلقى مربع Dialog المكون التابع الدعائم message من أصلها ، مكون " Controller . اكتب أسلوب componentWillReceiveProps() في مكون " Dialog وقم this.props و nextProps إلى وحدة التحكم. ستحتاج إلى تمرير nextProps كحجة لهذه الطريقة ، وعلى الرغم من أنه من الممكن تسمية أي شيء ، nextProps ذلك هنا. بعد ذلك ، قم بإضافة componentDidUpdate() في مكون Dialog ، وقم بتسجيل عبارة تقول أن المكون قد تم تحديثه. تعمل هذه الطريقة على غرار componentWillUpdate() ، الذي يتم توفيره لك. الآن انقر فوق الزر لتغيير الرسالة ومشاهدة وحدة تحكم المستعرض الخاص بك. يعرض ترتيب عبارات وحدة التحكم الترتيب الذي تسمى الطرق. ملاحظة: ستحتاج إلى كتابة أساليب دورة الحياة كوظائف عادية وليس كدالة سهم لاجتياز الاختبارات (لا توجد أيضًا ميزة لكتابة أساليب دورة الحياة كدالة سهم).
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يقوم مكون " Controller بعرض مكون " Dialog " كطفل. + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(Controller)); return mockedComponent.find("Controller").length === 1 && mockedComponent.find("Dialog").length === 1; })(), "The Controller component should render the Dialog component as a child.");' + - text: يجب أن يتم تسجيل أسلوب componentWillReceiveProps في مكون Dialog this.props إلى وحدة التحكم. + testString: 'assert((function() { const lifecycleChild = React.createElement(Dialog).type.prototype.componentWillReceiveProps.toString().replace(/ /g,""); return lifecycleChild.includes("console.log") && lifecycleChild.includes("this.props") })(), "The componentWillReceiveProps method in the Dialog component should log this.props to the console.");' + - text: يجب أن يسجل الأسلوب componentWillReceiveProps في مكون Dialog nextProps إلى وحدة التحكم. + testString: 'assert((function() { const lifecycleChild = React.createElement(Dialog).type.prototype.componentWillReceiveProps.toString().replace(/ /g,""); const nextPropsAsParameterTest = /componentWillReceiveProps(| *?= *?)(\(|)nextProps(\)|)( *?=> *?{| *?{|{)/; const nextPropsInConsoleLogTest = /console\.log\(.*?nextProps\b.*?\)/; return ( lifecycleChild.includes("console.log") && nextPropsInConsoleLogTest.test(lifecycleChild) && nextPropsAsParameterTest.test(lifecycleChild) ); })(), "The componentWillReceiveProps method in the Dialog component should log nextProps to the console.");' + - text: يجب استدعاء مكون Dialog أسلوب componentDidUpdate وتسجيل رسالة إلى وحدة التحكم. + testString: 'assert((function() { const lifecycleChild = React.createElement(Dialog).type.prototype.componentDidUpdate.toString().replace(/ /g,""); return lifecycleChild.length !== "undefined" && lifecycleChild.includes("console.log"); })(), "The Dialog component should call the componentDidUpdate method and log a message to the console.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +class Dialog extends React.Component { + constructor(props) { + super(props); + } + componentWillUpdate() { + console.log('Component is about to update...'); + } + // change code below this line + + // change code above this line + render() { + return

    {this.props.message}

    + } +}; + +class Controller extends React.Component { + constructor(props) { + super(props); + this.state = { + message: 'First Message' + }; + this.changeMessage = this.changeMessage.bind(this); + } + changeMessage() { + this.setState({ + message: 'Second Message' + }); + } + render() { + return ( +
    + + +
    + ); + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/optimize-re-renders-with-shouldcomponentupdate.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/optimize-re-renders-with-shouldcomponentupdate.arabic.md new file mode 100644 index 0000000000..838b5b16f5 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/optimize-re-renders-with-shouldcomponentupdate.arabic.md @@ -0,0 +1,106 @@ +--- +id: 5a24c314108439a4d4036180 +title: Optimize Re-Renders with shouldComponentUpdate +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: تحسين Re-Renders مع shouldComponentUpdate +--- + +## Description +
    حتى الآن ، إذا تلقى أي مكون state جديدة أو props جديدة ، فإنه يعيد نفسه وجميع أبنائه. هذا عادة ما يرام. لكن React يوفر طريقة دورة حياة يمكنك الاتصال بها عندما تتلقى مكونات state الطفل أو props الجديدة ، وتعلن تحديدًا إذا كان يجب تحديث المكونات أم لا. هذه الطريقة هي shouldComponentUpdate() ، وتستغرق nextProps و nextState كمعلمات. هذه الطريقة هي طريقة مفيدة لتحسين الأداء. على سبيل المثال ، السلوك الافتراضي هو أن المكون الخاص بك re-renders عندما يتلقى props الجديدة ، حتى إذا لم يتم تغيير props . يمكنك استخدام shouldComponentUpdate() لمنع هذا عن طريق مقارنة props . يجب أن تقوم الطريقة بإرجاع قيمة boolean تخبر رد ما إذا كان سيتم تحديث المكون أم لا. يمكنك مقارنة الدعائم الحالية ( this.props ) this.props التالية ( nextProps ) لتحديد ما إذا كنت بحاجة إلى التحديث أم لا ، وإرجاع true أو false وفقًا لذلك.
    + +## Instructions +
    يتم إضافة أسلوب shouldComponentUpdate() في مكون يسمى OnlyEvens . حاليًا ، يعود هذا الأسلوب إلى true لذا تعيد OnlyEvens الظهور في كل مرة تتلقى فيها props الجديدة. قم بتعديل الطريقة بحيث لا يتم تحديث OnlyEvens إلا إذا كانت value الدعائم الجديدة حتى. انقر فوق الزر " Add وشاهد ترتيب الأحداث في وحدة تحكم المستعرض الخاص بك أثناء تشغيل hooks دورة الحياة الأخرى.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يقوم مكون Controller OnlyEvens مكون OnlyEvens كطفل. + testString: 'assert((() => { const mockedComponent = Enzyme.mount(React.createElement(Controller)); return mockedComponent.find("Controller").length === 1 && mockedComponent.find("OnlyEvens").length === 1; })(), "The Controller component should render the OnlyEvens component as a child.");' + - text: '' + testString: 'assert((() => { const child = React.createElement(OnlyEvens).type.prototype.shouldComponentUpdate.toString().replace(/s/g,""); return child !== "undefined"; })(), "The shouldComponentUpdate method should be defined on the OnlyEvens component.");' + - text: '' + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(Controller)); const first = () => { mockedComponent.setState({ value: 1000 }); return waitForIt(() => mockedComponent.find("h1").html()); }; const second = () => { mockedComponent.setState({ value: 10 }); return waitForIt(() => mockedComponent.find("h1").html()); }; const firstValue = await first(); const secondValue = await second(); assert(firstValue === "

    1000

    " && secondValue === "

    10

    ", "The OnlyEvens component should return an h1 tag which renders the value of this.props.value."); }; ' + - text: '' + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(Controller)); const first = () => { mockedComponent.setState({ value: 8 }); return waitForIt(() => mockedComponent.find("h1").text()); }; const second = () => { mockedComponent.setState({ value: 7 }); return waitForIt(() => mockedComponent.find("h1").text()); }; const third = () => { mockedComponent.setState({ value: 42 }); return waitForIt(() => mockedComponent.find("h1").text()); }; const firstValue = await first(); const secondValue = await second(); const thirdValue = await third(); assert(firstValue === "8" && secondValue === "8" && thirdValue === "42", "OnlyEvens should re-render only when nextProps.value is even."); }; ' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +class OnlyEvens extends React.Component { + constructor(props) { + super(props); + } + shouldComponentUpdate(nextProps, nextState) { + console.log('Should I update?'); + // change code below this line + return true; + // change code above this line + } + componentWillReceiveProps(nextProps) { + console.log('Receiving new props...'); + } + componentDidUpdate() { + console.log('Component re-rendered.'); + } + render() { + return

    {this.props.value}

    + } +}; + +class Controller extends React.Component { + constructor(props) { + super(props); + this.state = { + value: 0 + }; + this.addValue = this.addValue.bind(this); + } + addValue() { + this.setState({ + value: this.state.value + 1 + }); + } + render() { + return ( +
    + + +
    + ); + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/override-default-props.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/override-default-props.arabic.md new file mode 100644 index 0000000000..017700b0c4 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/override-default-props.arabic.md @@ -0,0 +1,79 @@ +--- +id: 5a24c314108439a4d403616c +title: Override Default Props +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: تجاوز الدعائم الافتراضية +--- + +## Description +
    تعد القدرة على ضبط الأدوات الافتراضية هي ميزة مفيدة في React. تتمثل طريقة تجاوز الدعائم الافتراضية في تعيين قيم الدعامة للمكون بشكل صريح.
    + +## Instructions +
    مكون ShoppingCart الآن يعرض Items مكون تابعة. يحتوي مكون Items هذا على quantity prop افتراضية تعيين إلى عدد صحيح 0 . تجاوز الدعامة الافتراضية بتمرير قيمة 10 quantity . ملاحظة: تذكر أن بناء الجملة لإضافة دعامة إلى أحد المكونات يشبه الطريقة التي تضيف بها سمات HTML. ومع ذلك ، نظرًا لأن القيمة quantity هي عدد صحيح ، فلن يتم نقلها بين علامتي اقتباس ولكن يجب أن تكون ملفوفة في أقواس معقوفة. على سبيل المثال ، {100} . يخبر هذا التركيب JSX بتفسير القيمة داخل الأقواس مباشرة مثل JavaScript.
    + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(ShoppingCart)); return mockedComponent.find("ShoppingCart").length === 1; })(), "The component ShoppingCart should render.");' + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(ShoppingCart)); return mockedComponent.find("Items").length === 1; })(), "The component Items should render.");' + - text: '' + testString: 'getUserInput => assert((function() { const mockedComponent = Enzyme.mount(React.createElement(ShoppingCart)); return mockedComponent.find("Items").props().quantity == 10 && getUserInput("index").replace(/ /g,"").includes(""); })(), "The Items component should have a prop of { quantity: 10 } passed from the ShoppingCart component.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +const Items = (props) => { + return

    Current Quantity of Items in Cart: {props.quantity}

    +} + +Items.defaultProps = { + quantity: 0 +} + +class ShoppingCart extends React.Component { + constructor(props) { + super(props); + } + render() { + { /* change code below this line */ } + return + { /* change code above this line */ } + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/pass-a-callback-as-props.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/pass-a-callback-as-props.arabic.md new file mode 100644 index 0000000000..b3304228e8 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/pass-a-callback-as-props.arabic.md @@ -0,0 +1,118 @@ +--- +id: 5a24c314108439a4d403617b +title: Pass a Callback as Props +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: '' +--- + +## Description +
    يمكنك تمرير state كدعائم إلى مكونات state ، ولكنك لا تقتصر على تمرير البيانات. يمكنك أيضًا تمرير وظائف معالج أو أي طريقة يتم تعريفها في مكون React إلى مكون فرعي. هذه هي الطريقة التي تسمح للمكونات الفرعية بالتفاعل مع المكونات الأساسية الخاصة بها. تمر الطرق لطفل مثل الدعامة العادية. يتم تعيين اسم له ولديك إمكانية الوصول إلى اسم هذا الأسلوب ضمن this.props في المكون التابع.
    + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: يجب أن يتم عرض مكون MyApp . + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(MyApp)); return mockedComponent.find("MyApp").length === 1; })(), "The MyApp component should render.");' + - text: يجب أن يتم تقديم المكون GetInput . + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(MyApp)); return mockedComponent.find("GetInput").length === 1; })(), "The GetInput component should render.");' + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(MyApp)); return mockedComponent.find("RenderInput").length === 1; })(), "The RenderInput component should render.");' + - text: يجب أن يتلقى المكون GetInput خاصية حالة حالة MyApp inputValue ويحتوي على عنصر input بتعديل حالة MyApp . + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(MyApp)); const state_1 = () => { mockedComponent.setState({inputValue: ""}); return waitForIt(() => mockedComponent.state() )}; const state_2 = () => { mockedComponent.find("input").simulate("change", {target: {value: "TestInput"}}); return waitForIt(() => mockedComponent.state() )}; const updated_1 = await state_1(); const updated_2 = await state_2(); assert(updated_1.inputValue === "" && updated_2.inputValue === "TestInput", "The GetInput component should receive the MyApp state property inputValue as props and contain an input element which modifies MyApp state."); }; ' + - text: و RenderInput ينبغي أن يتلقى المكون MyApp ممتلكات الدولة inputValue كما الدعائم. + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(MyApp)); const state_1 = () => { mockedComponent.setState({inputValue: "TestName"}); return waitForIt(() => mockedComponent )}; const updated_1 = await state_1(); assert(updated_1.find("p").text().includes("TestName"), "The RenderInput component should receive the MyApp state property inputValue as props."); }; ' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +class MyApp extends React.Component { + constructor(props) { + super(props); + this.state = { + inputValue: " + } + this.handleChange = this.handleChange.bind(this); + } + handleChange(event) { + this.setState({ + inputValue: event.target.value + }); + } + render() { + return ( +
    + { /* change code below this line */ } + + { /* change code above this line */ } +
    + ); + } +}; + +class GetInput extends React.Component { + constructor(props) { + super(props); + } + render() { + return ( +
    +

    Get Input:

    + +
    + ); + } +}; + +class RenderInput extends React.Component { + constructor(props) { + super(props); + } + render() { + return ( +
    +

    Input Render:

    +

    {this.props.input}

    +
    + ); + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/pass-an-array-as-props.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/pass-an-array-as-props.arabic.md new file mode 100644 index 0000000000..c2c2f44530 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/pass-an-array-as-props.arabic.md @@ -0,0 +1,93 @@ +--- +id: 5a24c314108439a4d403616a +title: Pass an Array as Props +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: '' +--- + +## Description +
    أظهر التحدي الأخير كيفية تمرير المعلومات من مكون رئيسي إلى مكون props أو خصائص. هذا التحدي يبحث في كيف يمكن تمرير الصفائف props . لتمرير مصفوفة إلى عنصر JSX ، يجب التعامل معها على هيئة JavaScript وملفوفة في أقواس معقوفة.
    <ParentComponent>
    <ChildComponent colors = {["green"، "blue"، "red"]} />
    </ ParentComponent>
    المكون الفرعي ثم الوصول إلى colors خاصية الصفيف. يمكن استخدام أساليب المصفوفة مثل join() عند الوصول إلى الخاصية. const ChildComponent = (props) => <p>{props.colors.join(', ')}</p> سينضم هذا إلى كل عناصر صفيف colors في سلسلة مفصولة بفواصل وينتج: <p>green, blue, red</p> لاحقًا ، سنتعرف على الطرق الشائعة الأخرى لتقديم صفائف البيانات في React.
    + +## Instructions +
    هناك List ومكونات ToDo في محرر التعليمات البرمجية. عند تقديم كل List من المكون ToDo ، قم بتمرير خاصية tasks معينة إلى صفيف مهام المهام ، على سبيل المثال ["walk dog", "workout"] . ثم قم بالوصول إلى مصفوفة tasks هذه في مكون List ، مع إظهار قيمته داخل العنصر p . استخدم join(", ") لعرض مصفوفة props.tasks في عنصر p كقائمة مفصولة بفواصل. يجب أن تحتوي قائمة اليوم على مهمتين على الأقل ويجب أن تشتمل مهام الغد على 3 مهام على الأقل.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يقوم مكون ToDo بإرجاع div خارجي واحد. + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(ToDo)); return mockedComponent.children().first().type() === "div"; })(), "The ToDo component should return a single outer div.");' + - text: يجب أن يكون الطفل الثالث لمكون ToDo نسخة من مكون List . + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(ToDo)); return mockedComponent.children().first().childAt(2).name() === "List"; })(), "The third child of the ToDo component should be an instance of the List component.");' + - text: يجب أن يكون الطفل الخامس من المكون ToDo نسخة من مكون List . + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(ToDo)); return mockedComponent.children().first().childAt(4).name() === "List"; })(), "The fifth child of the ToDo component should be an instance of the List component.");' + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(ToDo)); return Array.isArray(mockedComponent.find("List").get(0).props.tasks) && Array.isArray(mockedComponent.find("List").get(1).props.tasks); })(), "Both instances of the List component should have a property called tasks and tasks should be of type array.");' + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(ToDo)); return mockedComponent.find("List").get(0).props.tasks.length >= 2; })(), "The first List component representing the tasks for today should have 2 or more items.");' + - text: يجب أن يشتمل عنصر List الثاني الذي يمثل مهام الغد على 3 عناصر أو أكثر. + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(ToDo)); return mockedComponent.find("List").get(1).props.tasks.length >= 3; })(), "The second List component representing the tasks for tomorrow should have 3 or more items.");' + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(ToDo)); return mockedComponent.find("p").get(0).props.children === mockedComponent.find("List").get(0).props.tasks.join(", ") && mockedComponent.find("p").get(1).props.children === mockedComponent.find("List").get(1).props.tasks.join(", "); })(), "The List component should render the value from the tasks prop in the p tag as a comma separated list, for example walk dog, workout.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +const List= (props) => { + { /* change code below this line */ } + return

    {}

    + { /* change code above this line */ } +}; + +class ToDo extends React.Component { + constructor(props) { + super(props); + } + render() { + return ( +
    +

    To Do Lists

    +

    Today

    + { /* change code below this line */ } + +

    Tomorrow

    + + { /* change code above this line */ } +
    + ); + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/pass-props-to-a-stateless-functional-component.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/pass-props-to-a-stateless-functional-component.arabic.md new file mode 100644 index 0000000000..1c0264590d --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/pass-props-to-a-stateless-functional-component.arabic.md @@ -0,0 +1,90 @@ +--- +id: 5a24c314108439a4d4036169 +title: Pass Props to a Stateless Functional Component +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +
    هناك مكونات Calendar و CurrentDate في محرر التعليمات البرمجية. عند تقديم CurrentDate من مكون Calendar ، قم بتمرير خاصية date المعينة للتاريخ الحالي من كائن Date JavaScript. ثم قم بالوصول إلى هذا prop في مكون CurrentDate ، مع إظهار قيمته داخل علامات p . تجدر الإشارة إلى أنه بالنسبة إلى قيم prop أن يتم تقييمها على هيئة JavaScript ، يجب تضمينها في أقواس متعرجة ، على سبيل المثال date={Date()} .
    + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(Calendar)); return mockedComponent.children().type() === "div"; })(), "The Calendar component should return a single div element.");' + - text: يجب أن يكون الطفل الثاني لمكون Calendar مكون CurrentDate . + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(Calendar)); return mockedComponent.children().childAt(1).name() === "CurrentDate"; })(), "The second child of the Calendar component should be the CurrentDate component.");' + - text: يجب أن يكون لمكون CurrentDate دعامة date . + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(Calendar)); return mockedComponent.children().childAt(1).props().date })(), "The CurrentDate component should have a prop called date.");' + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(Calendar)); const prop = mockedComponent.children().childAt(1).props().date; return( typeof prop === "string" && prop.length > 0 ); })(), "The date prop of the CurrentDate should contain a string of text.");' + - text: يجب أن يقوم مكون CurrentDate القيمة من date prop في علامة p . + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(Calendar)); return mockedComponent.find("p").html().includes(Date().substr(3)); })(), "The CurrentDate component should render the value from the date prop in the p tag.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +const CurrentDate = (props) => { + return ( +
    + { /* change code below this line */ } +

    The current date is:

    + { /* change code above this line */ } +
    + ); +}; + +class Calendar extends React.Component { + constructor(props) { + super(props); + } + render() { + return ( +
    +

    What date is it?

    + { /* change code below this line */ } + + { /* change code above this line */ } +
    + ); + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/pass-state-as-props-to-child-components.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/pass-state-as-props-to-child-components.arabic.md new file mode 100644 index 0000000000..b1dafef0c5 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/pass-state-as-props-to-child-components.arabic.md @@ -0,0 +1,89 @@ +--- +id: 5a24c314108439a4d403617a +title: Pass State as Props to Child Components +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: '' +--- + +## Description +
    رأيت الكثير من الأمثلة التي مرت الدعائم لعناصر JSX الأطفال والمكونات React الأطفال في التحديات السابقة. قد تتساءل من أين تأتي تلك الدعائم. النمط الشائع هو أن يكون لديك مكونًا حاويًا يحتوي على state المهمة لتطبيقك ، والذي يجعل مكونات الطفل ثم. تريد هذه المكونات للوصول إلى بعض القطع من تلك state ، والتي يتم تمريرها في الدعائم. على سبيل المثال ، ربما يكون لديك مكون App يعرض شريط Navbar ، ضمن المكونات الأخرى. في App ، لديك state تحتوي على الكثير من معلومات المستخدم ، ولكن يحتاج شريط Navbar إلى الوصول إلى اسم المستخدم الخاص بالمستخدم فقط حتى يمكنه عرضه. يمكنك تمرير هذه state إلى مكون Navbar كدعم. يوضح هذا النمط بعض النماذج المهمة في React. الأول هو تدفق البيانات أحادي الاتجاه . تدفقات الحالة في اتجاه واحد أسفل شجرة مكونات التطبيق الخاص بك ، من المكون الرئيسي الحزينة إلى المكونات التابعة. المكونات التابعة فقط تتلقى بيانات الحالة التي يحتاجونها. والثاني هو أن التطبيقات الرسمية المعقدة يمكن تقسيمها إلى عدد قليل فقط ، أو ربما مكون واحد مؤكد. بقية المكونات الخاصة بك ببساطة تتلقى حالة من الوالد كما الدعائم ، وجعل واجهة المستخدم من تلك الحالة. ويبدأ في إنشاء فصل حيث يتم التعامل مع إدارة الولاية في جزء واحد من التعليمات البرمجية و UI تقديم في آخر. هذا المبدأ لفصل منطق الدولة من منطق واجهة المستخدم هو أحد المبادئ الرئيسية لـ React. عندما يتم استخدامه بشكل صحيح ، فإنه يجعل تصميم التطبيقات المعقدة والحافلة سهلة الإدارة.
    + +## Instructions +
    مكون MyApp هو stateful ويعرض مكون Navbar كطفل. تمرير name الملكية في في state وصولا الى عنصر الطفل، ثم تظهر name في h1 العلامة التي جزء من Navbar تقديم الأسلوب.
    + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(MyApp)); return mockedComponent.find("MyApp").length === 1 && mockedComponent.find("Navbar").length === 1; })(), "The MyApp component should render with a Navbar component inside.");' + - text: '' + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(MyApp)); const setState = () => { mockedComponent.setState({name: "TestName"}); return waitForIt(() => mockedComponent.find("Navbar").props() )}; const navProps = await setState(); assert(navProps.name === "TestName", "The Navbar component should receive the MyApp state property name as props."); }; ' + - text: '' + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(MyApp)); const navH1Before = mockedComponent.find("Navbar").find("h1").text(); const setState = () => { mockedComponent.setState({name: "TestName"}); return waitForIt(() => mockedComponent.find("Navbar").find("h1").text() )}; const navH1After = await setState(); assert(new RegExp("TestName").test(navH1After) && navH1After !== navH1Before, "The h1 element in Navbar should render the name prop."); }; ' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +class MyApp extends React.Component { + constructor(props) { + super(props); + this.state = { + name: 'CamperBot' + } + } + render() { + return ( +
    + +
    + ); + } +}; + +class Navbar extends React.Component { + constructor(props) { + super(props); + } + render() { + return ( +
    +

    Hello, my name is: /* your code here */

    +
    + ); + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/render-a-class-component-to-the-dom.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/render-a-class-component-to-the-dom.arabic.md new file mode 100644 index 0000000000..d1f1f4625e --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/render-a-class-component-to-the-dom.arabic.md @@ -0,0 +1,113 @@ +--- +id: 5a24c314108439a4d4036167 +title: Render a Class Component to the DOM +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +
    يتم تعريف كل من مكونات Fruits Vegetables لك وراء الكواليس. تقديم كل من المكونات كأطفال من المكون TypesOfFood ، ثم تقديم TypesOfFood إلى DOM. يوجد div به id='challenge-node' متاح للاستخدام.
    + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(TypesOfFood)); return mockedComponent.children().type() === "div"; })(), "The TypesOfFood component should return a single div element.");' + - text: يجب أن يقوم المكون TypesOfFood مكون Fruits بعد عنصر h1 . + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(TypesOfFood)); return mockedComponent.children().childAt(1).name() === "Fruits"; })(), "The TypesOfFood component should render the Fruits component after the h1 element.");' + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(TypesOfFood)); return mockedComponent.children().childAt(2).name() === "Vegetables"; })(), "The TypesOfFood component should render the Vegetables component after Fruits.");' + - text: يجب أن يتم عرض المكون TypesOfFood إلى DOM داخل div مع challenge-node الهوية. + testString: 'assert((function() { const html = document.getElementById("challenge-node").childNodes[0].innerHTML; return (html === "

    Types of Food:

    Fruits:

    Non-Citrus:

    • Apples
    • Blueberries
    • Strawberries
    • Bananas

    Citrus:

    • Lemon
    • Lime
    • Orange
    • Grapefruit

    Vegetables:

    • Brussel Sprouts
    • Broccoli
    • Squash
    "); })(), "The TypesOfFood component should render to the DOM within the div with the id challenge-node.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +class TypesOfFood extends React.Component { + constructor(props) { + super(props); + } + render() { + return ( +
    +

    Types of Food:

    + {/* change code below this line */} + + {/* change code above this line */} +
    + ); + } +}; + +// change code below this line + +``` + +
    + +### Before Test +
    + +```jsx +const Fruits = () => { + return ( +
    +

    Fruits:

    +

    Non-Citrus:

    +
      +
    • Apples
    • +
    • Blueberries
    • +
    • Strawberries
    • +
    • Bananas
    • +
    +

    Citrus:

    +
      +
    • Lemon
    • +
    • Lime
    • +
    • Orange
    • +
    • Grapefruit
    • +
    +
    + ); +}; +const Vegetables = () => { + return ( +
    +

    Vegetables:

    +
      +
    • Brussel Sprouts
    • +
    • Broccoli
    • +
    • Squash
    • +
    +
    + ); +}; + +``` + +
    + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/render-conditionally-from-props.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/render-conditionally-from-props.arabic.md new file mode 100644 index 0000000000..8b654ba1fd --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/render-conditionally-from-props.arabic.md @@ -0,0 +1,110 @@ +--- +id: 5a24c314108439a4d4036188 +title: Render Conditionally from Props +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: تجعل مشروط من الدعائم +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: يجب أن يتواجد مكون GameOfChance وأن يتم GameOfChance إلى الصفحة. + testString: 'assert.strictEqual(Enzyme.mount(React.createElement(GameOfChance)).find("GameOfChance").length, 1, "The GameOfChance component should exist and render to the page.");' + - text: يجب أن تقوم GameOfChance بإرجاع عنصر button واحد. + testString: 'assert.strictEqual(Enzyme.mount(React.createElement(GameOfChance)).find("button").length, 1, "GameOfChance should return a single button element.");' + - text: يجب أن تقوم GameOfChance بإرجاع نسخة واحدة من مكون Results ، الذي يحتوي على سند باسم fiftyFifty . + testString: 'assert(Enzyme.mount(React.createElement(GameOfChance)).find("Results").length === 1 && Enzyme.mount(React.createElement(GameOfChance)).find("Results").props().hasOwnProperty("fiftyFifty") === true, "GameOfChance should return a single instance of the Results component, which has a prop called fiftyFifty.");' + - text: يجب تهيئة حالة GameOfChance مع خاصية counter لتعيين قيمة 1 . + testString: 'assert.strictEqual(Enzyme.mount(React.createElement(GameOfChance)).state().counter, 1, "GameOfChance state should be initialized with a property of counter set to a value of 1.");' + - text: 'عندما يتم تقديم مكون GameOfChance أولاً إلى DOM ، يجب إرجاع عنصر p مع النص الداخلي لـ Turn: 1 .' + testString: 'assert.strictEqual(Enzyme.mount(React.createElement(GameOfChance)).find("p").text(), "Turn: 1", "When the GameOfChance component is first rendered to the DOM, a p element should be returned with the inner text of Turn: 1.");' + - text: 'في كل مرة يتم النقر فوق الزر ، يجب زيادة حالة العداد بقيمة 1 ، ويجب تقديم عنصر p واحد إلى DOM الذي يحتوي على النص "Turn: N" ، حيث N هي قيمة حالة العداد.' + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const comp = Enzyme.mount(React.createElement(GameOfChance)); const simulate = () => { comp.find("button").simulate("click"); };const result = () => ({ count: comp.state("counter"), text: comp.find("p").text() });const _1 = () => { simulate(); return waitForIt(() => result())}; const _2 = () => { simulate(); return waitForIt(() => result())}; const _3 = () => { simulate(); return waitForIt(() => result())}; const _4 = () => { simulate(); return waitForIt(() => result())}; const _5 = () => { simulate(); return waitForIt(() => result())}; const _1_val = await _1(); const _2_val = await _2(); const _3_val = await _3(); const _4_val = await _4(); const _5_val = await _5(); assert(_1_val.count === 2 && _1_val.text === "Turn: 2" && _2_val.count === 3 && _2_val.text === "Turn: 3" && _3_val.count === 4 && _3_val.text === "Turn: 4" && _4_val.count === 5 && _4_val.text === "Turn: 5" && _5_val.count === 6 && _5_val.text === "Turn: 6", "Each time the button is clicked, the counter state should be incremented by a value of 1, and a single p element should be rendered to the DOM that contains the text "Turn: N", where N is the value of the counter state."); }; ' + - text: عندما يتم أولاً تثبيت المكون GameOfChance إلى DOM و في كل مرة يتم النقر فوق الزر بعد ذلك ، يجب إرجاع عنصر h1 مفرد يعرض عشوائياً إما You Win! أو You Lose! . + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const comp = Enzyme.mount(React.createElement(GameOfChance)); const simulate = () => { comp.find("button").simulate("click"); };const result = () => ({ h1: comp.find("h1").length, text: comp.find("h1").text() });const _1 = result(); const _2 = () => { simulate(); return waitForIt(() => result())}; const _3 = () => { simulate(); return waitForIt(() => result())}; const _4 = () => { simulate(); return waitForIt(() => result())}; const _5 = () => { simulate(); return waitForIt(() => result())}; const _6 = () => { simulate(); return waitForIt(() => result())}; const _7 = () => { simulate(); return waitForIt(() => result())}; const _8 = () => { simulate(); return waitForIt(() => result())}; const _9 = () => { simulate(); return waitForIt(() => result())}; const _10 = () => { simulate(); return waitForIt(() => result())}; const _2_val = await _2(); const _3_val = await _3(); const _4_val = await _4(); const _5_val = await _5(); const _6_val = await _6(); const _7_val = await _7(); const _8_val = await _8(); const _9_val = await _9(); const _10_val = await _10(); const __text = new Set([_1.text, _2_val.text, _3_val.text, _4_val.text, _5_val.text, _6_val.text, _7_val.text, _8_val.text, _9_val.text, _10_val.text]); const __h1 = new Set([_1.h1, _2_val.h1, _3_val.h1, _4_val.h1, _5_val.h1, _6_val.h1, _7_val.h1, _8_val.h1, _9_val.h1, _10_val.h1]); assert(__text.size === 2 && __h1.size === 1, "When the GameOfChance component is first mounted to the DOM and each time the button is clicked thereafter, a single h1 element should be returned that randomly renders either You Win! or You Lose!."); }; ' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +class Results extends React.Component { + constructor(props) { + super(props); + } + render() { + return ( +

    + { + /* change code here */ + } +

    + ) + }; +}; + +class GameOfChance extends React.Component { + constructor(props) { + super(props); + this.state = { + counter: 1 + } + this.handleClick = this.handleClick.bind(this); + } + handleClick() { + this.setState({ + counter: 0 // change code here + }); + } + render() { + let expression = null; // change code here + return ( +
    + + { /* change code below this line */ } + + { /* change code above this line */ } +

    {'Turn: ' + this.state.counter}

    +
    + ); + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/render-html-elements-to-the-dom.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/render-html-elements-to-the-dom.arabic.md new file mode 100644 index 0000000000..ee68cf7a17 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/render-html-elements-to-the-dom.arabic.md @@ -0,0 +1,62 @@ +--- +id: 5a24bbe0dba28a8d3cbd4c5f +title: Render HTML Elements to the DOM +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: تقديم عناصر HTML إلى DOM +--- + +## Description +
    حتى الآن ، تعلمت أن JSX هي أداة ملائمة لكتابة HTML قابل للقراءة في JavaScript. باستخدام React ، يمكننا تقديم JSX مباشرةً إلى HTML DOM باستخدام واجهة برمجة تطبيقات React التي تُعرف باسم ReactDOM. يقدم ReactDOM طريقة بسيطة لعرض عناصر ReactDOM.render(componentToRender, targetNode) DOM التي تبدو كما يلي: ReactDOM.render(componentToRender, targetNode) ، حيث تكون الوسيطة الأولى هي عنصر React أو المكون الذي تريد ReactDOM.render(componentToRender, targetNode) الثانية هي عقدة DOM التي تريد تقديم المكون إليها. كما هو متوقع ، يجب استدعاء ReactDOM.render() بعد تعريفات عناصر JSX ، تمامًا كما يجب أن تقوم بتعريف المتغيرات قبل استخدامها.
    + +## Instructions +
    يحتوي محرر التعليمة البرمجية على مكون JSX بسيط. استخدم الأسلوب ReactDOM.render() لتقديم هذا المكون إلى الصفحة. يمكنك تمرير عناصر JSX المحددة مباشرة كوسيطة أولى واستخدام document.getElementById() لتحديد عقدة DOM لتقديمها. يوجد div به id='challenge-node' متاح للاستخدام. تأكد من عدم تغيير ثابت JSX .
    + +## Tests +
    + +```yml +tests: + - text: يجب على JSX المستمر إرجاع عنصر div . + testString: 'assert(JSX.type === "div", "The constant JSX should return a div element.");' + - text: يجب أن يحتوي div على علامة h1 باعتبارها العنصر الأول. + testString: 'assert(JSX.props.children[0].type === "h1", "The div should contain an h1 tag as the first element.");' + - text: يجب أن يحتوي div على علامة p كعنصر ثانٍ. + testString: 'assert(JSX.props.children[1].type === "p", "The div should contain a p tag as the second element.");' + - text: يجب أن يتم تقديم عنصر JSX المقدم إلى عقدة DOM مع عقدة challenge-node الهوية. + testString: 'assert(document.getElementById("challenge-node").childNodes[0].innerHTML === "

    Hello World

    Lets render this to the DOM

    ", "The provided JSX element should render to the DOM node with id challenge-node.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +const JSX = ( +
    +

    Hello World

    +

    Lets render this to the DOM

    +
    +); +// change code below this line + +``` + +
    + + + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/render-react-on-the-server-with-rendertostring.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/render-react-on-the-server-with-rendertostring.arabic.md new file mode 100644 index 0000000000..2d7c83fbe4 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/render-react-on-the-server-with-rendertostring.arabic.md @@ -0,0 +1,76 @@ +--- +id: 5a24c314108439a4d403618d +title: Render React on the Server with renderToString +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: تجعل رد فعل على الخادم مع renderToString +--- + +## Description +
    حتى الآن ، لقد تم تقديم مكونات React على العميل. عادة ، هذا ما ستفعله دائمًا. ومع ذلك ، هناك بعض حالات الاستخدام حيث يكون من المنطقي تقديم مكون React على الخادم. نظرًا لأن React عبارة عن مكتبة عرض جافا سكريبت ، ويمكنك تشغيل جافا سكريبت على الخادم باستخدام عقدة ، فهذا ممكن. في الواقع ، يوفر renderToString() طريقة renderToString() التي يمكنك استخدامها لهذا الغرض. هناك سببان رئيسيان لماذا يمكن استخدام التقديم على الخادم في تطبيق عالمي حقيقي. أولاً ، بدون إجراء ذلك ، ستتألف تطبيقات React من ملف HTML فارغ نسبيًا ومجموعة كبيرة من جافا سكريبت عندما يتم تحميله في البداية على المتصفح. قد لا يكون ذلك مثاليًا لمحركات البحث التي تحاول فهرسة محتوى صفحاتك حتى يتمكن الأشخاص من العثور عليك. إذا عرضت ترميز HTML الأولي على الخادم وأرسلته إلى العميل ، فسيحتوي تحميل الصفحة الأولي على كل ترميز الصفحة الذي يمكن الزحف إليه بواسطة محركات البحث. ثانيًا ، يؤدي هذا إلى إنشاء تجربة تحميل أولية أسرع للصفحات ؛ نظرًا لأن شفرة HTML المقدمة أصغر من شفرة جافا سكريبت للتطبيق بالكامل. سيظل رد الفعل قادرًا على التعرف على تطبيقك وإدارته بعد التحميل الأولي.
    + +## Instructions +
    يتم توفير الأسلوب renderToString() على ReactDOMServer ، والذي يتوفر هنا ككائن عام. تأخذ الطريقة وسيطة واحدة وهي عنصر React. استخدم هذا لتقديم App إلى سلسلة.
    + +## Tests +
    + +```yml +tests: + - text: يجب تقديم مكون App إلى سلسلة باستخدام ReactDOMServer.renderToString . + testString: 'getUserInput => assert(getUserInput("index").replace(/ /g,"").includes("ReactDOMServer.renderToString()") && Enzyme.mount(React.createElement(App)).children().name() === "div", "The App component should render to a string using ReactDOMServer.renderToString.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +class App extends React.Component { + constructor(props) { + super(props); + } + render() { + return
    + } +}; + +// change code below this line + +``` + +
    + +### Before Test +
    + +```jsx +var ReactDOMServer = { renderToString(x) { return null; } }; + +``` + +
    + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/render-state-in-the-user-interface-another-way.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/render-state-in-the-user-interface-another-way.arabic.md new file mode 100644 index 0000000000..61d85f1d87 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/render-state-in-the-user-interface-another-way.arabic.md @@ -0,0 +1,83 @@ +--- +id: 5a24c314108439a4d4036172 +title: Render State in the User Interface Another Way +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: تقديم الدولة في واجهة المستخدم بطريقة أخرى +--- + +## Description +
    هناك طريقة أخرى للوصول إلى state في أحد المكونات. في الطريقة render() ، قبل عبارة return ، يمكنك كتابة JavaScript مباشرة. على سبيل المثال ، يمكنك الإعلان عن الدوال ، أو الوصول إلى البيانات من state أو props ، أو إجراء عمليات حسابية على هذه البيانات ، وما إلى ذلك. بعد ذلك ، يمكنك تعيين أي بيانات للمتغيرات ، والتي يمكنك الوصول إليها في بيان return .
    + +## Instructions +
    في MyComponent تقديم طريقة، تحديد const يسمى name وأضرموا فيه يساوي قيمة اسم في المكون state . نظرًا لأنه يمكنك كتابة JavaScript مباشرة في هذا الجزء من الشفرة ، لن تضطر إلى تضمين هذا المرجع في أقواس معقوفة. بعد ذلك ، في بيان الإرجاع ، قم بعرض هذه القيمة في علامة h1 باستخدام name المتغير. تذكر أنك تحتاج إلى استخدام بنية JSX (أقواس معقوفة لجافا سكريبت) في بيان الإرجاع.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يكون لدى MyComponent name مفتاح مع القيمة freeCodeCamp المخزنة في حالتها. + testString: 'assert(Enzyme.mount(React.createElement(MyComponent)).state("name") === "freeCodeCamp", "MyComponent should have a key name with value freeCodeCamp stored in its state.");' + - text: يجب أن يقوم MyComponent بعرض رأس h1 مغلق في div مفرد. + testString: 'assert(/

    .*<\/h1><\/div>/.test(Enzyme.mount(React.createElement(MyComponent)).html()), "MyComponent should render an h1 header enclosed in a single div.");' + - text: 'يجب أن تتضمن العلامة h1 المقدمة إشارة إلى {name} .' + testString: 'getUserInput => assert(/

    \n*\s*\{\s*name\s*\}\s*\n*<\/h1>/.test(getUserInput("index")), "The rendered h1 tag should include a reference to {name}.");' + - text: يجب أن يحتوي رأس h1 المقدمة على نص تم تقديمه من حالة المكوِّن. + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(MyComponent)); const first = () => { mockedComponent.setState({ name: "TestName" }); return waitForIt(() => mockedComponent.html()) }; const firstValue = await first(); assert(firstValue === "

    TestName

    ", "The rendered h1 header should contain text rendered from the component's state."); };' + +``` + +

    + +## Challenge Seed +
    + +
    + +```jsx +class MyComponent extends React.Component { + constructor(props) { + super(props); + this.state = { + name: 'freeCodeCamp' + } + } + render() { + // change code below this line + + // change code above this line + return ( +
    + { /* change code below this line */ } + + { /* change code above this line */ } +
    + ); + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/render-state-in-the-user-interface.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/render-state-in-the-user-interface.arabic.md new file mode 100644 index 0000000000..756caf923c --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/render-state-in-the-user-interface.arabic.md @@ -0,0 +1,78 @@ +--- +id: 5a24c314108439a4d4036171 +title: Render State in the User Interface +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: تقديم الدولة في واجهة المستخدم +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(Enzyme.mount(React.createElement(MyComponent)).state("name") === "freeCodeCamp", "MyComponent should have a key name with value freeCodeCamp stored in its state.");' + - text: '' + testString: 'assert(/

    .*<\/h1><\/div>/.test(Enzyme.mount(React.createElement(MyComponent)).html()), "MyComponent should render an h1 header enclosed in a single div.");' + - text: '' + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(MyComponent)); const first = () => { mockedComponent.setState({ name: "TestName" }); return waitForIt(() => mockedComponent.html()) }; const firstValue = await first(); assert(firstValue === "

    TestName

    ", "The rendered h1 header should contain text rendered from the component's state.");};' + +``` + +

    + +## Challenge Seed +
    + +
    + +```jsx +class MyComponent extends React.Component { + constructor(props) { + super(props); + this.state = { + name: 'freeCodeCamp' + } + } + render() { + return ( +
    + { /* change code below this line */ } + + { /* change code above this line */ } +
    + ); + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/render-with-an-if-else-condition.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/render-with-an-if-else-condition.arabic.md new file mode 100644 index 0000000000..52b35e0e16 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/render-with-an-if-else-condition.arabic.md @@ -0,0 +1,87 @@ +--- +id: 5a24c314108439a4d4036184 +title: Render with an If-Else Condition +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +
    يحتوي MyComponent على boolean في حالته التي تقوم بتتبع ما إذا كنت تريد عرض بعض العناصر في واجهة المستخدم أم لا. يقوم button تبديل حالة هذه القيمة. حاليًا ، يتم عرض واجهة المستخدم نفسها في كل مرة. أعد كتابة طريقة render() مع عبارة if/else بحيث إذا كان display true ، فأعدت الترميز الحالي. وإلا ، فأعد الترميز بدون عنصر h1 . ملاحظة: يجب عليك كتابة if/else لتمرير الاختبارات. استخدام المشغل الثلاثي لن يمر هنا.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يوجد MyComponent وعرض. + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(MyComponent)); return mockedComponent.find("MyComponent").length === 1; })(), "MyComponent should exist and render.");' + - text: '' + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(MyComponent)); const state_1 = () => { mockedComponent.setState({display: true}); return waitForIt(() => mockedComponent )}; const updated = await state_1(); assert(mockedComponent.find("div").length === 1 && mockedComponent.find("div").children().length === 2 && mockedComponent.find("button").length === 1 && mockedComponent.find("h1").length === 1, "When display is set to true, a div, button, and h1 should render."); }; ' + - text: عند تعيين display على " false ، يجب أن يتم display فقط button div button . + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(MyComponent)); const state_1 = () => { mockedComponent.setState({display: false}); return waitForIt(() => mockedComponent )}; const updated = await state_1(); assert(mockedComponent.find("div").length === 1 && mockedComponent.find("div").children().length === 1 && mockedComponent.find("button").length === 1 && mockedComponent.find("h1").length === 0, "When display is set to false, only a div and button should render."); }; ' + - text: يجب أن تستخدم طريقة التجسيد عبارة if/else للتحقق من حالة this.state.display . + testString: 'getUserInput => assert(getUserInput("index").includes("if") && getUserInput("index").includes("else"), "The render method should use an if/else statement to check the condition of this.state.display.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +class MyComponent extends React.Component { + constructor(props) { + super(props); + this.state = { + display: true + } + this.toggleDisplay = this.toggleDisplay.bind(this); + } + toggleDisplay() { + this.setState({ + display: !this.state.display + }); + } + render() { + // change code below this line + + return ( +
    + +

    Displayed!

    +
    + ); + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/review-using-props-with-stateless-functional-components.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/review-using-props-with-stateless-functional-components.arabic.md new file mode 100644 index 0000000000..383609084e --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/review-using-props-with-stateless-functional-components.arabic.md @@ -0,0 +1,89 @@ +--- +id: 5a24c314108439a4d403616f +title: Review Using Props with Stateless Functional Components +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(CampSite)); return mockedComponent.find("CampSite").length === 1; })(), "The CampSite component should render.");' + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(CampSite)); return mockedComponent.find("Camper").length === 1; })(), "The Camper component should render.");' + - text: '' + testString: 'getUserInput => assert((function() { const noWhiteSpace = getUserInput("index").replace(/\s/g, ""); const verify1 = "Camper.defaultProps={name:\"CamperBot\"}"; const verify2 = "Camper.defaultProps={name:"CamperBot"}"; return (noWhiteSpace.includes(verify1) || noWhiteSpace.includes(verify2)); })(), "The Camper component should include default props which assign the string CamperBot to the key name.");' + - text: '' + testString: 'getUserInput => assert((function() { const mockedComponent = Enzyme.mount(React.createElement(CampSite)); const noWhiteSpace = getUserInput("index").replace(/\s/g, ""); const verifyDefaultProps = "Camper.propTypes={name:PropTypes.string.isRequired}"; return noWhiteSpace.includes(verifyDefaultProps); })(), "The Camper component should include prop types which require the name prop to be of type string.");' + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(CampSite)); return mockedComponent.find("p").text() === mockedComponent.find("Camper").props().name; })(), "The Camper component should contain a p element with only the text from the name prop.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +class CampSite extends React.Component { + constructor(props) { + super(props); + } + render() { + return ( +
    + +
    + ); + } +}; +// change code below this line + +``` + +
    + +### Before Test +
    + +```jsx +var PropTypes = { + string: { isRequired: true } +}; + +``` + +
    + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/set-state-with-this.setstate.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/set-state-with-this.setstate.arabic.md new file mode 100644 index 0000000000..334fe7cc20 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/set-state-with-this.setstate.arabic.md @@ -0,0 +1,85 @@ +--- +id: 5a24c314108439a4d4036173 +title: Set State with this.setState +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(Enzyme.mount(React.createElement(MyComponent)).state("name") === "Initial State", "The state of MyComponent should initialize with the key value pair { name: Initial State }.");' + - text: يجب أن يقوم MyComponent بعرض رأس h1 . + testString: 'assert(Enzyme.mount(React.createElement(MyComponent)).find("h1").length === 1, "MyComponent should render an h1 header.");' + - text: '' + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(MyComponent)); const first = () => { mockedComponent.setState({ name: "TestName" }); return waitForIt(() => mockedComponent.html()); }; const firstValue = await first(); assert(/

    TestName<\/h1>/.test(firstValue), "The rendered h1 header should contain text rendered from the component's state."); };' + - text: '' + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(MyComponent)); const first = () => { mockedComponent.setState({ name: "Before" }); return waitForIt(() => mockedComponent.state("name")); }; const second = () => { mockedComponent.instance().handleClick(); return waitForIt(() => mockedComponent.state("name")); }; const firstValue = await first(); const secondValue = await second(); assert(firstValue === "Before" && secondValue === "React Rocks!", "Calling the handleClick method on MyComponent should set the name property in state to equal React Rocks!."); };' + +``` + +

    + +## Challenge Seed +
    + +
    + +```jsx +class MyComponent extends React.Component { + constructor(props) { + super(props); + this.state = { + name: 'Initial State' + }; + this.handleClick = this.handleClick.bind(this); + } + handleClick() { + // change code below this line + + // change code above this line + } + render() { + return ( +
    + +

    {this.state.name}

    +
    + ); + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/use--for-a-more-concise-conditional.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/use--for-a-more-concise-conditional.arabic.md new file mode 100644 index 0000000000..3d88d0bc0d --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/use--for-a-more-concise-conditional.arabic.md @@ -0,0 +1,86 @@ +--- +id: 5a24c314108439a4d4036185 +title: Use && for a More Concise Conditional +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(MyComponent)); return mockedComponent.find("MyComponent").length; })(), "MyComponent should exist and render.");' + - text: '' + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(MyComponent)); const state_1 = () => { mockedComponent.setState({display: true}); return waitForIt(() => mockedComponent )}; const updated = await state_1(); assert(updated.find("div").length === 1 && updated.find("div").children().length === 2 && updated.find("button").length === 1 && updated.find("h1").length === 1, "When display is set to true, a div, button, and h1 should render."); }; ' + - text: '' + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(MyComponent)); const state_1 = () => { mockedComponent.setState({display: false}); return waitForIt(() => mockedComponent )}; const updated = await state_1(); assert(updated.find("div").length === 1 && updated.find("div").children().length === 1 && updated.find("button").length === 1 && updated.find("h1").length === 0, "When display is set to false, only a div and button should render."); }; ' + - text: '' + testString: 'getUserInput => assert(getUserInput("index").includes("&&"), "The render method should use the && logical operator to check the condition of this.state.display.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +class MyComponent extends React.Component { + constructor(props) { + super(props); + this.state = { + display: true + } + this.toggleDisplay = this.toggleDisplay.bind(this); + } + toggleDisplay() { + this.setState({ + display: !this.state.display + }); + } + render() { + // change code below this line + return ( +
    + +

    Displayed!

    +
    + ); + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/use-a-ternary-expression-for-conditional-rendering.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/use-a-ternary-expression-for-conditional-rendering.arabic.md new file mode 100644 index 0000000000..ac462d82c5 --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/use-a-ternary-expression-for-conditional-rendering.arabic.md @@ -0,0 +1,113 @@ +--- +id: 5a24c314108439a4d4036187 +title: Use a Ternary Expression for Conditional Rendering +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: '' +--- + +## Description +undefined + +## Instructions +undefined + +## Tests +
    + +```yml +tests: + - text: '' + testString: 'assert(Enzyme.mount(React.createElement(CheckUserAge)).find("div").find("input").length === 1 && Enzyme.mount(React.createElement(CheckUserAge)).find("div").find("button").length === 1, "The CheckUserAge component should render with a single input element and a single button element.");' + - text: يجب تهيئة حالة مكون CheckUserAge مع خاصية userAge و خاصية input ، كلاهما تم userAge على قيمة سلسلة فارغة. + testString: 'assert(Enzyme.mount(React.createElement(CheckUserAge)).state().input === "" && Enzyme.mount(React.createElement(CheckUserAge)).state().userAge === "", "The CheckUserAge component's state should be initialized with a property of userAge and a property of input, both set to a value of an empty string.");' + - text: '' + testString: 'assert(Enzyme.mount(React.createElement(CheckUserAge)).find("button").text() === "Submit", "When the CheckUserAge component is first rendered to the DOM, the button's inner text should be Submit.");' + - text: '' + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(CheckUserAge)); const initialButton = mockedComponent.find("button").text(); const enter3AndClickButton = () => { mockedComponent.find("input").simulate("change", {target: { value: "3" }}); mockedComponent.find("button").simulate("click"); return waitForIt(() => { mockedComponent.update(); return mockedComponent.find("button").text(); }); }; const enter17AndClickButton = () => { mockedComponent.find("input").simulate("change", {target: { value: "17" }}); mockedComponent.find("button").simulate("click"); return waitForIt(() => { mockedComponent.update(); return mockedComponent.find("button").text(); }); }; const userAge3 = await enter3AndClickButton(); const userAge17 = await enter17AndClickButton(); assert(initialButton === "Submit" && userAge3 === "You Shall Not Pass" && userAge17 === "You Shall Not Pass", "When a number of less than 18 is entered into the input element and the button is clicked, the button's inner text should read You Shall Not Pass."); }; ' + - text: '' + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(CheckUserAge)); const initialButton = mockedComponent.find("button").text(); const enter18AndClickButton = () => { mockedComponent.find("input").simulate("change", {target: { value: "18" }}); mockedComponent.find("button").simulate("click"); return waitForIt(() => { mockedComponent.update(); return mockedComponent.find("button").text(); }); }; const enter35AndClickButton = () => { mockedComponent.find("input").simulate("change", {target: { value: "35" }}); mockedComponent.find("button").simulate("click"); return waitForIt(() => { mockedComponent.update(); return mockedComponent.find("button").text(); }); }; const userAge18 = await enter18AndClickButton(); const userAge35 = await enter35AndClickButton(); assert(initialButton === "Submit" && userAge18 === "You May Enter" && userAge35 === "You May Enter", "When a number greater than or equal to 18 is entered into the input element and the button is clicked, the button's inner text should read You May Enter."); }; ' + - text: '' + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(CheckUserAge)); const enter18AndClickButton = () => { mockedComponent.find("input").simulate("change", {target: { value: "18" }}); mockedComponent.find("button").simulate("click"); return waitForIt(() => { mockedComponent.update(); return mockedComponent.find("button").text(); }); }; const changeInputDontClickButton = () => { mockedComponent.find("input").simulate("change", {target: { value: "5" }}); return waitForIt(() => { mockedComponent.update(); return mockedComponent.find("button").text(); }); }; const enter10AndClickButton = () => { mockedComponent.find("input").simulate("change", {target: { value: "10" }}); mockedComponent.find("button").simulate("click"); return waitForIt(() => { mockedComponent.update(); return mockedComponent.find("button").text(); }); }; const userAge18 = await enter18AndClickButton(); const changeInput1 = await changeInputDontClickButton(); const userAge10 = await enter10AndClickButton(); const changeInput2 = await changeInputDontClickButton(); assert(userAge18 === "You May Enter" && changeInput1 === "Submit" && userAge10 === "You Shall Not Pass" && changeInput2 === "Submit", "Once a number has been submitted, and the value of the input is once again changed, the button should return to reading Submit."); }; ' + - text: '' + testString: 'assert(new RegExp(/(\s|;)if(\s|\()/).test(Enzyme.mount(React.createElement(CheckUserAge)).instance().render.toString()) === false, "Your code should not contain any if/else statements.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +const inputStyle = { + width: 235, + margin: 5 +} + +class CheckUserAge extends React.Component { + constructor(props) { + super(props); + // change code below this line + + // change code above this line + this.submit = this.submit.bind(this); + this.handleChange = this.handleChange.bind(this); + } + handleChange(e) { + this.setState({ + input: e.target.value, + userAge: " + }); + } + submit() { + this.setState({ + userAge: this.state.input + }); + } + render() { + const buttonOne = ; + const buttonTwo = ; + const buttonThree = ; + return ( +
    +

    Enter Your Age to Continue

    +
    + { + /* change code here */ + } +
    + ); + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/use-advanced-javascript-in-react-render-method.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/use-advanced-javascript-in-react-render-method.arabic.md new file mode 100644 index 0000000000..1732becb2e --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/use-advanced-javascript-in-react-render-method.arabic.md @@ -0,0 +1,139 @@ +--- +id: 5a24c314108439a4d4036183 +title: Use Advanced JavaScript in React Render Method +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: '' +--- + +## Description +
    في التحديات السابقة ، تعلمت كيفية إدخال شفرة جافا سكريبت في شفرة JSX باستخدام أقواس معقوفة ، { } ، لمهام مثل الوصول إلى الدعائم ، تمرير الدعائم ، الوصول إلى الحالة ، إدراج التعليقات في شفرتك ، ومؤخرًا ، تصميم المكونات الخاصة بك. هذه كلها حالات استخدام شائعة لوضع JavaScript في JSX ، ولكنها ليست الطريقة الوحيدة التي يمكنك من خلالها استخدام شفرة JavaScript في مكونات React الخاصة بك. يمكنك أيضًا كتابة JavaScript مباشرة في طرق render ، قبل العبارة return ، دون إدخالها داخل الأقواس المتعرجة. هذا لأنه ليس بعد داخل كود JSX. عندما تريد استخدام متغير لاحقًا في شفرة JSX داخل بيان return ، فإنك تضع اسم المتغير داخل الأقواس المتعرجة.
    + +## Instructions +
    في رمز المقدمة، و render طريقة لديه مجموعة يحتوي على 20 عبارات لتمثيل الإجابات وجدت في كلاسيك 1980 ماجيك ثمانية لعبة الكرة. يرتبط حدث النقر بالزر بطريقة ask ، لذلك في كل مرة يتم النقر فوق الزر سيتم إنشاء رقم عشوائي وتخزينه كـ randomIndex في الحالة. في السطر 52 ، احذف السلسلة "change me!" وإعادة تعيين answer CONST ذلك التعليمات البرمجية يصل عشوائيا مؤشر مختلفة من possibleAnswers مجموعة في كل مرة التحديثات المكون. وأخيرا، أدخل answer CONST داخل p العلامات.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يكون مكون MagicEightBall موجودًا ويجب أن يتم MagicEightBall على الصفحة. + testString: 'assert.strictEqual(Enzyme.mount(React.createElement(MagicEightBall)).find("MagicEightBall").length, 1, "The MagicEightBall component should exist and should render to the page.");' + - text: يجب أن يكون الطفل الأول لـ MagicEightBall عنصر input . + testString: 'assert.strictEqual(Enzyme.mount(React.createElement(MagicEightBall)).children().childAt(0).name(), "input", "MagicEightBall's first child should be an input element.");' + - text: الطفل الثالث MagicEightBall يجب أن يكون عنصر button . + testString: 'assert.strictEqual(Enzyme.mount(React.createElement(MagicEightBall)).children().childAt(2).name(), "button", "MagicEightBall's third child should be a button element.");' + - text: MagicEightBall يجب تهيئة حالة الصورة مع خاصية userInput وخاصية randomIndex على حد سواء لتعيين قيمة سلسلة فارغة. + testString: 'assert(Enzyme.mount(React.createElement(MagicEightBall)).state("randomIndex") === "" && Enzyme.mount(React.createElement(MagicEightBall)).state("userInput") === "", "MagicEightBall's state should be initialized with a property of userInput and a property of randomIndex both set to a value of an empty string.");' + - text: عندما يتم تحميل MagicEightBall أولاً إلى DOM ، يجب أن يعرض عنصر p فارغًا. + testString: 'assert(Enzyme.mount(React.createElement(MagicEightBall)).find("p").length === 1 && Enzyme.mount(React.createElement(MagicEightBall)).find("p").text() === "", "When MagicEightBall is first mounted to the DOM, it should return an empty p element.");' + - text: عندما يتم إدخال النص في عنصر input ويتم النقر فوق الزر ، يجب أن يقوم مكون MagicEightBall بإرجاع عنصر p يحتوي على عنصر عشوائي من الصفيف possibleAnswers . + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const comp = Enzyme.mount(React.createElement(MagicEightBall)); const simulate = () => { comp.find("input").simulate("change", { target: { value: "test?" }}); comp.find("button").simulate("click"); }; const result = () => comp.find("p").text(); const _1 = () => { simulate(); return waitForIt(() => result()) }; const _2 = () => { simulate(); return waitForIt(() => result()) }; const _3 = () => { simulate(); return waitForIt(() => result()) }; const _4 = () => { simulate(); return waitForIt(() => result()) }; const _5 = () => { simulate(); return waitForIt(() => result()) }; const _6 = () => { simulate(); return waitForIt(() => result()) }; const _7 = () => { simulate(); return waitForIt(() => result()) }; const _8 = () => { simulate(); return waitForIt(() => result()) }; const _9 = () => { simulate(); return waitForIt(() => result()) }; const _10 = () => { simulate(); return waitForIt(() => result()) }; const _1_val = await _1(); const _2_val = await _2(); const _3_val = await _3(); const _4_val = await _4(); const _5_val = await _5(); const _6_val = await _6(); const _7_val = await _7(); const _8_val = await _8(); const _9_val = await _9(); const _10_val = await _10(); const actualAnswers = [_1_val, _2_val, _3_val, _4_val, _5_val, _6_val, _7_val, _8_val, _9_val, _10_val]; const hasIndex = actualAnswers.filter((answer, i) => possibleAnswers.indexOf(answer) !== -1); const notAllEqual = new Set(actualAnswers); assert(notAllEqual.size > 1 && hasIndex.length === 10, "When text is entered into the input element and the button is clicked, the MagicEightBall component should return a p element that contains a random element from the possibleAnswers array.");}' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +const inputStyle = { + width: 235, + margin: 5 +} + +class MagicEightBall extends React.Component { + constructor(props) { + super(props); + this.state = { + userInput: ", + randomIndex: " + } + this.ask = this.ask.bind(this); + this.handleChange = this.handleChange.bind(this); + } + ask() { + if (this.state.userInput) { + this.setState({ + randomIndex: Math.floor(Math.random() * 20), + userInput: " + }); + } + } + handleChange(event) { + this.setState({ + userInput: event.target.value + }); + } + render() { + const possibleAnswers = [ + 'It is certain', + 'It is decidedly so', + 'Without a doubt', + 'Yes, definitely', + 'You may rely on it', + 'As I see it, yes', + 'Outlook good', + 'Yes', + 'Signs point to yes', + 'Reply hazy try again', + 'Ask again later', + 'Better not tell you now', + 'Cannot predict now', + 'Concentrate and ask again', + 'Don\'t count on it', + 'My reply is no', + 'My sources say no', + 'Most likely', + 'Outlook not so good', + 'Very doubtful' + ]; + const answer = 'change me!' // << change code here + return ( +
    +
    +
    +

    Answer:

    +

    + { /* change code below this line */ } + + { /* change code above this line */ } +

    +
    + ); + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/use-array.filter-to-dynamically-filter-an-array.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/use-array.filter-to-dynamically-filter-an-array.arabic.md new file mode 100644 index 0000000000..eb39636a3c --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/use-array.filter-to-dynamically-filter-an-array.arabic.md @@ -0,0 +1,110 @@ +--- +id: 5a24c314108439a4d403618c +title: Use Array.filter() to Dynamically Filter an Array +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: استخدم Array.filter () Dynamically تصفية صفيف +--- + +## Description +
    تعد طريقة مصفوفة map أداة فعالة ستستخدمها كثيرًا عند التعامل مع React. هناك طريقة أخرى مرتبطة map هي filter ، والتي تقوم بتصفية محتويات مصفوفة بناءً على شرط ، ثم تقوم بإرجاع صفيف جديد. على سبيل المثال ، إذا كان لديك مجموعة من المستخدمين الذين يملكون جميعًا خاصية online والتي يمكن تعيينها على true أو false ، يمكنك تصفية المستخدمين فقط الذين يكونون متصلين let onlineUsers = users.filter(user => user.online); عن طريق الكتابة: let onlineUsers = users.filter(user => user.online); عبر الإنترنت let onlineUsers = users.filter(user => user.online);
    + +## Instructions +
    في محرر التعليمة البرمجية ، تتم تهيئة state MyComponent مع مجموعة من المستخدمين. بعض المستخدمين متصلين والبعض الآخر ليسوا كذلك. تصفية المصفوفة بحيث ترى فقط المستخدمين المتصلين. للقيام بذلك ، استخدم أولاً filter لإرجاع صفيف جديد يحتوي فقط على المستخدمين الذين تكون صحتهم online true . بعد ذلك ، في المتغير renderOnline ، قم renderOnline فوق الصفيف الذي تمت تصفيته ، وقم بإرجاع عنصر li لكل مستخدم يحتوي على نص username . تأكد من تضمين key فريد أيضًا ، كما هو الحال في آخر التحديات.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن توجد MyComponent وعرضها إلى الصفحة. + testString: 'assert.strictEqual(Enzyme.mount(React.createElement(MyComponent)).find("MyComponent").length, 1, "MyComponent should exist and render to the page.");' + - text: ينبغي تهيئة حالة MyComponent إلى صفيف من ستة مستخدمين. ") + testString: 'assert(Array.isArray(Enzyme.mount(React.createElement(MyComponent)).state("users")) === true && Enzyme.mount(React.createElement(MyComponent)).state("users").length === 6, "MyComponent's state should be initialized to an array of six users.");' + - text: يجب أن يقوم MyComponent بإرجاع div ، و h1 ، ثم قائمة غير مرتبة تحتوي على عناصر li لكل مستخدم تم تعيين حالة الاتصال الخاصة به إلى true . + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const comp = Enzyme.mount(React.createElement(MyComponent)); const users = (bool) => ({users:[ { username: "Jeff", online: bool }, { username: "Alan", online: bool }, { username: "Mary", online: bool }, { username: "Jim", online: bool }, { username: "Laura", online: bool } ]}); const result = () => comp.find("li").length; const _1 = result(); const _2 = () => { comp.setState(users(true)); return waitForIt(() => result()) }; const _3 = () => { comp.setState(users(false)); return waitForIt(() => result()) }; const _4 = () => { comp.setState({ users: [] }); return waitForIt(() => result()) }; const _2_val = await _2(); const _3_val = await _3(); const _4_val = await _4(); assert(comp.find("div").length === 1 && comp.find("h1").length === 1 && comp.find("ul").length === 1 && _1 === 4 && _2_val === 5 && _3_val === 0 && _4_val === 0, "MyComponent should return a div, an h1, and then an unordered list containing li elements for every user whose online status is set to true."); }; ' + - text: يجب أن تقدم MyComponent عناصر li التي تحتوي على اسم المستخدم لكل مستخدم عبر الإنترنت. + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const comp = Enzyme.mount(React.createElement(MyComponent)); const users = (bool) => ({users:[ { username: "Jeff", online: bool }, { username: "Alan", online: bool }, { username: "Mary", online: bool }, { username: "Jim", online: bool }, { username: "Laura", online: bool } ]}); const ul = () => { comp.setState(users(true)); return waitForIt(() => comp.find("ul").html()) }; const html = await ul(); assert(html === "
    • Jeff
    • Alan
    • Mary
    • Jim
    • Laura
    ", "MyComponent should render li elements that contain the username of each online user."); }; ' + - text: يجب أن يكون كل عنصر قائمة البند فريدة من نوعها key السمة. + testString: 'assert((() => { const ul = Enzyme.mount(React.createElement(MyComponent)).find("ul"); console.log(ul.debug()); const keys = new Set([ ul.childAt(0).key(), ul.childAt(1).key(), ul.childAt(2).key(), ul.childAt(3).key() ]); return keys.size === 4; })(), "Each list item element should have a unique key attribute.");' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +class MyComponent extends React.Component { + constructor(props) { + super(props); + this.state = { + users: [ + { + username: 'Jeff', + online: true + }, + { + username: 'Alan', + online: false + }, + { + username: 'Mary', + online: true + }, + { + username: 'Jim', + online: false + }, + { + username: 'Sara', + online: true + }, + { + username: 'Laura', + online: true + } + ] + } + } + render() { + const usersOnline = null; // change code here + const renderOnline = null; // change code here + return ( +
    +

    Current Online Users:

    +
      + {renderOnline} +
    +
    + ); + } +}; + +``` + +
    + + +### After Test +
    + +```js +console.info('after the test'); +``` + +
    + +
    + +## Solution +
    + +```js +// solution required +``` +
    diff --git a/curriculum/challenges/arabic/03-front-end-libraries/react/use-array.map-to-dynamically-render-elements.arabic.md b/curriculum/challenges/arabic/03-front-end-libraries/react/use-array.map-to-dynamically-render-elements.arabic.md new file mode 100644 index 0000000000..5c2f2ba49d --- /dev/null +++ b/curriculum/challenges/arabic/03-front-end-libraries/react/use-array.map-to-dynamically-render-elements.arabic.md @@ -0,0 +1,110 @@ +--- +id: 5a24c314108439a4d403618a +title: Use Array.map() to Dynamically Render Elements +challengeType: 6 +isRequired: false +videoUrl: '' +localeTitle: استخدم Array.map () Dynamically Render Elements +--- + +## Description +
    العرض الشرطي مفيد ، ولكن قد تحتاج إلى المكونات الخاصة بك لعرض عدد غير معروف من العناصر. في كثير من الأحيان في البرمجة التفاعلية ، لا يملك المبرمج أي طريقة لمعرفة حالة التطبيق حتى وقت التشغيل ، وذلك لأن الكثير يعتمد على تفاعل المستخدم مع هذا البرنامج. يحتاج المبرمجون إلى كتابة التعليمات البرمجية الخاصة بهم لمعالجة هذه الحالة غير المعروفة بشكل صحيح في وقت مبكر. استخدام Array.map() في Array.map() يوضح هذا المفهوم. على سبيل المثال ، يمكنك إنشاء تطبيق "قائمة المهام" البسيط. كمبرمج ، ليس لديك طريقة لمعرفة عدد العناصر التي قد يكون لدى المستخدم في قائمته. تحتاج إلى إعداد المكون الخاص بك لعرض العدد الصحيح لعناصر القوائم بشكل ديناميكي قبل أن يقرر شخص ما يستخدم البرنامج اليوم أن يكون يوم الغسيل.
    + +## Instructions +
    يحتوي محرر التعليمة البرمجية على معظم مكون MyToDoList تم إعداده. يجب أن يبدو بعض هذا الرمز مألوفًا إذا أكملت تحديًا للنموذج المتحكم فيه. ستلاحظ textarea و button ، جنبا إلى جنب مع اثنين من الأساليب التي تتبع ولاياتهم، ولكن يتم تقديم أي شيء للالصفحة إلى الآن. داخل constructor ، إنشاء this.state الكائن وتحديد دولتين: userInput يجب تهيئة باعتبارها سلسلة فارغة، و toDoList يجب تهيئة كصفيف فارغة. بعد ذلك ، قم بحذف التعليق في طريقة العرض render() بجوار متغير items . في مكانها، خريطة على toDoList مجموعة المخزنة في الحالة الداخلية للمكون حيوي وتجعل من li لكل عنصر. حاول إدخال سلسلة eat, code, sleep, repeat في textarea ، ثم انقر فوق الزر وشاهد ما يحدث. ملاحظة: قد تعرف أن جميع العناصر الفرعية التابعة التي تم إنشاؤها بواسطة عملية تعيين مثل هذه تحتاج إلى أن يتم توفيرها بسمة key فريدة. لا تقلق ، هذا هو موضوع التحدي التالي.
    + +## Tests +
    + +```yml +tests: + - text: يجب أن يوجد مكون MyToDoList ثم تقديم إلى الصفحة. + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(MyToDoList)); return mockedComponent.find("MyToDoList").length === 1; })(), "The MyToDoList component should exist and render to the page.");' + - text: يجب أن يكون الطفل الأول من MyToDoList عنصر textarea . + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(MyToDoList)); return mockedComponent.find("MyToDoList").children().childAt(0).type() === "textarea"; })(), "The first child of MyToDoList should be a textarea element.");' + - text: يجب أن يكون الطفل الثالث من MyToDoList عنصر button . + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(MyToDoList)); return mockedComponent.find("MyToDoList").children().childAt(2).type() === "button"; })(), "The third child of MyToDoList should be a button element.");' + - text: حالة MyToDoList يجب تهيئة مع toDoList كصفيف فارغة. + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(MyToDoList)); const initialState = mockedComponent.state(); return Array.isArray(initialState.toDoList) === true && initialState.toDoList.length === 0; })(), "The state of MyToDoList should be initialized with toDoList as an empty array.");' + - text: حالة MyToDoList يجب تهيئة مع userInput باعتبارها سلسلة فارغة. + testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(MyToDoList)); const initialState = mockedComponent.state(); return typeof initialState.userInput === "string" && initialState.userInput.length === 0; })(), "The state of MyToDoList should be initialized with userInput as an empty string.");' + - text: '' + testString: 'async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 100)); const mockedComponent = Enzyme.mount(React.createElement(MyToDoList)); const simulateChange = (el, value) => el.simulate("change", {target: {value}}); const state_1 = () => { return waitForIt(() => mockedComponent.find("ul").find("li"))}; const setInput = () => { return waitForIt(() => simulateChange(mockedComponent.find("textarea"), "testA, testB, testC"))}; const click = () => { return waitForIt(() => mockedComponent.find("button").simulate("click"))}; const state_2 = () => { return waitForIt(() => { const nodes = mockedComponent.find("ul").find("li"); return { nodes, text: nodes.reduce((t, n) => t + n.text(), "") }; })}; const setInput_2 = () => { return waitForIt(() => simulateChange(mockedComponent.find("textarea"), "t1, t2, t3, t4, t5, t6"))}; const click_1 = () => { return waitForIt(() => mockedComponent.find("button").simulate("click"))}; const state_3 = () => { return waitForIt(() => { const nodes = mockedComponent.find("ul").find("li"); return { nodes, text: nodes.reduce((t, n) => t + n.text(), "") }; })}; const awaited_state_1 = await state_1(); const awaited_setInput = await setInput(); const awaited_click = await click(); const awaited_state_2 = await state_2(); const awaited_setInput_2 = await setInput_2(); const awaited_click_1 = await click_1(); const awaited_state_3 = await state_3(); assert(awaited_state_1.length === 0 && awaited_state_2.nodes.length === 3 && awaited_state_3.nodes.length === 6 && awaited_state_2.text === "testA testB testC" && awaited_state_3.text === "t1 t2 t3 t4 t5 t6", "When the Create List button is clicked, the MyToDoList component should dynamically return an unordered list that contains a list item element for every item of a comma-separated list entered into the textarea element."); }; ' + +``` + +
    + +## Challenge Seed +
    + +
    + +```jsx +const textAreaStyles = { + width: 235, + margin: 5 +}; + +class MyToDoList extends React.Component { + constructor(props) { + super(props); + // change code below this line + + // change code above this line + this.handleSubmit = this.handleSubmit.bind(this); + this.handleChange = this.handleChange.bind(this); + } + handleSubmit() { + const itemsArray = this.state.userInput.split(','); + this.setState({ + toDoList: itemsArray + }); + } + handleChange(e) { + this.setState({ + userInput: e.target.value + }); + } + render() { + const items = null; // change code here + return ( +
    +