mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-12 19:00:43 -04:00
1.5 KiB
1.5 KiB
id, title, challengeType, videoUrl, forumTopicId, dashedName
| id | title | challengeType | videoUrl | forumTopicId | dashedName |
|---|---|---|---|---|---|
| 56533eb9ac21ba0edf2244ac | زيادة رَقْم باستخدام JavaScript | 1 | https://scrimba.com/c/ca8GLT9 | 18201 | increment-a-number-with-javascript |
--description--
يمكنك بسهولة زيادة أو إضافة واحد إلى متغير مع مشغل ++.
i++;
هو ما يعادل
i = i + 1;
ملاحظة: السطر بالأكمل يصبح i++;، مما يزيل الحاجة إلى علامة المساواة (equal sign).
--instructions--
غيّر الكود لاستخدام المشغل ++ على المتغير myVar.
--hints--
يجب أن يساوي myVar قيمة 88.
assert(myVar === 88);
لا يجب عليك استخدام مشغل التعيين.
assert(
/let\s*myVar\s*=\s*87;\s*\/*.*\s*([+]{2}\s*myVar|myVar\s*[+]{2})/.test(__helpers.removeJSComments(code))
);
يجب عليك استخدام المشغل ++.
assert(/[+]{2}\s*myVar|myVar\s*[+]{2}/.test(__helpers.removeJSComments(code)));
لا يجب عليك تعديل الكود فوق التعليق المحدد.
assert(/let myVar = 87;/.test(__helpers.removeJSComments(code)));
--seed--
--after-user-code--
(function(z){return 'myVar = ' + z;})(myVar);
--seed-contents--
let myVar = 87;
// Only change code below this line
myVar = myVar + 1;
--solutions--
let myVar = 87;
myVar++;