mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-30 21:03:58 -05:00
1.4 KiB
1.4 KiB
id, title, challengeType, videoUrl, forumTopicId, dashedName
| id | title | challengeType | videoUrl | forumTopicId | dashedName |
|---|---|---|---|---|---|
| 56533eb9ac21ba0edf2244ad | إنقاص رَقَم باستخدام JavaScript | 1 | https://scrimba.com/c/cM2KeS2 | 17558 | decrement-a-number-with-javascript |
--description--
يمكنك بسهولة أنقاص أو تقليل متغير بواحد باستخدام المشغل --.
i--;
هو ما يعادل
i = i - 1;
ملاحظة: السطر بكامله يصبح i--;، مما يزيل الحاجة إلى علامة المساواة.
--instructions--
غير الكود لاستخدام المشغل -- على myVar.
--hints--
يجب أن يساوي myVar قيمة 10.
assert(myVar === 10);
يجب تغيير myVar = myVar - 1;.
assert(!code.match(/myVar\s*=\s*myVar\s*[-]\s*1.*?;?/));
لا يجب عليك تعيين myVar بقيمة 10.
assert(!code.match(/myVar\s*=\s*10.*?;?/));
يجب عليك استخدام المشغل -- على myVar.
assert(/[-]{2}\s*myVar|myVar\s*[-]{2}/.test(code));
لا يجب عليك تعديل الكود فوق التعليق المحدد.
assert(/let myVar = 11;/.test(code));
--seed--
--after-user-code--
(function(z){return 'myVar = ' + z;})(myVar);
--seed-contents--
let myVar = 11;
// Only change code below this line
myVar = myVar - 1;
--solutions--
let myVar = 11;
myVar--;