mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-08 09:00:38 -04:00
chore(i18n,learn): processed translations (#48855)
This commit is contained in:
@@ -10,7 +10,7 @@ dashedName: add-items-to-an-array-with-push-and-unshift
|
||||
|
||||
طول القائمة، مثل أنواع البيانات التي يمكن أن تحتويها، غير ثابت. ويمكن تعريف القائمات بطول أي عدد من العناصر، ويمكن إضافة العناصر أو إزالتها بمرور الوقت؛ وبعبارة أخرى، القائمات هي قابلة للتغير <dfn>mutable</dfn>. في هذا التحدي، سننظر إلى وظيفتين يمكن بهما تعديل القائمة: `Array.push()` و `Array.unshift()`.
|
||||
|
||||
تأخذ كلتا الوظيفتين عنصراً واحداً أو أكثر من العناصر كمعلمات وتضيف هذه العناصر إلى القائمة التي تستدعيها الوظيفة؛ وظيفة `push()` تضيف عناصر إلى نهاية القائمة، و `unshift()` تضيف عناصر إلى البداية. انظر ما يلي:
|
||||
تأخذ كلتا الطريقتان (methods) عنصراً واحداً أو أكثر من العناصر كوسائط (parameters) وتضيف هذه العناصر إلى القائمة (array) التي تنفيذها الطريقة؛ تضيف طريقة `push()` عناصر إلى نهاية القائمة، وتضيف `unshift()` عناصر إلى البداية. انظر ما يلي:
|
||||
|
||||
```js
|
||||
let twentyThree = 'XXIII';
|
||||
|
||||
@@ -8,7 +8,7 @@ dashedName: add-items-using-splice
|
||||
|
||||
# --description--
|
||||
|
||||
تذكر في التحدي الأخير الذي ذكرناه أن `splice()` يمكن أن يأخذ ما يصل إلى ثلاث حجج؟ حسناً، يمكنك استخدام المعلم الثالث، المكون من عنصر واحد أو أكثر، للإضافة إلى القائمة. يمكن أن يكون هذا مفيدًا بشكل لا يصدق للتبديل السريع لعنصر، أو مجموعة من العناصر، بعنصر آخر.
|
||||
تذكر في التحدي السابق الذي ذكرناه إن `splice()` تمكن أن تأخذ ما يصل إلى ثلاثة وسائط (parameters)؟ حسناً، يمكنك استخدام الوسيط الثالث، المكون من عنصر واحد أو أكثر، للإضافة إلى القائمة (array). يمكن أن يكون هذا مفيدًا بشكل لا يصدق للتبديل السريع لعنصر، أو مجموعة من العناصر، بعنصر آخر.
|
||||
|
||||
```js
|
||||
const numbers = [10, 11, 12, 12, 15];
|
||||
|
||||
@@ -8,7 +8,7 @@ dashedName: check-for-the-presence-of-an-element-with-indexof
|
||||
|
||||
# --description--
|
||||
|
||||
نظرًا لأنه يمكن تغيير القوائم، أو *يتم تحويرها* في أي وقت، لا يوجد ضمان حول مكان وجود جزء معين من البيانات في قائمة معينة، أو حتي إذا كان هذا العنصر لا يزال موجودا. لحسن الحظ، يوفر لنا JavaScript وظيفة مدمجة (built-in method) أخرى تسمى `indexOf()`، وهذه تسمح لنا بالتحقق بسرعة وسهولة من وجود عنصر في القائمة. `indexOf()` تأخذ عنصرا كمعلم, و عندما تستدعي، فإنها ترجع المكان، أو الترتيب (index)، لهذا العنصر، أو `-1` إذا كان العنصر غير موجود في القائمة.
|
||||
نظرًا لأنه يمكن تغيير القوائم، أو *يتم تحويرها* في أي وقت، لا يوجد ضمان حول مكان وجود جزء معين من البيانات في قائمة معينة، أو حتي إذا كان هذا العنصر لا يزال موجودا. لحسن الحظ، يوفر لنا JavaScript وظيفة مدمجة (built-in method) أخرى تسمى `indexOf()`، وهذه تسمح لنا بالتحقق بسرعة وسهولة من وجود عنصر في القائمة. تأخذ `indexOf()` عنصرا كوسيط عند تفعيلها، فإنها تنتج المكان (position)، أو الترتيب (index)، لهذا العنصر، أو `-1` إذا كان العنصر غير موجود في القائمة (array).
|
||||
|
||||
على سبيل المثال:
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ dashedName: copy-array-items-using-slice
|
||||
|
||||
# --description--
|
||||
|
||||
الوظيفة التالية التي سنغطيها هي `slice()`. بدلا من تعديل القائمة، `slice()` تنسخ أو *تستخرج* عدد معين من العناصر إلى قائمة جديدة، دون تغيير للقائمة التي استدعت عليها الوظيفة. تأخذ `slice()` معلمتين فقط - الأولى هي ترتيب الذي يبدأ عنده الاستخراج، والثانية هي الترتيب الذي يتم عنده إيقاف الاستخراج (سيحدث الاستخراج حتى الترتيب، ولكن لا يشمل العنصر في هذا الترتيب). ضع في اعتبارك هذا المثال:
|
||||
الوظيفة التالية التي سنغطيها هي `slice()`. بدلا من تعديل القائمة، `slice()` تنسخ أو *تستخرج* عدد معين من العناصر إلى قائمة جديدة، دون تغيير للقائمة التي استدعت عليها الوظيفة. تأخذ `slice()` وسيطين (parameters) فقط - يكون الأولى الترتيب الذي يبدأ عنده الاستخراج، ويكون الثاني الترتيب الذي يتم عنده إيقاف الاستخراج (سيحدث الاستخراج حتى الترتيب، ولكن لا يشمل العنصر نهاية الترتيب). ضع في اعتبارك هذا المثال:
|
||||
|
||||
```js
|
||||
let weatherConditions = ['rain', 'snow', 'sleet', 'hail', 'clear'];
|
||||
|
||||
@@ -8,7 +8,7 @@ dashedName: remove-items-from-an-array-with-pop-and-shift
|
||||
|
||||
# --description--
|
||||
|
||||
كلاً من `push()` و `unshift()` لديهما functions معارضة و هما: `pop()` و `shift()`. ربما خمنت الآن انه بدلاً من إضافة بواسطة `pop()` تقوم *بإزالة* عنصر من نهاية array، بينما `shift()` يزيل عنصر من البداية. الفرق الرئيس بين `pop()` و `shift()` وأمثالهم `push()` و `unshift()`, هو أن أيا من الطريقتين لا يأخذ parameters، ويسمح كل منهما فقط بتعديل array بعنصر واحد فقط في كل مرة.
|
||||
كلاً من `push()` و `unshift()` لديهما functions معارضة و هما: `pop()` و `shift()`. ربما خمنت الآن انه بدلاً من إضافة بواسطة `pop()` تقوم *بإزالة* عنصر من نهاية array، بينما `shift()` يزيل عنصر من البداية. الفرق الرئيس بين `pop()` و `shift()` وأمثالهم `push()` و `unshift()`, هو إن الطريقتين (method) لا تأخذوا وسائط (parameters)، وتسمحوا كل منهم فقط بتعديل قائمة (array) بعنصر واحد فقط في كل مرة.
|
||||
|
||||
ألقي نَّظْرَة:
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ dashedName: remove-items-using-splice
|
||||
|
||||
حسنًا، لقد تعلمنا كيفية إزالة العناصر من بداية ونهاية arrays باستخدام `shift()` و `pop()`، ولكن ماذا لو أردت إزالة عنصر من مكان ما في المنتصف؟ أم إزالة أكثر من عنصر واحد في المرة الواحدة؟ هنا يأتي دور `splice()`. `splice()` تسمح لنا بالقيام بما يلي: **إزالة أي عدد من العناصر المتتالية** من أي مكان في array.
|
||||
|
||||
`splice()` يمكن أن يأخذ ما يصل إلى 3 parameters، ولكن في الوقت الحالي، سنركز على أول 2 parameters. أول ٢ parameters في `splice()` هما أعداد صحيحة تمثل indexes، أو أماكن العناصر في array التي تستدعهم `splice()`. وتذكر أن arrays هم *zero-indexed*، بحيث لنشير إلى العنصر الأول في array، سوف تستخدم `0`. يمثل أول parameter في `splice()` الترتيب (index) في array التي تبدأ منها إزالة العناصر، بينما parameter الثاني يشير إلى عدد العناصر المراد حذفها. على سبيل المثال:
|
||||
يمكن أن يأخذ `splice()` ما يصل من 3 وسائط (parameters)، ولكن في الوقت الحالي، سنركز على أول 2. يكون أول ثاني وسائط في `splice()` أعداد صحيحة تمثل ترتيب (indexes) العناصر، أو أماكن العناصر في قائمة (array) الذي `splice()` تم تفعيلها. وتذكر أن arrays هم *zero-indexed*، بحيث لنشير إلى العنصر الأول في array، سوف تستخدم `0`. يمثل أول وسيط في `splice()` الترتيب (index) في قائمة التي تبدأ منها إزالة العناصر، بينما الوسيط الثاني يشير إلى عدد العناصر المراد حذفها. على سبيل المثال:
|
||||
|
||||
```js
|
||||
let array = ['today', 'was', 'not', 'so', 'great'];
|
||||
|
||||
@@ -15,7 +15,7 @@ dashedName: counting-cards
|
||||
|
||||
<table class='table table-striped'><thead><tr><th>تغيير العد</th><th>الأوراق</th></tr></thead><tbody><tr><td>+1</td><td>2, 3, 4, 5, 6</td></tr><tr><td>0</td><td>7, 8, 9</td></tr><tr><td>-1</td><td>10, 'J', 'Q', 'K', 'A'</td></tr></tbody></table>
|
||||
|
||||
سوف تكتب وظيفة لعد الورق. سوف يتلقى حِجَّة `card`, الذي يمكن أن يكون رقما أو مقطع، ويزيد أو يخفض متغير `count` وفقا لقيمة الورقة (انظر إلى الجدول). ثم ستقوم الوظيفة (function) بإنشاء مقطع (string) يحتوي علي العد الحالي والمقطع `Bet` إذا كان العد إيجابياً، أو `Hold` إذا كان العد صفر أو سلبي. يجب أن يفصل العد الحالي وقرار اللاعب (`Bet` أو `Hold`) بمسافة واحدة.
|
||||
سوف تكتب وظيفة لعد الورق. سوف يتلقى الوسيط (parameter) المسمى `card`, الذي يمكن أن يكون رقما أو مقطع نصي (string)، ويزيد أو يخفض متغير `count` وفقا لقيمة الورقة (انظر إلى الجدول). ثم ستقوم الوظيفة (function) بإنشاء مقطع (string) يحتوي علي العد الحالي والمقطع `Bet` إذا كان العد إيجابياً، أو `Hold` إذا كان العد صفر أو سلبي. يجب أن يفصل العد الحالي وقرار اللاعب (`Bet` أو `Hold`) بمسافة واحدة.
|
||||
|
||||
**مثال على النتائج:** كالآتي `-3 Hold` أو `5 Bet`
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ delete ourDog.bark;
|
||||
|
||||
# --instructions--
|
||||
|
||||
احذف خاصية `tails` من `myDog`. يمكنك استخدام النقطة (dot) أو القوسان المعكوفان (bracket notation).
|
||||
احذف خاصية `tails` من `myDog`. يمكنك استخدام النقطة (dot) أو الأقواس المربعة (bracket notation).
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ dashedName: escaping-literal-quotes-in-strings
|
||||
|
||||
عند تحديد مقطع نصي يجب أن تبدأ وتنتهي بالعلامات التنصيص واحد ('') أو مزدوج (""). ماذا يحدث عندما تحتاج إلى استخدام علامتا التنصيص مثل: `"` أو `'` داخل مقطعك النصي؟
|
||||
|
||||
في JavaScript، يمكنك <dfn>إخراج</dfn> علامتا التنصيص حتي لا تعدّ نهاية للعلامة الأولى في المقطع النصي عن طريق وضع <dfn>خط مائل</dfn> بشكل (`\`) أمام علامتا التنصيص.
|
||||
في JavaScript، يمكنك <dfn>إخراج</dfn> علامتا التنصيص حتي لا تعدّ نهاية للعلامة الأولى في المقطع النصي عن طريق وضع <dfn>خط مائل للشمال</dfn> بشكل (`\`) أمام علامتا التنصيص.
|
||||
|
||||
```js
|
||||
const sampleStr = "Alan said, \"Peter is learning JavaScript\".";
|
||||
|
||||
@@ -9,7 +9,7 @@ dashedName: local-scope-and-functions
|
||||
|
||||
# --description--
|
||||
|
||||
المتغيرات التي المعلنا داخل وظيفة، وكذلك الوسائط (parameters) للوظيفة لديها نطاق و يكون <dfn>محلي</dfn>. وهذا يعني أنها لا تبد مرئية إلا في إطار الوظيفة.
|
||||
المتغيرات التي المعلنا داخل وظيفة (function)، وكذلك الوسائط (parameters) للوظيفة لديها نطاق و يكون <dfn>محلي (local)</dfn>. وهذا يعني أنها لا تبد مرئية إلا في إطار الوظيفة.
|
||||
|
||||
هذه وظيفة `myTest` مع متغير محلي يسمى `loc`.
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ dashedName: manipulate-arrays-with-push
|
||||
|
||||
طريقة سهلة لإضافة البيانات إلى نهاية القائمة هي عن طريق وظيفة `push()`.
|
||||
|
||||
يأخذ `.push()` واحد أو أكثر من <dfn>الحجج</dfn> و "يدفعها" إلى نهاية القائمة.
|
||||
تأخذ `.push()` واحد أو أكثر من <dfn>الوسائط</dfn> و "تدفعها" إلى نهاية القائمة.
|
||||
|
||||
على سبيل المثال:
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@ dashedName: passing-values-to-functions-with-arguments
|
||||
|
||||
# --description--
|
||||
|
||||
<dfn>الحجج</dfn> هي متغيرات تعمل كعناصر ناقلة للقيم الذي يجب أن تكون مدخلة للوظيفة عند استدعائها. عندما يتم تعريف الوظيفة، فإنها تُعرَّف عادة مع واحد أو أكثر من الحجج. القيم الفعلية التي تدخل (أو <dfn>"تمرر"</dfn>) إلى وظيفة عند استدعائها هي معروفة باسم <dfn>الحجج (arguments)</dfn>.
|
||||
إن <dfn>الوسائط (parameters)</dfn> متغيرات تعمل كعناصر ناقلة للقيم الذي يجب أن تكون مدخلة للوظيفة (function) عند تنفيذها. عندما يتم تعريف الوظيفة، فإنها تُعرَّف عادة مع واحد أو أكثر من وسيط. القيم الفعلية التي تدخل (أو <dfn>"تمرر"</dfn>) إلى وظيفة عند استدعائها هي معروفة باسم <dfn>الحجج (arguments)</dfn>.
|
||||
|
||||
إليك وظيفة ذات حجتين، `param1` و `param2`:
|
||||
إليك وظيفة ذات وسيطين، `param1` و `param2`:
|
||||
|
||||
```js
|
||||
function testFun(param1, param2) {
|
||||
@@ -19,7 +19,7 @@ function testFun(param1, param2) {
|
||||
}
|
||||
```
|
||||
|
||||
ثم يمكننا استدعاء `testFun` مثل: `testFun("Hello", "World");`. لقد تمريرنا حجج من نوع مقطع, `Hello` و `World`. داخل الحجة، `param1` سيتساوى مع المقطع `Hello` و `param2` سيتساوى مع المقطع `World`. لاحظ أنه يمكنك استدعاء `testFun` مرة أخرى مع حجج مختلفة والمعلمات سوف تأخذ قيمة الحجج الجديدة.
|
||||
ثم يمكننا استدعاء `testFun` مثل: `testFun("Hello", "World");`. لقد تمريرنا حجج من نوع مقطع, `Hello` و `World`. داخل الحجة، `param1` سيتساوى مع المقطع `Hello` و `param2` سيتساوى مع المقطع `World`. لاحظ أنه يمكنك تنفيذ `testFun` مرة أخرى مع معطيات (arguments) مختلفة ووسائط (parameters) لتأخذ قيمة المعطيات الجديدة.
|
||||
|
||||
# --instructions--
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ test(false);
|
||||
|
||||
# --instructions--
|
||||
|
||||
أنشئ تعبير `if` داخل الوظيفة لينتج `Yes, that was true` إذا حالة الحجة `wasThatTrue` تكون `true` وتنتج `No, that was false` خلافا لذلك.
|
||||
أنشئ تعبير `if` داخل الوظيفة لينتج `Yes, that was true` إذا حالة الوسيط `wasThatTrue` تكون `true` وينتج `No, that was false` خلافا لذلك.
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ console.log(countup(5));
|
||||
|
||||
# --instructions--
|
||||
|
||||
لقد عرفنا وظيفة تسمى `countdown` مع حجة واحدة (`n`). يجب أن تستخدم الوظيفة التكرار لإعادة قائمة تحتوي على الأعداد من `n` إلى `1` استنادًا إلى حجة وهي `n`. إذا تم تفعيل الوظيفة بعدد أقل من 1، يجب أن تنتج قائمة فارغة. على سبيل المثال، استدعاء هذه الوظيفة مع `n = 5` يجب أن تنتج القائمة التالية `[5, 4, 3, 2, 1]`. يجب أن تستخدم الوظيفة التكرار بواسطة تفعيل نفسها، ويجب ألا تستخدم الحلقات من أي نوع.
|
||||
لقد عرفنا وظيفة تسمى `countdown` مع وسيط (parameter) واحدة (`n`). يجب أن تستخدم الوظيفة التكرار (recursion) لتنتج قائمة (array) تحتوي على الأعداد من `n` إلى `1` استنادًا إلى وسيط (parameter) مسمى `n`. إذا تم تفعيل الوظيفة بعدد أقل من 1، يجب أن تنتج قائمة فارغة. على سبيل المثال، استدعاء هذه الوظيفة مع `n = 5` يجب أن تنتج القائمة التالية `[5, 4, 3, 2, 1]`. يجب أن تستخدم الوظيفة التكرار بواسطة تفعيل نفسها، ويجب ألا تستخدم الحلقات من أي نوع.
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ dashedName: use-recursion-to-create-a-range-of-numbers
|
||||
|
||||
# --instructions--
|
||||
|
||||
لقد عرفنا وظيفة تسمى `rangeOfNumbers` مع اثنين من الحجج. يجب أن تنتج الوظيفة قيمة القائمة من الأعداد الصحيحة التي تبدأ بعدد يمثله حجة وهي `startNum` وتنتهي بعدد يمثله حجة آخرة وهي `endNum`. سيكون رقم البداية دائماً أقل من أو يساوي رقم النهاية. يجب أن تستخدم الوظيفة التكرار بواسطة تفعيل نفسها، ويجب ألا تستخدم الحلَقات من أي نوع. يجب أن تعمل أيضا في الحالات التي يكون فيها كل من `startNum` و `endNum` متماثلين.
|
||||
لقد حددنا وظيفة (function) تسمى `rangeOfNumbers` مع اثنين من الوسائط (parameters). يجب أن تنتج الوظيفة قائمة من الأعداد الصحيحة التي تبدأ بعدد يمثله وسيط `startNum` وتنتهي بعدد يمثله وسيط `endNum` الآخرة. سيكون رقم البداية دائماً أقل من أو يساوي رقم النهاية. يجب أن تستخدم الوظيفة التكرار بواسطة تفعيل نفسها، ويجب ألا تستخدم الحلَقات من أي نوع. يجب أن تعمل أيضا في الحالات التي يكون فيها كل من `startNum` و `endNum` متماثلين.
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ const a = parseInt("007");
|
||||
|
||||
# --instructions--
|
||||
|
||||
استخدم `parseInt()` في وظيفة اسمها `convertToInteger` تقبل حجة اسمها `str` هي مقطع، تحوله إلى عدد صحيح وترجعه.
|
||||
استخدم `parseInt()` في وظيفة اسمها `convertToInteger` لتخول قيمة المقطع النصي `str` إلى عدد صحيح, وتنتجه.
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ dashedName: create-a-javascript-promise
|
||||
|
||||
# --description--
|
||||
|
||||
الوعد (promise) في لغة JavaScript هو التوعد بالقيام بشيء ما، عادة بشكل غير متزامن. وعندما تنتهي المهمة، إما أن تفي بالوعد أو أن تخفق في ذلك. يكون `Promise` منشئ للوظيفة، لذا تحتاج إلى استخدام كلمة `new` لإنشاء واحد. إنه يأخذ وظيفة (كحجة) مع حجتين - `resolve` و `reject`. وهذه هي الطرق المستخدمة لتحديد نتيجة الوعد. يبدو بناء الجملة كهذا:
|
||||
الوعد (promise) في لغة JavaScript هو التوعد بالقيام بشيء ما، عادة بشكل غير متزامن. وعندما تنتهي المهمة، إما أن تفي بالوعد أو أن تخفق في ذلك. يكون `Promise` منشئ للوظيفة، لذا تحتاج إلى استخدام كلمة `new` لإنشاء واحد. إنه يأخذ وظيفة (function) كمعطى, مع وسيطين (parameters) يسمان - `resolve` و `reject`. وهذه هي الطرق المستخدمة لتحديد نتيجة الوعد. يبدو بناء الجملة كهذا:
|
||||
|
||||
```js
|
||||
const myPromise = new Promise((resolve, reject) => {
|
||||
@@ -18,7 +18,7 @@ const myPromise = new Promise((resolve, reject) => {
|
||||
|
||||
# --instructions--
|
||||
|
||||
قم بإنشاء وعد جديد يسمى `makeServerRequest`. قم بتمرير وظيفة بحجج `resolve` و `reject` ألى المنشئ (constructor).
|
||||
قم بإنشاء وعد جديد يسمى `makeServerRequest`. اعطي وظيفة مع الوسائط `resolve` و `reject` إلى المنشئ (constructor).
|
||||
|
||||
# --hints--
|
||||
|
||||
@@ -28,7 +28,7 @@ const myPromise = new Promise((resolve, reject) => {
|
||||
assert(makeServerRequest instanceof Promise);
|
||||
```
|
||||
|
||||
يجب أن يتلقى الوعد الخاص بك الوظيفة مع `resolve` و `reject` كحجج.
|
||||
يجب أن يتلقى وعدك (promise) وظيفة مع `resolve` و `reject` كوسائط.
|
||||
|
||||
```js
|
||||
assert(
|
||||
|
||||
@@ -20,7 +20,7 @@ myPromise.then(result => {
|
||||
|
||||
# --instructions--
|
||||
|
||||
أضف method الـ `then` إلى الـ promise الخاص بك. استخدم `result` كمعلمة لـ callback function واخرج الـ `result` إلى وحدة التحكم.
|
||||
أضف method الـ `then` إلى الـ promise الخاص بك. استخدم `result` كوسيط لوظيفة تعيد تفعيلها وسجل قيمة `result` في وحدة التحكم (console).
|
||||
|
||||
# --hints--
|
||||
|
||||
@@ -32,7 +32,7 @@ assert(
|
||||
);
|
||||
```
|
||||
|
||||
يجب أن تكون لـ method الـ `then` الـ callback function مع `result` كمعلمتها (parameter).
|
||||
يجب أن تكون لطريقة (method) المسمى `then` الوظيفة تعيد تفعيلها (callback function) مع `result` كوسيط (parameter).
|
||||
|
||||
```js
|
||||
assert(resultIsParameter);
|
||||
|
||||
@@ -20,7 +20,7 @@ myPromise.catch(error => {
|
||||
|
||||
# --instructions--
|
||||
|
||||
أضف method الـ `catch` إلى الـ promise الخاص بك. استخدم `error` كمعلمة لـ callback function واخرج الـ `error` إلى وحدة التحكم.
|
||||
أضف method الـ `catch` إلى الـ promise الخاص بك. استخدم `error` كوسيط لوظيفة تعيد تفعيلها وسجل `error` في وحدة التحكم (console).
|
||||
|
||||
# --hints--
|
||||
|
||||
@@ -32,7 +32,7 @@ assert(
|
||||
);
|
||||
```
|
||||
|
||||
يجب أن تكون لـ method الـ `catch` الـ callback function مع `error` كمعلمتها (parameter).
|
||||
يجب أن تكون لطريقة (method) المسمى `catch` الوظيفة تعيد تفعيلها (callback function) مع `error` كوسيطها (parameter).
|
||||
|
||||
```js
|
||||
assert(errorIsParameter);
|
||||
|
||||
@@ -21,7 +21,7 @@ console.log(greeting());
|
||||
|
||||
ستعرض وحدة التحكم الـ strings الآتية `Hello John` و `Hello Anonymous`.
|
||||
|
||||
يبدأ الـ default parameter في العمل عندما لا يتم تحديد الـ argument (عندما تكون undefined). كما ترون في المثال أعلاه، الـ parameter الآتي `name` سوف يتلقى القيمة الافتراضية `Anonymous` ، عندما لا تقدم قيمة للـ parameter. يمكنك إضافة القيم الافتراضية لاي عدد من الـ parameters كما تريد.
|
||||
يبدأ الوسيط الافتراضي (default parameter) في العمل عندما لا يتم تحديد المعطى argument (عندما تكون undefined). كما ترون في المثال أعلاه، سوف يتلقى الوسيط (parameter) المسمى `name` الآتي القيمة الافتراضية `Anonymous`، عندما لا تقدم قيمة للوسيط. يمكنك إضافة القيم الافتراضية لأي عدد من الوسائط (parameters) كما تريد.
|
||||
|
||||
# --instructions--
|
||||
|
||||
@@ -41,7 +41,7 @@ assert(increment(5, 2) === 7);
|
||||
assert(increment(5) === 6);
|
||||
```
|
||||
|
||||
قيمة الـ default parameter لـ `1` يجب استخدامها لـ `value`.
|
||||
يجب استخدام قيمة `1` للوسائط الافتراضية (default parameter) في `value`.
|
||||
|
||||
```js
|
||||
assert(code.match(/value\s*=\s*1/g));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 587d7b8a367417b2b2512b4d
|
||||
title: Use Destructuring Assignment to Pass an Object as a Function's Parameters
|
||||
title: استخدام التعيين التركيبي (Destructuring Assignment) لإعطاء كائن كوسيط للوظائف
|
||||
challengeType: 1
|
||||
forumTopicId: 301217
|
||||
dashedName: use-destructuring-assignment-to-pass-an-object-as-a-functions-parameters
|
||||
@@ -27,7 +27,7 @@ const profileUpdate = ({ name, age, nationality, location }) => {
|
||||
}
|
||||
```
|
||||
|
||||
عندما يتم تمرير `profileData` إلى الـ function أعلاه، يتم تفصيص القيم من معلمة (parameter) الـ function لاستخدامها داخل الـ function.
|
||||
عندما يتم تمرير `profileData` إلى الوظيفة (function) أعلاه، تفكيك القيم من وسيط (parameter) الوظيفة لاستخدامها داخل الوظيفة.
|
||||
|
||||
# --instructions--
|
||||
|
||||
@@ -53,7 +53,7 @@ assert(half(stats) === 28.015);
|
||||
assert(__helpers.removeWhiteSpace(code).match(/half=\({\w+,\w+}\)/));
|
||||
```
|
||||
|
||||
وينبغي استخدام Destructured parameter.
|
||||
ينبغي استخدام وسيط التركيبي (Destructured parameter).
|
||||
|
||||
```js
|
||||
assert(!code.match(/stats\.max|stats\.min/));
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
id: 587d7b8a367417b2b2512b4c
|
||||
title: >-
|
||||
Destructuring via rest elements
|
||||
التفكيك عن طريق عناصر rest
|
||||
challengeType: 1
|
||||
forumTopicId: 301218
|
||||
dashedName: >-
|
||||
@@ -22,11 +22,11 @@ console.log(arr);
|
||||
|
||||
ستعرض وحدة التحكم القيم `1, 2` و `[3, 4, 5, 7]`.
|
||||
|
||||
المتغيرات `a` و `b` تأخذ القيم الأولى والثانية من الـ array. After that, because of the rest syntax presence, `arr` gets the rest of the values in the form of an array. يعمل العنصر rest بشكل صحيح فقط كآخر متغير في القائمة. As in, you cannot use the rest syntax to catch a subarray that leaves out the last element of the original array.
|
||||
المتغيرات `a` و `b` تأخذ القيم الأولى والثانية من الـ array. بعد ذلك، بسبب وجود الثلاثة نقاط التي تدعى rest، سوف يحصل المتغير `arr` على بقية القيم في شكل قائمة (array). يعمل العنصر rest بشكل صحيح فقط كآخر متغير في القائمة. بمعني، انه لا يمكنك استخدام rest للحصول على قائمة فرعية (subarray) التي لا تحتوي غلى العنصر الأخير من القائمة الأصلية.
|
||||
|
||||
# --instructions--
|
||||
|
||||
Use a destructuring assignment with the rest syntax to emulate the behavior of `Array.prototype.slice()`. يجب أن ينتج `removeFirstTwo()` قائمة فرعية (sub-array) من قائمة `list` الأصلية دون العنصرين الأولين.
|
||||
استخدم تشكيل rest لتعيين التركبي (destructuring assignment) لمحاكاة سلوك `Array.prototype.slice()`. يجب أن ينتج `removeFirstTwo()` قائمة فرعية (sub-array) من قائمة `list` الأصلية دون العنصرين الأولين.
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 587d7b88367417b2b2512b47
|
||||
title: Use the Rest Parameter with Function Parameters
|
||||
title: استخدام وسائط Rest مع وسائط الوظيفة
|
||||
challengeType: 1
|
||||
forumTopicId: 301221
|
||||
dashedName: use-the-rest-parameter-with-function-parameters
|
||||
@@ -8,7 +8,7 @@ dashedName: use-the-rest-parameter-with-function-parameters
|
||||
|
||||
# --description--
|
||||
|
||||
من أجل مساعدتنا في إنشاء functions أكثر مرونة، يوفر ES6 الـ <dfn>rest parameters</dfn> للـ function parameters. مع rest parameter، يمكنك إنشاء functions تأخذ عددا متغيرا من الـ arguments. يتم تخزين هذه الـ arguments في array يمكن الوصول إليها في وقت لاحق من داخل الـ function.
|
||||
من أجل مساعدتنا في إنشاء وظائف (functions) أكثر مرونة، يوفر ES6 <dfn>الوسائط rest</dfn> للوسائط (parameters) الوظيفة. مع وسيط rest، يمكنك إنشاء وظائف تأخذ عددا متغيرا من المعطيات (arguments). يتم تخزين هذه الـ arguments في array يمكن الوصول إليها في وقت لاحق من داخل الـ function.
|
||||
|
||||
تحقق من هذا الكود:
|
||||
|
||||
@@ -22,11 +22,11 @@ console.log(howMany("string", null, [1, 2, 3], { }));
|
||||
|
||||
ستعرض وحدة التحكم السلاسل `You have passed 3 arguments.` و `You have passed 4 arguments.`.
|
||||
|
||||
الـ rest parameter تزيل الحاجة إلى التحقق من array الـ `args` وتسمح لنا بتطبيق `map()` و `filter()` و `reduce()` على array المعلمات (parameters).
|
||||
يزيل وسيط rest الحاجة إلى التحقق من القائمة (array) المسمى `args` وتسمح لك باستعمال `map()` و `filter()` و `reduce()` في وسائط القائمة.
|
||||
|
||||
# --instructions--
|
||||
|
||||
قم بتعديل الدالة `sum` باستخدام rest parameter بطريقة تجعل الدالة `sum` قادرة على أخذ أي عدد من الـ arguments وإرجاع مجموعها.
|
||||
عدل وظيفة `sum` باستخدام وسيط rest بطريقة تجعل الوظيفة `sum` قادرة على أخذ أي عدد من المعطيات وإنتاج مجموعها.
|
||||
|
||||
# --hints--
|
||||
|
||||
@@ -54,7 +54,7 @@ assert(sum(5) === 5);
|
||||
assert(sum() === 0);
|
||||
```
|
||||
|
||||
`sum` يجب أن يكون arrow function يستخدم rest parameter syntax الآتي (`...`) على معلمة `args`.
|
||||
يجب أن تكون `sum` وظيفة السهم, التي تستخدم تشكيل وسيط rest الآتي (`...`) على وسيط `args`.
|
||||
|
||||
```js
|
||||
assert(__helpers.removeWhiteSpace(code).match(/sum=\(\.\.\.args\)=>/));
|
||||
|
||||
@@ -8,7 +8,7 @@ dashedName: use-the-spread-operator-to-evaluate-arrays-in-place
|
||||
|
||||
# --description--
|
||||
|
||||
ES6 يقدم <dfn>spread operator</dfn>، والذي يسمح لنا بتوسيع الـ arrays وغيرها من التعبيرات في الأماكن التي يتوقع أن تكون فيها معلمات أو عناصر متعددة.
|
||||
يقدم ES6 <dfn>مشغل الانتشار (spread operator)</dfn>، الذي يسمح لنا بتوسيع القوائم (arrays) وغيرها من التعبيرات في الأماكن التي يتوقع أن تكون فيها وسائط (parameters) أو عناصر متعددة.
|
||||
|
||||
كود ES5 أدناه يستخدم `apply()` لحساب القيمة القصوى في الـ array:
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 587d7b88367417b2b2512b44
|
||||
title: Write Arrow Functions with Parameters
|
||||
title: أنشاء وظائف السهم (Arrow Functions) مع الوسائط
|
||||
challengeType: 1
|
||||
forumTopicId: 301223
|
||||
dashedName: write-arrow-functions-with-parameters
|
||||
@@ -17,7 +17,7 @@ doubler(4);
|
||||
|
||||
`doubler(4)` سوف يعيد القيمة `8`.
|
||||
|
||||
إذا كان للـ arrow function معلمة واحدة، يمكن حذف الأقواس المرفقة بالمعلمة.
|
||||
إذا كان للوظيفة السهم وسيط واحدة، يمكن حذف الأقواس المرفقة للوسيط.
|
||||
|
||||
```js
|
||||
const doubler = item => item * 2;
|
||||
@@ -50,7 +50,7 @@ assert.notMatch(code, /var/g);
|
||||
assert.match(code, /const\s+myConcat/g);
|
||||
```
|
||||
|
||||
`myConcat` يجب أن تكون arrow function مع معلمين (two parameters)
|
||||
يجب أن تكون `myConcat` وظيفة السهم (arrow function) مع وسيطين (parameters)
|
||||
|
||||
```js
|
||||
assert(
|
||||
|
||||
@@ -52,7 +52,7 @@ partialFn(10); // 13
|
||||
|
||||
# --instructions--
|
||||
|
||||
املأ نص الدالة `add` بحيث تستخدم خاصية curry لإضافة المعلمات `x` و `y` و `z`.
|
||||
املأ نص الوظيفة (function) المسمى `add` بحيث تستخدم خاصية curry لإضافة الوسائط (parameters) المسمى `x`, و `y`, و `z`.
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ dashedName: refactor-global-variables-out-of-functions
|
||||
|
||||
1) لا تغير متغير (variable) أو كائن (object) - أنشئ متغيرات و كائنات (objects) جديدة و منشئا من الوظيفة (function) إذا لزم الأمر. تلميح: باستخدام شيء مثل `const newArr = arrVar`، حيث `arrVar` هو array، سوف يقوم ببساطة بإنشاء مرجع إلى المتغير الحالي وليس نسخة. لذا فإن تغيير قيمة في `newArr` سيغير القيمة في `arrVar`.
|
||||
|
||||
2) إعلان وسائط الوظيفة (function parameters) - يعتمد حسابات داخل الوظيفة (function) فقط على الوسائط (arguments) التي تمر إلى الوظيفة (function)، ولاا تعتمد على أي كائن (object) أو متغير (variable) عام (global).
|
||||
2) إعلان وسائط الوظيفة (function parameters) - يعتمد حسابات داخل الوظيفة (function) فقط على الوسائط (arguments) التي تمر إلى الوظيفة (function)، ولا تعتمد على أي كائن (object) أو متغير (variable) عام (global).
|
||||
|
||||
إن إضافة واحد إلى رقما ليس مثيراً جداً، ولكن يمكننا تطبيق هذه المبادئ عند العمل مع arrays أو objects أكثر تعقيداً.
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ dashedName: understand-functional-programming-terminology
|
||||
|
||||
كان لدى فريق FCC تقلبات مزاجية ويريد الآن نوعين من الشاي: الشاي الأخضر والشاي الأسود. حقائق عامة: تقلبات مزاج العميل شائعة جدًا.
|
||||
|
||||
بهذه المعلومات، سنحتاج إلى مراجعة دالة `getTea` من التحدي الأخير للتعامل مع مختلف طلبات الشاي. يمكننا تعديل `getTea` لقبول function كمعلمة (parameter) لتكون قادرة على تغيير نوع الشاي الذي تعيده. هذا يجعل `getTea` أكثر مرونة، ويعطي المبرمج المزيد من التحكم عندما يطلب العميل التغيير.
|
||||
بهذه المعلومات، سنحتاج إلى مراجعة دالة `getTea` من التحدي الأخير للتعامل مع مختلف طلبات الشاي. يمكنك تعديل `getTea` لقبول وظيفة (function) كوسيط (parameter) لتكون قادرة على تغيير نوع الشاي الذي تعيده. هذا يجعل `getTea` أكثر مرونة، ويعطي المبرمج المزيد من التحكم عندما يطلب العميل التغيير.
|
||||
|
||||
ولكن أولاً، دعونا نغطي بعض المصطلحات المتعلقة بالـ functions:
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ dashedName: use-the-reduce-method-to-analyze-data
|
||||
|
||||
الـ callback function تقبل اربعة arguments. وتعرف ال argument الأولى بأنها المجمع الذي يعين قيمة إرجاع الـ callback function من التكرار السابق، والـ argument الثاني هو العنصر الحالي الذي يجري معالجته، وال argument الثالث هو فهرس ذلك العنصر والرابع هو ال array التي يستدعي عليها `reduce`.
|
||||
|
||||
بالإضافة إلى الـ callback function فـ `reduce` لديه معلمة إضافية تأخذ قيمة أولية للمجمع. إذا لم يتم استخدام هذا المعامل الثاني، يتم تخطي التكرار الأول ويتم تمرير التكرار الثاني العنصر الأول من ال array كالمجمع.
|
||||
فضلاً على ذلك, لدي الوظيفة تعيد تفعيلها (callback function) المسمى `reduce` وسيط (parameter) إضافية التي تأخذ قيمة أولية للمجمع. إذا لم يتم استخدام هذا الوسيط الثاني، يتم تخطي التكرار الأول ويتم تمرير التكرار الثاني العنصر الأول من القائمة (array) كالمجمع.
|
||||
|
||||
انظر أدناه للحصول على مثال يستخدم `reduce` على مصفوفة `users` لإرجاع مجموع أعمار المستخدمين. ومن أجل البساطة، لا يستخدم المثال سوى ال arguments الأولى والثانية.
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ dashedName: smallest-common-multiple
|
||||
|
||||
# --description--
|
||||
|
||||
اعثر عن أصغر مضاعف مشترك للمعلمات المتوفرة والتي يمكن تقسيمها بالتساوي على كليهما ، وكذلك على جميع الأرقام المتسلسلة في النطاق بين هذه المعلمات.
|
||||
اعثر عن أصغر مضاعف مشترك للوسائط (parameters) المتوفرة التي يمكن تقسيمها بالتساوي على كليهما، وكذلك على جميع الأرقام المتسلسلة في النطاق بين هذه الوسائط.
|
||||
|
||||
سيكون النطاق عبارة عن مصفوفة من رقمين لن يكونا بالضرورة بالترتيب العددي.
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ swan.name = "Carlos";
|
||||
swan.color = "white";
|
||||
```
|
||||
|
||||
لنفترض أنك كنت تكتب برنامجاً لتعقب مئات أو حتى آلاف الطيور المختلفة في مطير. سوف يستغرق الأمر الكثير من الوقت لإنشاء كل الطيور، ثم تغيير الخصائص إلى قيم مختلفة لكل منها. من أجل إنشاء objects الـ `Bird` المختلفة بسهولة، يمكنك تصميم constructor الطيور الخاص بك بحيث يقبل الـ parameters:
|
||||
لنفترض أنك كنت تكتب برنامجاً لتعقب مئات أو حتى آلاف الطيور المختلفة في مطير. سوف يستغرق الأمر الكثير من الوقت لإنشاء كل الطيور، ثم تغيير الخصائص إلى قيم مختلفة لكل منها. من أجل إنشاء كائنات الـ `Bird` المختلفة بسهولة، يمكنك تصميم منشئك (constructor) مسمى Bird بحيث يقبل الوسائط (parameters):
|
||||
|
||||
```js
|
||||
function Bird(name, color) {
|
||||
@@ -38,7 +38,7 @@ cardinal.numLegs
|
||||
|
||||
# --instructions--
|
||||
|
||||
إنشاء constructor آخر باسم `Dog`. هذه المرة، اضبطه لأخذ حجج (Parameters) الآتية `name` و `color`، و اجعل الخاصية `numLegs` ثابتة عند 4. ثم قم بإنشاء `Dog` جديد محفوظ في متغير اسمه `terrier`. مرر اليه اثنان strings كـ arguments للخصائص `name` و `color`.
|
||||
إنشاء constructor آخر باسم `Dog`. هذه المرة، اضبطه لأخذ وسائط (Parameters) الآتية `name` و `color`، واجعل الخاصية `numLegs` ثابتة عند 4. ثم قم بإنشاء `Dog` جديد محفوظ في متغير اسمه `terrier`. مرر اليه اثنان strings كـ arguments للخصائص `name` و `color`.
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ function joinBirdFraternity(candidate) {
|
||||
|
||||
# --instructions--
|
||||
|
||||
اكتب دالة `joinDogFraternity` التي تأخذ معلمة `candidate` و باستخدام الـ `constructor` ،قم بإرجاع `true` إذا كان المرشح `Dog`، وإلا أرجع `false`.
|
||||
اكتب وظيفة `joinDogFraternity` التي تأخذ وسيط `candidate`, وتستخدم خاصية `constructor`, لتنتج `true` عندما يكون قيمة candidate تساوي `Dog`، وتنتح `false` عندما لا يكون كذلك.
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ dashedName: use-capture-groups-to-search-and-replace
|
||||
|
||||
البحث أمر مفيد. ومع ذلك ، يمكنك جعل البحث أكثر قوة عندما يغير أيضًا (أو يستبدل) النص الذي تطابقه.
|
||||
|
||||
يمكنك البحث عن النص واستبداله في سلسلة باستخدام `.replace()` على string. المدخلات لـ `.replace()` هي أولا نمط الـ regex الذي تريد البحث عنه. المعلمة الثانية هي الـ string الذي يحل محل المطابقة أو function للقيام بشيء ما.
|
||||
يمكنك البحث عن النص واستبداله في سلسلة باستخدام `.replace()` على string. المدخلات لـ `.replace()` هي أولا نمط الـ regex الذي تريد البحث عنه. إن الوسيط (parameter) الثاني مقطع نصي (string) الذي يحل محل المطابقة أو وظيفة (function) للقيام بشيء ما.
|
||||
|
||||
```js
|
||||
let wrongText = "The sky is silver.";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: bd7158d8c242eddfaeb5bd13
|
||||
title: ابن معرضا لأعمالك الخاصة
|
||||
title: ابني معرضا لأعمالك الخاصة (Personal Portfolio)
|
||||
challengeType: 14
|
||||
forumTopicId: 301143
|
||||
dashedName: build-a-personal-portfolio-webpage
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 587d78af367417b2b2512b04
|
||||
title: بناء صفحة هبوط لمنتج
|
||||
title: ابن صفحة لعرض لمنتج (Product Landing)
|
||||
challengeType: 14
|
||||
forumTopicId: 301144
|
||||
dashedName: build-a-product-landing-page
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 587d78af367417b2b2512b03
|
||||
title: بناء نموذج استطلاع رأي
|
||||
title: ابني نموذج استطلاع رأي (Survey Form)
|
||||
challengeType: 14
|
||||
forumTopicId: 301145
|
||||
dashedName: build-a-survey-form
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 587d78b0367417b2b2512b05
|
||||
title: مشروع بناء صفحة التوثيق التقني
|
||||
title: ابني صفحة التوثيق التقني (Technical Documentation)
|
||||
challengeType: 14
|
||||
forumTopicId: 301146
|
||||
dashedName: build-a-technical-documentation-page
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: bd7158d8c442eddfaeb5bd18
|
||||
title: بناء مشروع صفحة الثناء
|
||||
title: ابن مشروع صفحة الثناء (Tribute Page)
|
||||
challengeType: 14
|
||||
forumTopicId: 301147
|
||||
dashedName: build-a-tribute-page
|
||||
@@ -8,7 +8,7 @@ dashedName: build-a-tribute-page
|
||||
|
||||
# --description--
|
||||
|
||||
**Objective:** قم ببناء تطبيق يشبه وظيفيا إلى <a href="https://tribute-page.freecodecamp.rocks" target="_blank" rel="noopener noreferrer nofollow">https://tribute-page.freecodecamp.rocks</a>
|
||||
**Objective:** ابني تطبيق يشابه وظيفيا إلي <a href="https://tribute-page.freecodecamp.rocks" target="_blank" rel="noopener noreferrer nofollow">https://tribute-page.freecodecamp.rocks</a>
|
||||
|
||||
**المتطلبات:**
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ dashedName: step-3
|
||||
|
||||
يتم استخدام عنصر `p` لإنشاء فقرة من النصوص على مواقع الويب. قم بإنشاء عنصر `p` تحت عنصر `h2` الخاص بك وقم بإعطائه النص التالي:
|
||||
|
||||
`Click here to view more cat photos.`
|
||||
`See more cat photos in our gallery.`
|
||||
|
||||
# --hints--
|
||||
|
||||
@@ -25,13 +25,13 @@ assert(document.querySelector('p'));
|
||||
assert(code.match(/<\/p\>/));
|
||||
```
|
||||
|
||||
يجب أن يكون نص العنصر الخاص بك `p` هو `Click here to view more cat photos.` إما أنك حذفت النص أو لديك خطأ إملائي.
|
||||
Your `p` element's text should be `See more cat photos in our gallery.` إما أنك حذفت النص أو لديك خطأ إملائي.
|
||||
|
||||
```js
|
||||
const extraSpacesRemoved = document
|
||||
.querySelector('p')
|
||||
.innerText.replace(/\s+/g, ' ');
|
||||
assert(extraSpacesRemoved.match(/click here to view more cat photos\.?$/i));
|
||||
assert(extraSpacesRemoved.match(/see more cat photos in our gallery\.?$/i));
|
||||
```
|
||||
|
||||
يجب أن يكون عنصر `p` الخاص بك تحت عنصر `h2`. لقد وضعتهم بترتيب خاطئ.
|
||||
|
||||
@@ -47,7 +47,7 @@ assert(
|
||||
code
|
||||
.replace(/\s/g, '')
|
||||
.match(
|
||||
/<!--todo:addlinktocatphotos--><p>clickheretoviewmorecatphotos\.?<\/p>/i
|
||||
/<!--todo:addlinktocatphotos--><p>seemorecatphotosinourgallery\.?<\/p>/i
|
||||
)
|
||||
);
|
||||
```
|
||||
@@ -63,7 +63,7 @@ assert(
|
||||
<h2>Cat Photos</h2>
|
||||
--fcc-editable-region--
|
||||
|
||||
<p>Click here to view more cat photos.</p>
|
||||
<p>See more cat photos in our gallery.</p>
|
||||
|
||||
--fcc-editable-region--
|
||||
</body>
|
||||
|
||||
@@ -48,7 +48,7 @@ const mainNode = document.querySelector('main');
|
||||
const pNode = document.querySelector('p');
|
||||
assert(
|
||||
mainNode.contains(pNode) &&
|
||||
pNode.textContent.toLowerCase().match(/click here to view more cat photos/)
|
||||
pNode.textContent.toLowerCase().match(/see more cat photos in our gallery/)
|
||||
);
|
||||
```
|
||||
|
||||
@@ -64,7 +64,7 @@ assert(
|
||||
<h1>CatPhotoApp</h1>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more cat photos.</p>
|
||||
<p>See more cat photos in our gallery.</p>
|
||||
|
||||
--fcc-editable-region--
|
||||
</body>
|
||||
|
||||
@@ -65,14 +65,14 @@ assert(
|
||||
assert(document.querySelector('p'));
|
||||
```
|
||||
|
||||
نص عنصر `p` يجب أن يكون `Click here to view more cat photos.` لا تقم بتغيير النص أو المسافات أو علامات الترقيم لعنصر `p`.
|
||||
The text of the `p` element should be `See more cat photos in our gallery.` لا تقم بتغيير النص أو المسافات أو علامات الترقيم لعنصر `p`.
|
||||
|
||||
```js
|
||||
assert(
|
||||
document
|
||||
.querySelector('p')
|
||||
.innerText.toLowerCase()
|
||||
.match(/click\s+here\s+to\s+view\s+more\s+cat\s+photos\.?$/)
|
||||
.match(/see\s+more\s+cat\s+photos\s+in\s+our\s+gallery\.?$/)
|
||||
);
|
||||
```
|
||||
|
||||
@@ -94,7 +94,7 @@ assert(code.toLowerCase().match(/-->\s*\n\s{6}<p>/));
|
||||
<h1>CatPhotoApp</h1>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more cat photos.</p>
|
||||
<p>See more cat photos in our gallery.</p>
|
||||
</main>
|
||||
--fcc-editable-region--
|
||||
</body>
|
||||
|
||||
@@ -52,7 +52,7 @@ assert(collection.indexOf('P') < collection.indexOf('IMG'));
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
--fcc-editable-region--
|
||||
<p>Click here to view more cat photos.</p>
|
||||
<p>See more cat photos in our gallery.</p>
|
||||
|
||||
--fcc-editable-region--
|
||||
</main>
|
||||
|
||||
@@ -50,7 +50,7 @@ assert(!/\<img\s+src\s*=\s*https:\/\/cdn\.freecodecamp\.org\/curriculum\/cat-pho
|
||||
<h1>CatPhotoApp</h1>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more cat photos.</p>
|
||||
<p>See more cat photos in our gallery.</p>
|
||||
--fcc-editable-region--
|
||||
<img>
|
||||
--fcc-editable-region--
|
||||
|
||||
@@ -48,7 +48,7 @@ assert(altText.match(/A cute orange cat lying on its back\.?$/i));
|
||||
<h1>CatPhotoApp</h1>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more cat photos.</p>
|
||||
<p>See more cat photos in our gallery.</p>
|
||||
--fcc-editable-region--
|
||||
<img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg">
|
||||
--fcc-editable-region--
|
||||
|
||||
@@ -69,7 +69,7 @@ assert(
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
--fcc-editable-region--
|
||||
<p>Click here to view more cat photos.</p>
|
||||
<p>See more cat photos in our gallery.</p>
|
||||
|
||||
--fcc-editable-region--
|
||||
<img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back.">
|
||||
|
||||
@@ -45,7 +45,7 @@ assert(
|
||||
<h1>CatPhotoApp</h1>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more cat photos.</p>
|
||||
<p>See more cat photos in our gallery.</p>
|
||||
--fcc-editable-region--
|
||||
<a href="https://freecatphotoapp.com"></a>
|
||||
--fcc-editable-region--
|
||||
|
||||
@@ -38,14 +38,14 @@ assert(
|
||||
);
|
||||
```
|
||||
|
||||
بعد دمج عنصر الرابط (`a`)، محتوى العنصر `p` الوحيد المرئي في المتصفح يجب أن يكون `Click here to view more cat photos.` تحقق مرتين من النص أو المسافات أو علامات الترقيم لكل من `p` وعنصر الرابط المدمج.
|
||||
After nesting the anchor (`a`) element, the only `p` element content visible in the browser should be `See more cat photos in our gallery.` Double check the text, spacing, or punctuation of both the `p` and nested anchor element.
|
||||
|
||||
```js
|
||||
const pText = document
|
||||
.querySelector('p')
|
||||
.innerText.toLowerCase()
|
||||
.replace(/\s+/g, ' ');
|
||||
assert(pText.match(/click here to view more cat photos\.?$/));
|
||||
assert(pText.match(/see more cat photos in our gallery\.?$/));
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@@ -60,7 +60,7 @@ assert(pText.match(/click here to view more cat photos\.?$/));
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
--fcc-editable-region--
|
||||
<p>Click here to view more cat photos.</p>
|
||||
<p>See more cat photos in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com">link to cat pictures</a>
|
||||
--fcc-editable-region--
|
||||
<img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back.">
|
||||
|
||||
@@ -45,7 +45,7 @@ assert(document.querySelector('a').getAttribute('target') === '_blank');
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
--fcc-editable-region--
|
||||
<p>Click here to view more <a href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
--fcc-editable-region--
|
||||
<img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back.">
|
||||
</main>
|
||||
|
||||
@@ -77,7 +77,7 @@ assert(document.querySelector('img').parentNode.nodeName === 'A');
|
||||
<h1>CatPhotoApp</h1>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
--fcc-editable-region--
|
||||
<img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back.">
|
||||
--fcc-editable-region--
|
||||
|
||||
@@ -61,7 +61,7 @@ assert(
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
--fcc-editable-region--
|
||||
|
||||
@@ -69,7 +69,7 @@ assert(
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
--fcc-editable-region--
|
||||
|
||||
@@ -42,7 +42,7 @@ assert(secondSectionLastElemNode.nodeName === 'UL');
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -61,7 +61,7 @@ assert(
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -73,7 +73,7 @@ assert(!/\<img\s+.+\s+src\s*=\s*https:\/\/cdn\.freecodecamp\.org\/curriculum\/ca
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -53,7 +53,7 @@ assert(
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -74,7 +74,7 @@ assert(
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -60,7 +60,7 @@ assert(
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -56,7 +56,7 @@ assert(
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -67,7 +67,7 @@ assert.deepStrictEqual(
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -41,7 +41,7 @@ assert($('main > section')[1].lastElementChild.nodeName === 'FIGURE');
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -61,7 +61,7 @@ assert(
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -68,7 +68,7 @@ assert(
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -50,7 +50,7 @@ assert($('form')[0].innerHTML.trim().length === 0);
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -76,7 +76,7 @@ assert(
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -69,7 +69,7 @@ assert(
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -63,7 +63,7 @@ assert(!/\<\s*input\s+placeholder\s*=\s*cat\s+photo\s+url/i.test(code));
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -52,7 +52,7 @@ assert(collection.indexOf('INPUT') < collection.indexOf('BUTTON'));
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -50,7 +50,7 @@ assert($('input')[0].getAttribute('required') === '');
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -105,7 +105,7 @@ assert(
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -61,7 +61,7 @@ assert(
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -62,7 +62,7 @@ assert(
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
<section>
|
||||
<h2>Cat Lists</h2>
|
||||
|
||||
@@ -52,7 +52,7 @@ assert($('input')[0].id.match(/^indoor$/));
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -58,7 +58,7 @@ assert(
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -80,7 +80,7 @@ assert(
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -71,7 +71,7 @@ assert(
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -64,7 +64,7 @@ assert(!$('input[type="checkbox"]')[2].hasAttribute('checked'));
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -49,7 +49,7 @@ assert(document.querySelector('main').nextElementSibling.nodeName === 'FOOTER');
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -49,7 +49,7 @@ assert(extraSpacesRemoved.match(/No Copyright - freeCodeCamp\.org$/i));
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -60,7 +60,7 @@ assert(pText.match(/^no copyright - freecodecamp.org$/));
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -53,7 +53,7 @@ assert(noSpaces.match(/\<\/head\>\<body\>/));
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -57,7 +57,7 @@ assert(document.title && document.title.toLowerCase() === 'catphotoapp');
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -49,7 +49,7 @@ assert(code.match(/<html\s+lang\s*=\s*('|")en\1\s*>/gi));
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -44,7 +44,7 @@ assert(noSpaces.match(/^\<\!DOCTYPEhtml\>\<html/));
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -66,7 +66,7 @@ assert(!/\<img\s+.+\s+src\s*=\s*https:\/\/cdn\.freecodecamp\.org\/curriculum\/ca
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -65,7 +65,7 @@ assert(
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -89,7 +89,7 @@ assert(
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -63,7 +63,7 @@ assert(!/\<input\s+type\s*=\s*text/.test(code));
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -59,7 +59,7 @@ assert(!/\<\s*button\s+type\s*=\s*submit/i.test(code));
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -85,7 +85,7 @@ assert(labelElem.textContent.replace(/\s/g, '').match(/Loving/i));
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -47,7 +47,7 @@ assert(
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -35,7 +35,7 @@ assert($('input[type="checkbox"]')[0].id.match(/^loving$/));
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -72,7 +72,7 @@ assert(
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -93,7 +93,7 @@ assert(code.match(/<\/label>\s*<label\s*>\s*<input [^>]+>\s*Outdoor/i));
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -62,7 +62,7 @@ assert.isFalse(includesH1);
|
||||
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
|
||||
</main>
|
||||
|
||||
@@ -70,7 +70,7 @@ assert(foundElems.length === 2);
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ assert($('main > section')[2].children.length === 0);
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
--fcc-editable-region--
|
||||
|
||||
@@ -59,7 +59,7 @@ assert(extraSpacesRemoved.match(/Is your cat an indoor or outdoor cat\??$/i));
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -81,7 +81,7 @@ assert(fieldsetChildren[0].length > fieldsetChildren[1].length);
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
@@ -65,7 +65,7 @@ assert(
|
||||
<section>
|
||||
<h2>Cat Photos</h2>
|
||||
<!-- TODO: Add link to cat photos -->
|
||||
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
|
||||
<p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
|
||||
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
</section>
|
||||
<section>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user