diff --git a/challenges/automated-testing-and-debugging.json b/challenges/automated-testing-and-debugging.json
index 0c7304045b..5e1fb9602a 100644
--- a/challenges/automated-testing-and-debugging.json
+++ b/challenges/automated-testing-and-debugging.json
@@ -32,10 +32,10 @@
"You can use typeof
to check the data structure
, or type, of a variable.",
"Note that in JavaScript, arrays are technically a type of object.",
"Try using typeof
on each of the following to see which types they have.",
- "console.log(typeof(\"\"));
",
- "console.log(typeof(0));
",
- "console.log(typeof([]));
",
- "console.log(typeof({}));
"
+ "console.log(typeof \"\");
",
+ "console.log(typeof 0);
",
+ "console.log(typeof []);
",
+ "console.log(typeof {});
"
],
"tests":[
"assert(editor.getValue().match(/console\\.log\\(typeof\\(\"\"\\)\\);/gi), 'message: You should console.log
the typeof
a string.');",
diff --git a/challenges/basic-bonfires.json b/challenges/basic-bonfires.json
index abffefc548..ad763cbf71 100644
--- a/challenges/basic-bonfires.json
+++ b/challenges/basic-bonfires.json
@@ -13,7 +13,7 @@
"Make this function return true no matter what."
],
"tests": [
- "assert(typeof(meetBonfire()) === \"boolean\", 'message: meetBonfire()
should return a boolean value.');",
+ "assert(typeof meetBonfire() === \"boolean\", 'message: meetBonfire()
should return a boolean value.');",
"assert(meetBonfire() === true, 'message: meetBonfire()
should return true.');"
],
"challengeSeed": [
@@ -53,7 +53,7 @@
"id": "a202eed8fc186c8434cb6d61",
"title": "Reverse a String",
"tests": [
- "assert(typeof(reverseString(\"hello\")) === \"string\", 'message: reverseString()
should return a string.');",
+ "assert(typeof reverseString(\"hello\") === \"string\", 'message: reverseString()
should return a string.');",
"assert(reverseString(\"hello\") === \"olleh\", 'message: reverseString(\"hello\")
should become \"olleh\"
.');",
"assert(reverseString(\"Howdy\") === \"ydwoH\", 'message: reverseString(\"Howdy\")
should become \"ydwoH\"
.');",
"assert(reverseString(\"Greetings from Earth\") === \"htraE morf sgniteerG\", 'message: reverseString(\"Greetings from Earth\")
should return \"htraE morf sgniteerG\"
.');"
@@ -102,7 +102,7 @@
"id": "a302f7aae1aa3152a5b413bc",
"title": "Factorialize a Number",
"tests": [
- "assert(typeof(factorialize(5)) === \"number\", 'message: factorialize()
should return a number.');",
+ "assert(typeof factorialize(5) === \"number\", 'message: factorialize()
should return a number.');",
"assert(factorialize(5) === 120, 'message: factorialize(5)
should return 120.');",
"assert(factorialize(10) === 3628800, 'message: factorialize(10)
should return 3628800.');",
"assert(factorialize(20) === 2432902008176640000, 'message: factorialize(20)
should return 2432902008176640000.');",
@@ -158,7 +158,7 @@
"Remember to use Read-Search-Ask if you get stuck. Write your own code."
],
"tests": [
- "assert(typeof(palindrome(\"eye\")) === \"boolean\", 'message: palindrome()
should return a boolean.');",
+ "assert(typeof palindrome(\"eye\") === \"boolean\", 'message: palindrome()
should return a boolean.');",
"assert(palindrome(\"eye\") === true, 'message: palindrome(\"eye\")
should return true.');",
"assert(palindrome(\"race car\") === true, 'message: palindrome(\"race car\")
should return true.');",
"assert(palindrome(\"not a palindrome\") === false, 'message: palindrome(\"not a palindrome\")
should return false.');",
@@ -222,7 +222,7 @@
"findLongestWord(\"The quick brown fox jumped over the lazy dog\");"
],
"tests": [
- "assert(typeof(findLongestWord(\"The quick brown fox jumped over the lazy dog\")) === \"number\", 'message: findLongestWord()
should return a number.');",
+ "assert(typeof findLongestWord(\"The quick brown fox jumped over the lazy dog\") === \"number\", 'message: findLongestWord()
should return a number.');",
"assert(findLongestWord(\"The quick brown fox jumped over the lazy dog\") === 6, 'message: findLongestWord(\"The quick brown fox jumped over the lazy dog\")
should return 6.');",
"assert(findLongestWord(\"May the force be with you\") === 5, 'message: findLongestWord(\"May the force be with you\")
should return 5.');",
"assert(findLongestWord(\"Google do a barrel roll\") === 6, 'message: findLongestWord(\"Google do a barrel roll\")
should return 6.');",
@@ -269,7 +269,7 @@
"titleCase(\"I'm a little tea pot\");"
],
"tests": [
- "assert(typeof(titleCase(\"I'm a little tea pot\")) === \"string\", 'message: titleCase()
should return a string.');",
+ "assert(typeof titleCase(\"I'm a little tea pot\") === \"string\", 'message: titleCase()
should return a string.');",
"assert(titleCase(\"I'm a little tea pot\") === \"I'm A Little Tea Pot\", 'message: titleCase(\"I'm a little tea pot\")
should return \"I'm A Little Tea Pot\".');",
"assert(titleCase(\"sHoRt AnD sToUt\") === \"Short And Stout\", 'message: titleCase(\"sHoRt AnD sToUt\")
should return \"Short And Stout\".');",
"assert(titleCase(\"HERE IS MY HANDLE HERE IS MY SPOUT\") === \"Here Is My Handle Here Is My Spout\", 'message: titleCase(\"HERE IS MY HANDLE HERE IS MY SPOUT\")
should return \"Here Is My Handle Here Is My Spout\".');"
diff --git a/challenges/basic-javascript.json b/challenges/basic-javascript.json
index e820eaf384..0247de2a6f 100644
--- a/challenges/basic-javascript.json
+++ b/challenges/basic-javascript.json
@@ -33,7 +33,7 @@
"Let's modify our welcomeToBooleans
function so that it will return true
instead of false
when the run button is clicked."
],
"tests": [
- "assert(typeof(welcomeToBooleans()) === 'boolean', 'message: The welcomeToBooleans()
function should return a boolean (true/false) value.');",
+ "assert(typeof welcomeToBooleans() === 'boolean', 'message: The welcomeToBooleans()
function should return a boolean (true/false) value.');",
"assert(welcomeToBooleans() === true, 'message: welcomeToBooleans()
should return true.');"
],
"challengeSeed": [
@@ -63,7 +63,7 @@
"Look at the ourName
example if you get stuck."
],
"tests": [
- "assert((function(){if(typeof(myName) !== \"undefined\" && typeof(myName) === \"string\" && myName.length > 0){return true;}else{return false;}})(), 'message: myName
should be a string that contains at least one character in it.');"
+ "assert((function(){if(typeof myName !== \"undefined\" && typeof myName === \"string\" && myName.length > 0){return true;}else{return false;}})(), 'message: myName
should be a string that contains at least one character in it.');"
],
"challengeSeed": [
"var ourName = \"Free Code Camp\";",
@@ -71,7 +71,7 @@
""
],
"tail": [
- "if(typeof(myName) !== \"undefined\"){(function(v){return v;})(myName);}"
+ "if(typeof myName !== \"undefined\"){(function(v){return v;})(myName);}"
],
"type": "waypoint",
"challengeType": 1
@@ -84,8 +84,8 @@
"Now let's create two new string variables: myFirstName
and myLastName
and assign them the values of your first and last name, respectively."
],
"tests": [
- "assert((function(){if(typeof(myFirstName) !== \"undefined\" && typeof(myFirstName) === \"string\" && myFirstName.length > 0){return true;}else{return false;}})(), 'message: myFirstName
should be a string with at least one character in it.');",
- "assert((function(){if(typeof(myLastName) !== \"undefined\" && typeof(myLastName) === \"string\" && myLastName.length > 0){return true;}else{return false;}})(), 'message: myLastName
should be a string with at least one character in it.');"
+ "assert((function(){if(typeof myFirstName !== \"undefined\" && typeof myFirstName === \"string\" && myFirstName.length > 0){return true;}else{return false;}})(), 'message: myFirstName
should be a string with at least one character in it.');",
+ "assert((function(){if(typeof myLastName !== \"undefined\" && typeof myLastName === \"string\" && myLastName.length > 0){return true;}else{return false;}})(), 'message: myLastName
should be a string with at least one character in it.');"
],
"challengeSeed": [
"var firstName = \"Alan\";",
@@ -94,7 +94,7 @@
"",
"// Only change code above this line.",
"",
- "if(typeof(myFirstName) !== \"undefined\" && typeof(myLastName) !== \"undefined\"){(function(){return myFirstName + ', ' + myLastName;})();}"
+ "if(typeof myFirstName !== \"undefined\" && typeof myLastName !== \"undefined\"){(function(){return myFirstName + ', ' + myLastName;})();}"
],
"type": "waypoint",
"challengeType": 1
@@ -108,7 +108,7 @@
"Use the .length
property to count the number of characters in the lastName
variable."
],
"tests": [
- "assert((function(){if(typeof(lastNameLength) !== \"undefined\" && typeof(lastNameLength) === \"number\" && lastNameLength === 8){return true;}else{return false;}})(), 'message: lastNameLength
should be equal to eight.');",
+ "assert((function(){if(typeof lastNameLength !== \"undefined\" && typeof lastNameLength === \"number\" && lastNameLength === 8){return true;}else{return false;}})(), 'message: lastNameLength
should be equal to eight.');",
"assert((function(){if(editor.getValue().match(/\\.length/gi) && editor.getValue().match(/\\.length/gi).length >= 2 && editor.getValue().match(/var lastNameLength \\= 0;/gi) && editor.getValue().match(/var lastNameLength \\= 0;/gi).length >= 1){return true;}else{return false;}})(), 'message: You should be getting the length of lastName
by using .length
like this: lastName.length
.');"
],
"challengeSeed": [
@@ -128,7 +128,7 @@
"",
"// Only change code above this line.",
"",
- "if(typeof(lastNameLength) !== \"undefined\"){(function(){return lastNameLength;})();}"
+ "if(typeof lastNameLength !== \"undefined\"){(function(){return lastNameLength;})();}"
],
"type": "waypoint",
"challengeType": 1
@@ -144,7 +144,7 @@
"Try looking at the firstLetterOfFirstName
variable declaration if you get stuck."
],
"tests": [
- "assert((function(){if(typeof(firstLetterOfLastName) !== \"undefined\" && editor.getValue().match(/\\[0\\]/gi) && typeof(firstLetterOfLastName) === \"string\" && firstLetterOfLastName === \"L\"){return true;}else{return false;}})(), 'message: The firstLetterOfLastName
variable should have the value of L
.');"
+ "assert((function(){if(typeof firstLetterOfLastName !== \"undefined\" && editor.getValue().match(/\\[0\\]/gi) && typeof firstLetterOfLastName === \"string\" && firstLetterOfLastName === \"L\"){return true;}else{return false;}})(), 'message: The firstLetterOfLastName
variable should have the value of L
.');"
],
"challengeSeed": [
"var firstLetterOfFirstName = \"\";",
@@ -347,7 +347,7 @@
"Let's create a variable myDecimal
and give it a decimal value."
],
"tests": [
- "assert((function(){if(typeof(myDecimal) !== \"undefined\" && typeof(myDecimal) === \"number\" && editor.getValue().match(/\\./g).length >=2){return true;}else{return false;}})(), 'message: myDecimal
should be a decimal point number.');"
+ "assert((function(){if(typeof myDecimal !== \"undefined\" && typeof myDecimal === \"number\" && editor.getValue().match(/\\./g).length >=2){return true;}else{return false;}})(), 'message: myDecimal
should be a decimal point number.');"
],
"challengeSeed": [
"var ourDecimal = 5.7;",
@@ -355,7 +355,7 @@
"",
"// Only change code above this line.",
"",
- "(function(){if(typeof(myDecimal) !== \"undefined\"){return myDecimal;}})();"
+ "(function(){if(typeof myDecimal !== \"undefined\"){return myDecimal;}})();"
],
"type": "waypoint",
"challengeType": 1
@@ -413,9 +413,9 @@
"Refer to the commented code in the text editor if you get stuck."
],
"tests": [
- "assert(typeof(myArray) == 'object', 'message: myArray
should be an array
.');",
- "assert(typeof(myArray[0]) !== 'undefined' && typeof(myArray[0]) == 'string', 'message: The first item in myArray
should be a string
.');",
- "assert(typeof(myArray[1]) !== 'undefined' && typeof(myArray[1]) == 'number', 'message: The second item in myArray
should be a number
.');"
+ "assert(typeof myArray == 'object', 'message: myArray
should be an array
.');",
+ "assert(typeof myArray[0] !== 'undefined' && typeof myArray[0] == 'string', 'message: The first item in myArray
should be a string
.');",
+ "assert(typeof myArray[1] !== 'undefined' && typeof myArray[1] == 'number', 'message: The second item in myArray
should be a number
.');"
],
"challengeSeed": [
"var array = [\"John\", 23];",
@@ -450,7 +450,7 @@
"",
"// Only change code above this line.",
"",
- "if(typeof(myArray) !== \"undefined\"){(function(){return myArray;})();}"
+ "if(typeof myArray !== \"undefined\"){(function(){return myArray;})();}"
],
"type": "waypoint",
"challengeType": 1
@@ -468,7 +468,7 @@
"Create a variable called myData
and set it to equal the first value of myArray
."
],
"tests": [
- "assert((function(){if(typeof(myArray) != 'undefined' && typeof(myData) != 'undefined' && myArray[0] == myData){return true;}else{return false;}})(), 'message: The variable myData
should equal the first value of myArray
.');"
+ "assert((function(){if(typeof myArray != 'undefined' && typeof myData != 'undefined' && myArray[0] == myData){return true;}else{return false;}})(), 'message: The variable myData
should equal the first value of myArray
.');"
],
"challengeSeed": [
"var ourArray = [1,2,3];",
@@ -482,7 +482,7 @@
"",
"// Only change code above this line.",
"",
- "if(typeof(myArray) !== \"undefined\" && typeof(myData) !== \"undefined\"){(function(y,z){return 'myArray = ' + JSON.stringify(y) + ', myData = ' + JSON.stringify(z);})(myArray, myData);}"
+ "if(typeof myArray !== \"undefined\" && typeof myData !== \"undefined\"){(function(y,z){return 'myArray = ' + JSON.stringify(y) + ', myData = ' + JSON.stringify(z);})(myArray, myData);}"
],
"type": "waypoint",
"challengeType": 1
@@ -498,7 +498,7 @@
"Now modify the data stored at index 0 of myArray
to the value of 3."
],
"tests": [
- "assert((function(){if(typeof(myArray) != 'undefined' && myArray[0] == 3 && myArray[1] == 2 && myArray[2] == 3){return true;}else{return false;}})(), 'message: myArray
should now be [3,2,3].');",
+ "assert((function(){if(typeof myArray != 'undefined' && myArray[0] == 3 && myArray[1] == 2 && myArray[2] == 3){return true;}else{return false;}})(), 'message: myArray
should now be [3,2,3].');",
"assert((function(){if(editor.getValue().match(/myArray\\[0\\]\\s?=\\s?/g)){return true;}else{return false;}})(), 'message: You should be using correct index to modify the value in myArray
.');"
],
"challengeSeed": [
@@ -514,7 +514,7 @@
"",
"// Only change code above this line.",
"",
- "if(typeof(myArray) !== \"undefined\"){(function(){return myArray;})();}"
+ "if(typeof myArray !== \"undefined\"){(function(){return myArray;})();}"
],
"type": "waypoint",
"challengeType": 1
@@ -592,7 +592,7 @@
],
"tests": [
"assert((function(d){if(d[0] == 23 && d[1][0] == 'dog' && d[1][1] == 3 && d[2] == undefined){return true;}else{return false;}})(myArray), 'message: myArray
should now equal [23, [\"dog\", 3]]
.');",
- "assert((function(d){if(d === 'John' && typeof(removedFromMyArray) === 'string'){return true;}else{return false;}})(removedFromMyArray), 'message: removedFromMyArray
should contain \"John\"
.');"
+ "assert((function(d){if(d === 'John' && typeof removedFromMyArray === 'string'){return true;}else{return false;}})(removedFromMyArray), 'message: removedFromMyArray
should contain \"John\"
.');"
],
"challengeSeed": [
"var ourArray = [\"Stimpson\", \"J\", [\"cat\"]];",
@@ -622,7 +622,7 @@
"Add \"Paul\"
onto the beginning of the myArray
variable using unshift()
."
],
"tests": [
- "assert((function(d){if(typeof(d[0]) === \"string\" && d[0].toLowerCase() == 'paul' && d[1] == 23 && d[2][0] != undefined && d[2][0] == 'dog' && d[2][1] != undefined && d[2][1] == 3){return true;}else{return false;}})(myArray), 'message: myArray
should now have [\"Paul\", 23, [\"dog\", 3]]).');"
+ "assert((function(d){if(typeof d[0] === \"string\" && d[0].toLowerCase() == 'paul' && d[1] == 23 && d[2][0] != undefined && d[2][0] == 'dog' && d[2][1] != undefined && d[2][1] == 3){return true;}else{return false;}})(myArray), 'message: myArray
should now have [\"Paul\", 23, [\"dog\", 3]]).');"
],
"challengeSeed": [
"var ourArray = [\"Stimpson\", \"J\", [\"cat\"]];",
@@ -661,7 +661,7 @@
"Create and call a function called myFunction
that returns the sum of a
and b
."
],
"tests": [
- "assert((function(){if(typeof(f) !== \"undefined\" && f === a + b){return true;}else{return false;}})(), 'message: Your function should return the value of a + b
.');"
+ "assert((function(){if(typeof f !== \"undefined\" && f === a + b){return true;}else{return false;}})(), 'message: Your function should return the value of a + b
.');"
],
"challengeSeed": [
"var a = 4;",
@@ -678,7 +678,7 @@
"",
"// Only change code above this line.",
"",
- "if(typeof(myFunction) !== \"undefined\"){",
+ "if(typeof myFunction !== \"undefined\"){",
"var f=myFunction(a,b);",
"(function(){return f;})();",
"}"
@@ -705,9 +705,9 @@
"You can set these object properties to whatever values you want, as long \"name\"
is a string, \"legs\"
and \"tails\"
are numbers, and \"friends\"
is an array."
],
"tests": [
- "assert((function(z){if(z.hasOwnProperty(\"name\") && z.name !== undefined && typeof(z.name) === \"string\"){return true;}else{return false;}})(myDog), 'message: myDog
should contain the property name
and it should be a string
.');",
- "assert((function(z){if(z.hasOwnProperty(\"legs\") && z.legs !== undefined && typeof(z.legs) === \"number\"){return true;}else{return false;}})(myDog), 'message: myDog
should contain the property legs
and it should be a number
.');",
- "assert((function(z){if(z.hasOwnProperty(\"tails\") && z.tails !== undefined && typeof(z.tails) === \"number\"){return true;}else{return false;}})(myDog), 'message: myDog
should contain the property tails
and it should be a number
.');",
+ "assert((function(z){if(z.hasOwnProperty(\"name\") && z.name !== undefined && typeof z.name === \"string\"){return true;}else{return false;}})(myDog), 'message: myDog
should contain the property name
and it should be a string
.');",
+ "assert((function(z){if(z.hasOwnProperty(\"legs\") && z.legs !== undefined && typeof z.legs === \"number\"){return true;}else{return false;}})(myDog), 'message: myDog
should contain the property legs
and it should be a number
.');",
+ "assert((function(z){if(z.hasOwnProperty(\"tails\") && z.tails !== undefined && typeof z.tails === \"number\"){return true;}else{return false;}})(myDog), 'message: myDog
should contain the property tails
and it should be a number
.');",
"assert((function(z){if(z.hasOwnProperty(\"friends\") && z.friends !== undefined && Array.isArray(z.friends)){return true;}else{return false;}})(myDog), 'message: myDog
should contain the property friends
and it should be an array
.');"
],
"challengeSeed": [
@@ -902,7 +902,7 @@
"",
"// Only change code above this line.",
"",
- "if(typeof(myArray) !== \"undefined\"){(function(){return myArray;})();}",
+ "if(typeof myArray !== \"undefined\"){(function(){return myArray;})();}",
""
],
"type": "waypoint",
@@ -941,7 +941,7 @@
"",
"// Only change code above this line.",
"",
- "if(typeof(myArray) !== \"undefined\"){(function(){return myArray;})();}",
+ "if(typeof myArray !== \"undefined\"){(function(){return myArray;})();}",
""
],
"type": "waypoint",
@@ -981,7 +981,7 @@
""
],
"tail": [
- "if(typeof(myArray) !== \"undefined\"){(function(){return myArray;})();}"
+ "if(typeof myArray !== \"undefined\"){(function(){return myArray;})();}"
],
"type": "waypoint",
"challengeType": 1
@@ -1014,7 +1014,7 @@
"",
"// Only change code above this line.",
"",
- "if(typeof(myArray) !== \"undefined\"){(function(){return myArray;})();}",
+ "if(typeof myArray !== \"undefined\"){(function(){return myArray;})();}",
""
],
"type": "waypoint",
@@ -1030,7 +1030,7 @@
"Note that you can return a function, just like you would return a variable or value."
],
"tests": [
- "assert(typeof(myFunction()) === \"number\", 'message: myFunction
should return a random number.');",
+ "assert(typeof myFunction() === \"number\", 'message: myFunction
should return a random number.');",
"assert((myFunction()+''). match(/\\./g), 'message: The number returned by myFunction
should be a decimal.');",
"assert(editor.getValue().match(/Math\\.random/g).length >= 0, 'message: You should be using Math.random
to generate the random decimal number.');"
],
@@ -1066,7 +1066,7 @@
],
"tests": [
"assert(editor.getValue().match(/var\\srandomNumberBetween0and19\\s=\\sMath.floor\\(Math.random\\(\\)\\s\\*\\s20\\);/).length == 1, 'message: The first line of code should not be changed.');",
- "assert(typeof(myFunction()) === \"number\" && (function(){var r = myFunction();return Math.floor(r) === r;})(), 'message: The result of myFunction
should be a whole number.');",
+ "assert(typeof myFunction() === \"number\" && (function(){var r = myFunction();return Math.floor(r) === r;})(), 'message: The result of myFunction
should be a whole number.');",
"assert(editor.getValue().match(/Math.random/g).length > 1, 'message: You should be using Math.random
to generate a random number.');",
"assert(editor.getValue().match(/\\(\\s*?Math.random\\s*?\\(\\s*?\\)\\s*?\\*\\s*?10\\s*?\\)/g) || editor.getValue().match(/\\(\\s*?10\\s*?\\*\\s*?Math.random\\s*?\\(\\s*?\\)\\s*?\\)/g), 'message: You should have multiplied the result of Math.random
by 10 to make it a number that is between zero and nine.');",
"assert(editor.getValue().match(/Math.floor/g).length > 1, 'message: You should use Math.floor
to remove the decimal part of the number.');"
@@ -1172,7 +1172,7 @@
"",
"}",
"",
- "var result = myFunction();if(typeof(flip) !== \"undefined\" && typeof(flip) === \"number\" && typeof(result) !== \"undefined\" && typeof(result) === \"string\"){(function(y,z){return 'flip = ' + y.toString() + ', text = ' + z;})(flip, result);}"
+ "var result = myFunction();if(typeof flip !== \"undefined\" && typeof flip === \"number\" && typeof result !== \"undefined\" && typeof result === \"string\"){(function(y,z){return 'flip = ' + y.toString() + ', text = ' + z;})(flip, result);}"
],
"type": "waypoint",
"challengeType": 1
@@ -1315,9 +1315,9 @@
"Math.floor(Math.random() * (3 - 1 + 1)) + 1;
"
],
"tests": [
- "assert(typeof(runSlots($(\".slot\"))[0]) === \"number\" && runSlots($(\".slot\"))[0] > 0 && runSlots($(\".slot\"))[0] < 4, 'slotOne
should be a random number.')",
- "assert(typeof(runSlots($(\".slot\"))[1]) === \"number\" && runSlots($(\".slot\"))[1] > 0 && runSlots($(\".slot\"))[1] < 4, 'slotTwo
should be a random number.')",
- "assert(typeof(runSlots($(\".slot\"))[2]) === \"number\" && runSlots($(\".slot\"))[2] > 0 && runSlots($(\".slot\"))[2] < 4, 'slotThree
should be a random number.')",
+ "assert(typeof runSlots($(\".slot\"))[0] === \"number\" && runSlots($(\".slot\"))[0] > 0 && runSlots($(\".slot\"))[0] < 4, 'slotOne
should be a random number.')",
+ "assert(typeof runSlots($(\".slot\"))[1] === \"number\" && runSlots($(\".slot\"))[1] > 0 && runSlots($(\".slot\"))[1] < 4, 'slotTwo
should be a random number.')",
+ "assert(typeof runSlots($(\".slot\"))[2] === \"number\" && runSlots($(\".slot\"))[2] > 0 && runSlots($(\".slot\"))[2] < 4, 'slotThree
should be a random number.')",
"assert((function(){if(editor.match(/Math\\.floor\\(\\s?Math\\.random\\(\\)\\s?\\*\\s?\\(\\s?3\\s?\\-\\s?1\\s?\\+\\s?1\\s?\\)\\s?\\)\\s?\\+\\s?1/gi) !== null){return editor.match(/slot.*?=.*?\\(.*?\\).*?/gi).length >= 3;}else{return false;}})(), 'You should have used Math.floor(Math.random() * (3 - 1 + 1)) + 1;
three times to generate your random numbers.')"
],
"challengeSeed": [
diff --git a/challenges/basic-ziplines.json b/challenges/basic-ziplines.json
index 36cd9801a8..e968be9862 100644
--- a/challenges/basic-ziplines.json
+++ b/challenges/basic-ziplines.json
@@ -80,8 +80,7 @@
"Guarda tu proyecto con el botón \"Save\". Luego pulsa el botón de \"Fork\". Esto crea una bifurcación (copia) de tu proyecto con la que puedes experimentar.",
""
]
-
- ],
+ ],
"namePt": "",
"descriptionPt": []
},
diff --git a/challenges/html5-and-css.json b/challenges/html5-and-css.json
index 88c5479067..8f4d50688e 100644
--- a/challenges/html5-and-css.json
+++ b/challenges/html5-and-css.json
@@ -661,12 +661,12 @@
"nameEs": "Establecer la familia del tipo de letra de un elemento",
"descriptionEs": [
"Puede establecer el tipo de letra de un elemento usando la propiedad font-family
.",
- "Por ejemplo, si quiere establecer el tipo de letra de su elemento h2
como Sans-serif
, use el siguiente CSS:",
- "h2 {
",
+ "Por ejemplo, si quiere establecer el tipo de letra de su elemento h2
como Sans-serif
, use el siguiente CSS:",
+ "h2 {
",
" font-family: Sans-serif;
",
"}
",
"Haga que todos sus elementos p
utilicen el tipo de letra Monospace
."
- ],
+ ],
"namePt": "",
"descriptionPt": [],
"nameDe": "Waypoint: Definiere die Schriftart eines Elements",
@@ -720,12 +720,12 @@
"nameEs": "Importar un tipo de letra de Google",
"descriptionEs": [
"Ahora, importemos y apliquemos un tipo de letra de Google (tenga en cuenta que si Google es bloqueado en su país, debera saltarse este desafio).",
- "Primero, haga un llamado
a Google para tomar el tipo de letra Lobster
y para cargarlo en su HTML.",
- "Copie la siguiente porción de código y péguela en la parte superior de su editor de texto:",
+ "Primero, haga un llamado
a Google para tomar el tipo de letra Lobster
y para cargarlo en su HTML.",
+ "Copie la siguiente porción de código y péguela en la parte superior de su editor de texto:",
"<link href=\"http://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">
",
- "Ahora establezca Lobster
como valor de font-family en su elemento h2
.",
- "Aplique la familia de fuente (font-family
) Lobster
a su elemento h2
."
- ],
+ "Ahora establezca Lobster
como valor de font-family en su elemento h2
.",
+ "Aplique la familia de fuente (font-family
) Lobster
a su elemento h2
."
+ ],
"namePt": "",
"descriptionPt": [],
"nameDe": "Waypoint: Importiere eine Google Font",
diff --git a/challenges/intermediate-bonfires.json b/challenges/intermediate-bonfires.json
index 4ccdb71229..dd7718a45a 100644
--- a/challenges/intermediate-bonfires.json
+++ b/challenges/intermediate-bonfires.json
@@ -19,7 +19,7 @@
"sumAll([1, 4]);"
],
"tests": [
- "assert(typeof(sumAll([1, 4])) === \"number\", 'message: sumAll()
should return a number.');",
+ "assert(typeof sumAll([1, 4]) === \"number\", 'message: sumAll()
should return a number.');",
"assert.deepEqual(sumAll([1, 4]), 10, 'message: sumAll([1, 4])
should return 10.');",
"assert.deepEqual(sumAll([4, 1]), 10, 'message: sumAll([4, 1])
should return 10.');",
"assert.deepEqual(sumAll([5, 10]), 45, 'message: sumAll([5, 10])
should return 45.');",
@@ -67,7 +67,7 @@
"diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);"
],
"tests": [
- "assert(typeof(diff([1, 2, 3, 5], [1, 2, 3, 4, 5])) === \"object\", 'message: diff()
should return an array.');",
+ "assert(typeof diff([1, 2, 3, 5], [1, 2, 3, 4, 5]) === \"object\", 'message: diff()
should return an array.');",
"assert.sameMembers(diff([\"diorite\", \"andesite\", \"grass\", \"dirt\", \"pink wool\", \"dead shrub\"], [\"diorite\", \"andesite\", \"grass\", \"dirt\", \"dead shrub\"]), [\"pink wool\"], 'message: [\"diorite\", \"andesite\", \"grass\", \"dirt\", \"pink wool\", \"dead shrub\"], [\"diorite\", \"andesite\", \"grass\", \"dirt\", \"dead shrub\"]
should return [\"pink wool\"]
.');",
"assert.sameMembers(diff([\"andesite\", \"grass\", \"dirt\", \"pink wool\", \"dead shrub\"], [\"diorite\", \"andesite\", \"grass\", \"dirt\", \"dead shrub\"]), [\"diorite\", \"pink wool\"], 'message: [\"andesite\", \"grass\", \"dirt\", \"pink wool\", \"dead shrub\"], [\"diorite\", \"andesite\", \"grass\", \"dirt\", \"dead shrub\"]
should return [\"diorite\", \"pink wool\"]
.');",
"assert.sameMembers(diff([\"andesite\", \"grass\", \"dirt\", \"dead shrub\"], [\"andesite\", \"grass\", \"dirt\", \"dead shrub\"]), [], 'message: [\"andesite\", \"grass\", \"dirt\", \"dead shrub\"], [\"andesite\", \"grass\", \"dirt\", \"dead shrub\"]
should return []
.');",
@@ -443,7 +443,7 @@
"Boolean Objects"
],
"solutions": [
- "function boo(bool) {\n // What is the new fad diet for ghost developers? The Boolean.\n return typeof(bool) === \"boolean\";\n}\n\nboo(null);"
+ "function boo(bool) {\n // What is the new fad diet for ghost developers? The Boolean.\n return typeof bool === \"boolean\";\n}\n\nboo(null);"
],
"type": "bonfire",
"challengeType": 5,
@@ -620,7 +620,7 @@
"sumFibs(4);"
],
"tests": [
- "assert(typeof(sumFibs(1)) === \"number\", 'message: sumFibs(1)
should return a number.');",
+ "assert(typeof sumFibs(1) === \"number\", 'message: sumFibs(1)
should return a number.');",
"assert.deepEqual(sumFibs(1000), 1785, 'message: sumFibs(1000)
should return 1785.');",
"assert.deepEqual(sumFibs(4000000), 4613732, 'message: sumFibs(4000000)
should return 4613732.');",
"assert.deepEqual(sumFibs(4), 5, 'message: sumFibs(4)
should return 5.');",
@@ -668,7 +668,7 @@
"sumPrimes(10);"
],
"tests": [
- "assert.deepEqual(typeof(sumPrimes(10)), \"number\", 'message: sumPrimes()
should return a number.');",
+ "assert.deepEqual(typeof sumPrimes(10), \"number\", 'message: sumPrimes()
should return a number.');",
"assert.deepEqual(sumPrimes(10), 17, 'message: sumPrimes(10)
should return 17.');",
"assert.deepEqual(sumPrimes(977), 73156, 'message: sumPrimes(977)
should return 73156.');"
],
@@ -715,7 +715,7 @@
"smallestCommons([1,5]);"
],
"tests": [
- "assert.deepEqual(typeof(smallestCommons([1, 5])), \"number\", 'message: smallestCommons()
should return a number.');",
+ "assert.deepEqual(typeof smallestCommons([1, 5]), \"number\", 'message: smallestCommons()
should return a number.');",
"assert.deepEqual(smallestCommons([1, 5]), 60, 'message: smallestCommons([1, 5])
should return 60.');",
"assert.deepEqual(smallestCommons([5, 1]), 60, 'message: smallestCommons([5, 1])
should return 60.');",
"assert.deepEqual(smallestCommons([1, 13]), 360360, 'message: smallestCommons([1, 13])
should return 360360.');"
diff --git a/challenges/object-oriented-and-functional-programming.json b/challenges/object-oriented-and-functional-programming.json
index 907035e02c..151c64d933 100644
--- a/challenges/object-oriented-and-functional-programming.json
+++ b/challenges/object-oriented-and-functional-programming.json
@@ -207,8 +207,8 @@
"Now try it yourself! Modify the Bike
constructor
to have a private property
called gear
and two public methods
called getGear
and setGear
to get and set that value."
],
"tests":[
- "assert(typeof myBike.getGear !== 'undefined' && typeof(myBike.getGear) === 'function', 'message: The method getGear
of myBike
should be accessible outside the object.');",
- "assert(typeof myBike.setGear !== 'undefined' && typeof(myBike.setGear) === 'function', 'message: The method setGear
of myBike
should be accessible outside the object.');",
+ "assert(typeof myBike.getGear !== 'undefined' && typeof myBike.getGear === 'function', 'message: The method getGear
of myBike
should be accessible outside the object.');",
+ "assert(typeof myBike.setGear !== 'undefined' && typeof myBike.setGear === 'function', 'message: The method setGear
of myBike
should be accessible outside the object.');",
"assert(typeof myBike.gear === 'undefined', 'message: myBike.gear
should remain undefined.');"
],
"challengeSeed":[
@@ -453,7 +453,7 @@
],
"tests":[
"assert(/\\.split\\(/gi, 'message: You should use the split
method on the string.');",
- "assert(typeof(array) === 'object' && array.length === 5, 'message: You should split the string by its spaces.');"
+ "assert(typeof array === 'object' && array.length === 5, 'message: You should split the string by its spaces.');"
],
"challengeSeed":[
"var string = \"Split me into an array\";",
@@ -481,7 +481,7 @@
"Use the join
method to create a string from joinMe
with spaces in between each element and assign it to joinedString
."
],
"tests":[
- "assert(typeof(joinedString) === 'string' && joinedString === \"Split me into an array\", 'message: You should join the elements of the array with spaces.');",
+ "assert(typeof joinedString === 'string' && joinedString === \"Split me into an array\", 'message: You should join the elements of the array with spaces.');",
"assert(/\\.join\\(/gi, 'message: You should use of the join
method on the array.');"
],
"challengeSeed":[