diff --git a/seed/challenges/basic-javascript.json b/seed/challenges/basic-javascript.json
index 5a6875548a..d4288164fb 100644
--- a/seed/challenges/basic-javascript.json
+++ b/seed/challenges/basic-javascript.json
@@ -452,7 +452,7 @@
"Let's now go create a nested array called myArray
."
],
"tests":[
- "assert((function(){if(typeof(myArray) !== \"undefined\" && typeof(myArray) === \"object\" && typeof(myArray[0]) !== \"undefined\" && typeof(myArray[0]) === \"object\" && editor.getValue().match(/\\[\\s?\\[/g).length >= 1 && editor.getValue().match(/\\]\\s?\\]/g).length >= 1){return(true);}else{return(false);}})(), 'myArray should contain at least one array');"
+ "assert(Array.isArray(myArray) && myArray.some(Array.isArray), 'myArray
should have at least one array nested within another array.');"
],
"challengeSeed":[
"var ourArray = [[\"the universe\", \"everything\", 42]];",
@@ -998,8 +998,9 @@
"the
is the pattern we want to match.",
"+
means we want to find one or more occurrences of this pattern.",
"g
means that we want to search the entire string for this pattern.",
- "i
means that we want to ignoring the case (uppercase or lowercase) when searching for the pattern.",
- "Let's try counting the number of times the word and
occurs in the string John and Alan went to the shop and got some milk
. We can do this by replacing the .+
part of our regular expression with the current regular expression
with the word and
."
+ "i
means that we want to ignore the case (uppercase or lowercase) when searching for the pattern.",
+ "Regular expressions
are usually surrounded by /
symbols.",
+ "Let's try selecting all the occurances of the word and
in the string George Boole and Alan Turing went to the shop and got some milk
. We can do this by replacing the .+
part of our regular expression with the current regular expression
with the word and
."
],
"tests":[
"assert(test==2, 'Your regular expression
should find two occurrences of the word and
');",
@@ -1007,15 +1008,15 @@
],
"challengeSeed":[
"var test = (function() {",
- " var testString = \"John and Alan went to the shop and got some milk\";",
+ " var testString = \"George Boole and Alan Turing went to the shop and got some milk\";",
" var expressionToGetMilk = /milk/gi;",
" // Only change code below this line.",
"",
" var expression = /.+/gi;",
"",
- "// Only change code above this line.",
- "// We use this function to show you the value of your variable in your output box.",
- " return(testString.match(expression).length);",
+ " // Only change code above this line.",
+ " // We use this function to show you the value of your variable in your output box.",
+ " return(testString.match(expression).length);",
"})();(function(){return(test);})();"
],
"type": "waypoint",
@@ -1028,7 +1029,8 @@
"description":[
"We can use special selectors in Regular Expressions
to select a particular type of value.",
"One such selector is the digit selector \\d
which is used to grab the numbers in a string.",
- "It is used like this: /\\d+/g
"
+ "It is used like this: /\\d+/g
.",
+ "Use the \\d
selector to select the number of numbers in the string."
],
"tests":[
"assert(test === 2, 'Your RegEx should have found two numbers in the testString');",
@@ -1036,15 +1038,15 @@
],
"challengeSeed":[
"var test = (function() {",
- " var testString = \"There's 3 cats but 4 dogs.\"",
+ " var testString = \"There's 3 cats but 4 dogs.\";",
"",
" // Only change code below this line.",
"",
" var expression = /.+/gi;",
"",
- "// Only change code above this line.",
- "// We use this function to show you the value of your variable in your output box.",
- " return(testString.match(expression).length);",
+ " // Only change code above this line.",
+ " // We use this function to show you the value of your variable in your output box.",
+ " return(testString.match(expression).length);",
"})();(function(){return(test);})();"
],
"type": "waypoint",