* 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 |
---|---|---|---|---|---|
bd7993c9c69feddfaeb8bdef | Store Multiple Values in one Variable using JavaScript Arrays | 1 | https://scrimba.com/c/crZQWAm | 18309 | store-multiple-values-in-one-variable-using-javascript-arrays |
--description--
With JavaScript array
variables, we can store several pieces of data in one place.
You start an array declaration with an opening square bracket, end it with a closing square bracket, and put a comma between each entry, like this:
var sandwich = ["peanut butter", "jelly", "bread"]
.
--instructions--
Modify the new array myArray
so that it contains both a string
and a number
(in that order).
Hint
Refer to the example code in the text editor if you get stuck.
--hints--
myArray
should be an array
.
assert(typeof myArray == 'object');
The first item in myArray
should be a string
.
assert(typeof myArray[0] !== 'undefined' && typeof myArray[0] == 'string');
The second item in myArray
should be a number
.
assert(typeof myArray[1] !== 'undefined' && typeof myArray[1] == 'number');
--seed--
--after-user-code--
(function(z){return z;})(myArray);
--seed-contents--
// Only change code below this line
var myArray = [];
--solutions--
var myArray = ["The Answer", 42];