* feat(tools): add seed/solution restore script * chore(curriculum): remove empty sections' markers * chore(curriculum): add seed + solution to Chinese * chore: remove old formatter * fix: update getChallenges parse translated challenges separately, without reference to the source * chore(curriculum): add dashedName to English * chore(curriculum): add dashedName to Chinese * refactor: remove unused challenge property 'name' * fix: relax dashedName requirement * fix: stray tag Remove stray `pre` tag from challenge file. Signed-off-by: nhcarrigan <nhcarrigan@gmail.com> Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
1.2 KiB
1.2 KiB
id, title, challengeType, videoUrl, forumTopicId, dashedName
id | title | challengeType | videoUrl | forumTopicId | dashedName |
---|---|---|---|---|---|
56533eb9ac21ba0edf2244ac | Increment a Number with JavaScript | 1 | https://scrimba.com/c/ca8GLT9 | 18201 | increment-a-number-with-javascript |
--description--
You can easily increment or add one to a variable with the ++
operator.
i++;
is the equivalent of
i = i + 1;
Note
The entire line becomes i++;
, eliminating the need for the equal sign.
--instructions--
Change the code to use the ++
operator on myVar
.
--hints--
myVar
should equal 88
.
assert(myVar === 88);
You should not use the assignment operator.
assert(
/var\s*myVar\s*=\s*87;\s*\/*.*\s*([+]{2}\s*myVar|myVar\s*[+]{2});/.test(code)
);
You should use the ++
operator.
assert(/[+]{2}\s*myVar|myVar\s*[+]{2}/.test(code));
You should not change code above the specified comment.
assert(/var myVar = 87;/.test(code));
--seed--
--after-user-code--
(function(z){return 'myVar = ' + z;})(myVar);
--seed-contents--
var myVar = 87;
// Only change code below this line
myVar = myVar + 1;
--solutions--
var myVar = 87;
myVar++;