mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-31 06:01:50 -05:00
1.4 KiB
1.4 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(code)
);
يجب عليك استخدام المشغل ++.
assert(/[+]{2}\s*myVar|myVar\s*[+]{2}/.test(code));
لا يجب عليك تعديل الكود فوق التعليق المحدد.
assert(/let myVar = 87;/.test(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++;