Merge branch 'bugron-bugron-basic_js_fix-1' into staging
commit
fa64b9dca6
|
@ -42,7 +42,7 @@
|
|||
"challengeSeed": [
|
||||
"function welcomeToBooleans() {",
|
||||
"",
|
||||
"// don't change code above here",
|
||||
"// Only change code below this line.",
|
||||
"",
|
||||
" return false;",
|
||||
"",
|
||||
|
@ -66,7 +66,7 @@
|
|||
"Look at the <code>ourName</code> 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;}})(), '<code>myName</code> 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: <code>myFirstName</code>and <code>myLastName</code> 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;}})(), '<code>myFirstName</code> 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;}})(), '<code>myLastName</code> 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": [
|
||||
"<code>data structures</code> have <code>properties</code>. For example, <code>strings</code> have a property called <code>.length</code> that will tell you how many characters are in the string.",
|
||||
"<code>Data structures</code> have <code>properties</code>. For example, <code>strings</code> have a property called <code>.length</code> that will tell you how many characters are in the string.",
|
||||
"For example, if we created a variable <code>var firstName = \"Charles\"</code>, we could find out how long the string \"Charles\" is by using the <code>firstName.length</code> property.",
|
||||
"Use the <code>.length</code> property to count the number of characters in the <code>lastName</code> 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 <code>lastName</code> by using <code>.length</code> like this: <code>lastName.length</code>');"
|
||||
"assert((function(){if(typeof(lastNameLength) !== \"undefined\" && typeof(lastNameLength) === \"number\" && lastNameLength === 8){return true;}else{return false;}})(), '<code>lastNameLength</code> 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 <code>lastName</code> by using <code>.length</code> like this: <code>lastName.length</code>.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var firstNameLength = 0;",
|
||||
|
@ -129,7 +129,7 @@
|
|||
"",
|
||||
"var lastName = \"Lovelace\";",
|
||||
"",
|
||||
"// don't change code above here",
|
||||
"// Only change code below this line.",
|
||||
"",
|
||||
"lastNameLength = lastName;",
|
||||
"",
|
||||
|
@ -155,7 +155,7 @@
|
|||
"Try looking at the <code>firstLetterOfFirstName</code> 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 <code>firstLetterOfLastName</code> should be a <code>\"L\"</code>.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var firstLetterOfFirstName = \"\";",
|
||||
|
@ -189,7 +189,7 @@
|
|||
"Try looking at the <code>secondLetterOfFirstName</code> 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 <code>lastName</code> should be a <code>\"v\"</code>.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var firstName = \"Ada\";",
|
||||
|
@ -220,8 +220,8 @@
|
|||
"Try looking at the <code>lastLetterOfFirstName</code> 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 <code>.length</code> to get the last letter');"
|
||||
"assert(lastLetterOfLastName === \"e\", '<code>lastLetterOfLastName</code> should be <code>\"e\"</code>.');",
|
||||
"assert(editor.getValue().match(/\\.length/g).length === 2, 'You have to use <code>.length</code> to get the last letter.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var firstName = \"Ada\";",
|
||||
|
@ -252,7 +252,7 @@
|
|||
"Try looking at the <code>thirdToLastLetterOfFirstName</code> variable declaration if you get stuck."
|
||||
],
|
||||
"tests": [
|
||||
"assert(secondToLastLetterOfLastName === 'c', 'secondToLastLetterOfLastName should be \"c\".');",
|
||||
"assert(secondToLastLetterOfLastName === 'c', '<code>secondToLastLetterOfLastName</code> should be <code>\"c\"</code>.');",
|
||||
"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 <code>0</code> 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 <code>difference</code> equal 12');"
|
||||
"assert((function(){if(difference === 12 && editor.getValue().match(/\\-/g)){return true;}else{return false;}})(), 'Make the variable <code>difference</code> 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 <code>product</code> 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.",
|
||||
|
@ -687,7 +687,6 @@
|
|||
" return a - b;",
|
||||
"};",
|
||||
"",
|
||||
"// Don't modify above this line",
|
||||
"// Create a function called myFunction that returns the value of a plus b.",
|
||||
"// Only change code below this line.",
|
||||
"",
|
||||
|
|
Loading…
Reference in New Issue