diff --git a/seed/challenges/basic-javascript.json b/seed/challenges/basic-javascript.json
index 7c49d07c8d..50084479d3 100644
--- a/seed/challenges/basic-javascript.json
+++ b/seed/challenges/basic-javascript.json
@@ -66,7 +66,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;}/**/})(), '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;}})(), 'myName
should be a string that contains at least one character in it.');"
],
"challengeSeed": [
"// var ourName = \"Free Code Camp\";",
@@ -90,11 +90,11 @@
"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;}})(), 'myFirstName should be a string with a least one character in it');",
- "assert((function(){if(typeof(myLastName) !== \"undefined\" && typeof(myLastName) === \"string\" && myLastName.length > 0){return true;}else{return false;}})(), 'myLastName should be a string with a least one character in it');"
+ "assert((function(){if(typeof(myFirstName) !== \"undefined\" && typeof(myFirstName) === \"string\" && myFirstName.length > 0){return true;}else{return false;}})(), '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;}})(), 'myLastName
should be a string with at least one character in it.');"
],
"challengeSeed": [
- "// name = \"Alan Turing\";",
+ "// var name = \"Alan Turing\";",
"// var firstName = \"Alan\";",
"// var lastName = \"Turing\";",
"",
@@ -112,13 +112,13 @@
"title": "Check the Length Property of a String Variable",
"difficulty": "9.9809",
"description": [
- "data structures
have properties
. For example, strings
have a property called .length
that will tell you how many characters are in the string.",
+ "Data structures
have properties
. For example, strings
have a property called .length
that will tell you how many characters are in the string.",
"For example, if we created a variable var firstName = \"Charles\"
, we could find out how long the string \"Charles\" is by using the firstName.length
property.",
"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;}})(), '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;}})(), 'You should be getting the length of lastName
by using .length
like this: lastName.length
');"
+ "assert((function(){if(typeof(lastNameLength) !== \"undefined\" && typeof(lastNameLength) === \"number\" && lastNameLength === 8){return true;}else{return false;}})(), '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;}})(), 'You should be getting the length of lastName
by using .length
like this: lastName.length
.');"
],
"challengeSeed": [
"var firstNameLength = 0;",
@@ -129,7 +129,7 @@
"",
"var lastName = \"Lovelace\";",
"",
- "// don't change code above here",
+ "// Don't change code above here.",
"",
"lastNameLength = lastName;",
"",
@@ -155,7 +155,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;}})(), 'The first letter of firstLetterOfLastName should be a L');"
+ "assert((function(){if(typeof(firstLetterOfLastName) !== \"undefined\" && editor.getValue().match(/\\[0\\]/gi) && typeof(firstLetterOfLastName) === \"string\" && firstLetterOfLastName === \"L\"){return true;}else{return false;}})(), 'The first letter of firstLetterOfLastName
should be a \"L\"
.');"
],
"challengeSeed": [
"var firstLetterOfFirstName = \"\";",
@@ -189,7 +189,7 @@
"Try looking at the secondLetterOfFirstName
variable declaration if you get stuck."
],
"tests": [
- "assert(thirdLetterOfLastName === 'v', 'The third letter of lastName should be a \"v\"');"
+ "assert(thirdLetterOfLastName === 'v', 'The third letter of lastName
should be a \"v\"
.');"
],
"challengeSeed": [
"var firstName = \"Ada\";",
@@ -220,8 +220,8 @@
"Try looking at the lastLetterOfFirstName
variable declaration if you get stuck."
],
"tests": [
- "assert(lastLetterOfLastName === \"e\", 'lastLetterOfLastName should be \"e\"');",
- "assert(editor.getValue().match(/\\.length/g).length === 2, 'You have to use .length
to get the last letter');"
+ "assert(lastLetterOfLastName === \"e\", 'lastLetterOfLastName
should be \"e\"
.');",
+ "assert(editor.getValue().match(/\\.length/g).length === 2, 'You have to use .length
to get the last letter.');"
],
"challengeSeed": [
"var firstName = \"Ada\";",
@@ -252,7 +252,7 @@
"Try looking at the thirdToLastLetterOfFirstName
variable declaration if you get stuck."
],
"tests": [
- "assert(secondToLastLetterOfLastName === 'c', 'secondToLastLetterOfLastName should be \"c\".');",
+ "assert(secondToLastLetterOfLastName === 'c', 'secondToLastLetterOfLastName
should be \"c\"
.');",
"assert(editor.getValue().match(/\\.length/g).length === 2, 'You have to use .length to get the second last letter.');"
],
"challengeSeed": [
@@ -306,7 +306,7 @@
"Replace the 0
with the correct number so you can get the result mentioned in the comment."
],
"tests": [
- "assert((function(){if(difference === 12 && editor.getValue().match(/\\-/g)){return true;}else{return false;}})(), 'Make the variable difference
equal 12');"
+ "assert((function(){if(difference === 12 && editor.getValue().match(/\\-/g)){return true;}else{return false;}})(), 'Make the variable difference
equal 12.');"
],
"challengeSeed": [
"var difference = 45 - 0; //make this equal to 12 by changing the 0 into the appropriate number.",
@@ -332,7 +332,7 @@
"assert((function(){if(product === 80 && editor.getValue().match(/\\*/g)){return true;}else{return false;}})(), 'Make the variable product
equal 80.');"
],
"challengeSeed": [
- "var product = 8 * 0; //make this equal to 80 by changing the 0 into the appropriate number.",
+ "var product = 8 * 0; // Make this equal to 80 by changing the 0 into the appropriate number.",
"",
"// Only change code above this line.",
"// We use this function to show you the value of your variable in your output box.",