* 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.3 KiB
1.3 KiB
id, title, challengeType, videoUrl, forumTopicId, dashedName
id | title | challengeType | videoUrl | forumTopicId | dashedName |
---|---|---|---|---|---|
56533eb9ac21ba0edf2244a8 | Storing Values with the Assignment Operator | 1 | https://scrimba.com/c/cEanysE | 18310 | storing-values-with-the-assignment-operator |
--description--
In JavaScript, you can store a value in a variable with the assignment operator (=
).
myVariable = 5;
This assigns the Number
value 5
to myVariable
.
If there are any calculations to the right of the =
operator, those are performed before the value is assigned to the variable on the left of the operator.
var myVar;
myVar = 5;
First, this code creates a variable named myVar
. Then, the code assigns 5
to myVar
. Now, if myVar
appears again in the code, the program will treat it as if it is 5
.
--instructions--
Assign the value 7
to variable a
.
--hints--
You should not change code above the specified comment.
assert(/var a;/.test(code));
a
should have a value of 7.
assert(typeof a === 'number' && a === 7);
--seed--
--before-user-code--
if (typeof a != 'undefined') {
a = undefined;
}
--after-user-code--
(function(a){return "a = " + a;})(a);
--seed-contents--
// Setup
var a;
// Only change code below this line
--solutions--
var a;
a = 7;