mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-01-15 06:07:34 -05:00
1.5 KiB
1.5 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--
Ви можете легко decrement або зменшити змінну на одиницю за допомогою оператора --.
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.*?;?/));
You should not assign myVar with 10.
assert(!code.match(/myVar\s*=\s*10.*?;?/));
You should use the -- operator on 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--;