diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/confirm-the-ending.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/confirm-the-ending.english.md index 447109f73d..91747bcb31 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/confirm-the-ending.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/confirm-the-ending.english.md @@ -43,7 +43,7 @@ tests: testString: assert(confirmEnding("If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing", "mountain") === false); - text: confirmEnding("Abstraction", "action") should return true. testString: assert(confirmEnding("Abstraction", "action") === true); - - text: Do not use the built-in method .endsWith() to solve the challenge. + - text: Your code should not use the built-in method .endsWith() to solve the challenge. testString: assert(!(/\.endsWith\(.*?\)\s*?;?/.test(code)) && !(/\['endsWith'\]/.test(code))); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/access-an-arrays-contents-using-bracket-notation.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/access-an-arrays-contents-using-bracket-notation.english.md index a5804e4a2b..c1c98b7bb9 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/access-an-arrays-contents-using-bracket-notation.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/access-an-arrays-contents-using-bracket-notation.english.md @@ -43,13 +43,13 @@ In order to complete this challenge, set the 2nd position (index 1) ```yml tests: - - text: myArray[0] is equal to "a" + - text: myArray[0] should be equal to "a" testString: assert.strictEqual(myArray[0], "a"); - - text: myArray[1] is no longer set to "b" + - text: myArray[1] should not be equal to "b" testString: assert.notStrictEqual(myArray[1], "b"); - - text: myArray[2] is equal to "c" + - text: myArray[2] should be equal to "c" testString: assert.strictEqual(myArray[2], "c"); - - text: myArray[3] is equal to "d" + - text: myArray[3] should be equal to "d" testString: assert.strictEqual(myArray[3], "d"); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/access-property-names-with-bracket-notation.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/access-property-names-with-bracket-notation.english.md index f2159c2d46..e59367f61d 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/access-property-names-with-bracket-notation.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/access-property-names-with-bracket-notation.english.md @@ -27,15 +27,15 @@ We've defined a function, checkInventory, which receives a scanned ```yml tests: - - text: checkInventory is a function + - text: checkInventory should be a function. testString: assert.strictEqual(typeof checkInventory, 'function'); - - text: 'The foods object should have only the following key-value pairs: apples: 25, oranges: 32, plums: 28, bananas: 13, grapes: 35, strawberries: 27' + - text: 'The foods object should have only the following key-value pairs: apples: 25, oranges: 32, plums: 28, bananas: 13, grapes: 35, strawberries: 27.' testString: 'assert.deepEqual(foods, {apples: 25, oranges: 32, plums: 28, bananas: 13, grapes: 35, strawberries: 27});' - - text: checkInventory("apples") should return 25 + - text: checkInventory("apples") should return 25. testString: assert.strictEqual(checkInventory('apples'), 25); - - text: checkInventory("bananas") should return 13 + - text: checkInventory("bananas") should return 13. testString: assert.strictEqual(checkInventory('bananas'), 13); - - text: checkInventory("strawberries") should return 27 + - text: checkInventory("strawberries") should return 27. testString: assert.strictEqual(checkInventory('strawberries'), 27); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/add-key-value-pairs-to-javascript-objects.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/add-key-value-pairs-to-javascript-objects.english.md index 335b74ac88..ccd8fdb9ac 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/add-key-value-pairs-to-javascript-objects.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/add-key-value-pairs-to-javascript-objects.english.md @@ -45,15 +45,15 @@ Using the same syntax, we can also add new key-value p ```yml tests: - - text: foods is an object + - text: foods should be an object. testString: assert(typeof foods === 'object'); - - text: The foods object has a key "bananas" with a value of 13 + - text: The foods object should have a key "bananas" with a value of 13. testString: assert(foods.bananas === 13); - - text: The foods object has a key "grapes" with a value of 35 + - text: The foods object should have a key "grapes" with a value of 35. testString: assert(foods.grapes === 35); - - text: The foods object has a key "strawberries" with a value of 27 + - text: The foods object should have a key "strawberries" with a value of 27. testString: assert(foods.strawberries === 27); - - text: The key-value pairs should be set using dot or bracket notation + - text: The key-value pairs should be set using dot or bracket notation. testString: assert(code.search(/bananas:/) === -1 && code.search(/grapes:/) === -1 && code.search(/strawberries:/) === -1); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/generate-an-array-of-all-object-keys-with-object.keys.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/generate-an-array-of-all-object-keys-with-object.keys.english.md index a64f0b72fe..2e2341024a 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/generate-an-array-of-all-object-keys-with-object.keys.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/generate-an-array-of-all-object-keys-with-object.keys.english.md @@ -20,9 +20,9 @@ Finish writing the getArrayOfUsers function so that it returns an a ```yml tests: - - text: The users object only contains the keys Alan, Jeff, Sarah, and Ryan + - text: The users object should only contain the keys Alan, Jeff, Sarah, and Ryan testString: assert('Alan' in users && 'Jeff' in users && 'Sarah' in users && 'Ryan' in users && Object.keys(users).length === 4); - - text: The getArrayOfUsers function returns an array which contains all the keys in the users object + - text: The getArrayOfUsers function should return an array which contains all the keys in the users object testString: assert((function() { users.Sam = {}; users.Lewis = {}; let R = getArrayOfUsers(users); return (R.indexOf('Alan') !== -1 && R.indexOf('Jeff') !== -1 && R.indexOf('Sarah') !== -1 && R.indexOf('Ryan') !== -1 && R.indexOf('Sam') !== -1 && R.indexOf('Lewis') !== -1); })() === true); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/modify-an-array-stored-in-an-object.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/modify-an-array-stored-in-an-object.english.md index 5f9a9d9b3b..9bf64398cf 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/modify-an-array-stored-in-an-object.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/modify-an-array-stored-in-an-object.english.md @@ -20,11 +20,11 @@ Take a look at the object we've provided in the code editor. The useruser object has name, age, and data keys + - text: The user object should have name, age, and data keys. testString: assert('name' in user && 'age' in user && 'data' in user); - - text: The addFriend function accepts a user object and a friend string as arguments and adds the friend to the array of friends in the user object + - text: The addFriend function should accept a user object and a friend string as arguments and add the friend to the array of friends in the user object. testString: assert((function() { let L1 = user.data.friends.length; addFriend(user, 'Sean'); let L2 = user.data.friends.length; return (L2 === L1 + 1); })()); - - text: addFriend(user, "Pete") should return ["Sam", "Kira", "Tomo", "Pete"] + - text: addFriend(user, "Pete") should return ["Sam", "Kira", "Tomo", "Pete"]. testString: assert.deepEqual((function() { delete user.data.friends; user.data.friends = ['Sam', 'Kira', 'Tomo']; return addFriend(user, 'Pete') })(), ['Sam', 'Kira', 'Tomo', 'Pete']); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/modify-an-object-nested-within-an-object.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/modify-an-object-nested-within-an-object.english.md index 99e8226b8f..5625ae44a2 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/modify-an-object-nested-within-an-object.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/modify-an-object-nested-within-an-object.english.md @@ -37,13 +37,13 @@ Here we've defined an object, userActivity, which includes another ```yml tests: - - text: userActivity has id, date and data properties + - text: userActivity should have id, date and data properties. testString: assert('id' in userActivity && 'date' in userActivity && 'data' in userActivity); - - text: userActivity has a data key set to an object with keys totalUsers and online + - text: userActivity should have a data key set to an object with keys totalUsers and online. testString: assert('totalUsers' in userActivity.data && 'online' in userActivity.data); - text: The online property nested in the data key of userActivity should be set to 45 testString: assert(userActivity.data.online === 45); - - text: The online property is set using dot or bracket notation + - text: The online property should be set using dot or bracket notation. testString: 'assert.strictEqual(code.search(/online: 45/), -1);' ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/use-an-array-to-store-a-collection-of-data.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/use-an-array-to-store-a-collection-of-data.english.md index 894f9b4d8d..b59800e8c7 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/use-an-array-to-store-a-collection-of-data.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/use-an-array-to-store-a-collection-of-data.english.md @@ -55,15 +55,15 @@ We have defined a variable called yourArray. Complete the statement ```yml tests: - - text: yourArray is an array + - text: yourArray should be an array. testString: assert.strictEqual(Array.isArray(yourArray), true); - - text: yourArray is at least 5 elements long + - text: yourArray should be at least 5 elements long. testString: assert.isAtLeast(yourArray.length, 5); - - text: yourArray contains at least one boolean + - text: yourArray should contain at least one boolean. testString: assert(yourArray.filter( el => typeof el === 'boolean').length >= 1); - - text: yourArray contains at least one number + - text: yourArray should contain at least one number. testString: assert(yourArray.filter( el => typeof el === 'number').length >= 1); - - text: yourArray contains at least one string + - text: yourArray should contain at least one string. testString: assert(yourArray.filter( el => typeof el === 'string').length >= 1); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/use-the-delete-keyword-to-remove-object-properties.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/use-the-delete-keyword-to-remove-object-properties.english.md index 6ecf3376c8..132764f241 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/use-the-delete-keyword-to-remove-object-properties.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/use-the-delete-keyword-to-remove-object-properties.english.md @@ -27,9 +27,9 @@ Use the delete keyword to remove the oranges, plums, a ```yml tests: - - text: 'The foods object only has three keys: apples, grapes, and bananas' + - text: 'The foods object should only have three keys: apples, grapes, and bananas.' testString: 'assert(!foods.hasOwnProperty(''oranges'') && !foods.hasOwnProperty(''plums'') && !foods.hasOwnProperty(''strawberries'') && Object.keys(foods).length === 3);' - - text: The oranges, plums, and strawberries keys are removed using delete + - text: The oranges, plums, and strawberries keys should be removed using delete. testString: assert(code.search(/oranges:/) !== -1 && code.search(/plums:/) !== -1 && code.search(/strawberries:/) !== -1); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/accessing-nested-arrays.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/accessing-nested-arrays.english.md index b3b4db7f82..b04110b4a1 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/accessing-nested-arrays.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/accessing-nested-arrays.english.md @@ -46,9 +46,9 @@ Retrieve the second tree from the variable myPlants using object do ```yml tests: - - text: secondTree should equal "pine" + - text: secondTree should equal "pine". testString: assert(secondTree === "pine"); - - text: Use dot and bracket notation to access myPlants + - text: Your code should use dot and bracket notation to access myPlants. testString: assert(/=\s*myPlants\[1\].list\[1\]/.test(code)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/accessing-nested-objects.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/accessing-nested-objects.english.md index 58357ad1c2..7c354725f3 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/accessing-nested-objects.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/accessing-nested-objects.english.md @@ -40,9 +40,9 @@ Access the myStorage object and assign the contents of the gl ```yml tests: - - text: gloveBoxContents should equal "maps" + - text: gloveBoxContents should equal "maps". testString: assert(gloveBoxContents === "maps"); - - text: Use dot and bracket notation to access myStorage + - text: Your code should use dot and bracket notation to access myStorage. testString: assert(/=\s*myStorage\.car\.inside\[\s*("|')glove box\1\s*\]/g.test(code)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/add-new-properties-to-a-javascript-object.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/add-new-properties-to-a-javascript-object.english.md index 224d65b09a..c50e72f565 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/add-new-properties-to-a-javascript-object.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/add-new-properties-to-a-javascript-object.english.md @@ -26,9 +26,9 @@ Add a "bark" property to myDog and set it to a dog sou ```yml tests: - - text: Add the property "bark" to myDog. + - text: You should add the property "bark" to myDog. testString: assert(myDog.bark !== undefined); - - text: Do not add "bark" to the setup section + - text: You should not add "bark" to the setup section. testString: assert(!/bark[^\n]:/.test(code)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/add-two-numbers-with-javascript.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/add-two-numbers-with-javascript.english.md index 1794ec9dc7..adad0bd793 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/add-two-numbers-with-javascript.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/add-two-numbers-with-javascript.english.md @@ -29,9 +29,9 @@ Change the 0 so that sum will equal 20. ```yml tests: - - text: sum should equal 20 + - text: sum should equal 20. testString: assert(sum === 20); - - text: Use the + operator + - text: You should use the + operator. testString: assert(/\+/.test(code)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/appending-variables-to-strings.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/appending-variables-to-strings.english.md index 18497d2b16..b13c41db40 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/appending-variables-to-strings.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/appending-variables-to-strings.english.md @@ -21,9 +21,9 @@ Set someAdjective and append it to myStr using the someAdjective should be set to a string at least 3 characters long + - text: someAdjective should be set to a string at least 3 characters long. testString: assert(typeof someAdjective !== 'undefined' && someAdjective.length > 2); - - text: Append someAdjective to myStr using the += operator + - text: You should append someAdjective to myStr using the += operator. testString: assert(code.match(/myStr\s*\+=\s*someAdjective\s*/).length > 0); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comment-your-javascript-code.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comment-your-javascript-code.english.md index aa737a7d58..7bfbbaf5af 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comment-your-javascript-code.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comment-your-javascript-code.english.md @@ -36,9 +36,9 @@ Try creating one of each type of comment. ```yml tests: - - text: Create a // style comment that contains at least five letters. + - text: You should create a // style comment that contains at least five letters. testString: assert(code.match(/(\/\/)...../g)); - - text: Create a /* */ style comment that contains at least five letters. + - text: You should create a /* */ style comment that contains at least five letters. testString: assert(code.match(/(\/\*)([^\/]{5,})(?=\*\/)/gm)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-addition.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-addition.english.md index 25816b94ad..76ed0ba65d 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-addition.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-addition.english.md @@ -31,15 +31,15 @@ Convert the assignments for a, b, and c t ```yml tests: - - text: a should equal 15 + - text: a should equal 15. testString: assert(a === 15); - - text: b should equal 26 + - text: b should equal 26. testString: assert(b === 26); - - text: c should equal 19 + - text: c should equal 19. testString: assert(c === 19); - - text: You should use the += operator for each variable + - text: You should use the += operator for each variable. testString: assert(code.match(/\+=/g).length === 3); - - text: Do not modify the code above the line + - text: You should not modify the code above the specified comment. testString: assert(/var a = 3;/.test(code) && /var b = 17;/.test(code) && /var c = 12;/.test(code)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-division.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-division.english.md index 50413614eb..63a147ecd3 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-division.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-division.english.md @@ -24,15 +24,15 @@ Convert the assignments for a, b, and c t ```yml tests: - - text: a should equal 4 + - text: a should equal 4. testString: assert(a === 4); - - text: b should equal 27 + - text: b should equal 27. testString: assert(b === 27); - - text: c should equal 3 + - text: c should equal 3. testString: assert(c === 3); - - text: You should use the /= operator for each variable + - text: You should use the /= operator for each variable. testString: assert(code.match(/\/=/g).length === 3); - - text: Do not modify the code above the line + - text: You should not modify the code above the specified comment. testString: assert(/var a = 48;/.test(code) && /var b = 108;/.test(code) && /var c = 33;/.test(code)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-multiplication.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-multiplication.english.md index d1bffbdcba..eee2ed4982 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-multiplication.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-multiplication.english.md @@ -24,15 +24,15 @@ Convert the assignments for a, b, and c t ```yml tests: - - text: a should equal 25 + - text: a should equal 25. testString: assert(a === 25); - - text: b should equal 36 + - text: b should equal 36. testString: assert(b === 36); - - text: c should equal 46 + - text: c should equal 46. testString: assert(c === 46); - - text: You should use the *= operator for each variable + - text: You should use the *= operator for each variable. testString: assert(code.match(/\*=/g).length === 3); - - text: Do not modify the code above the line + - text: You should not modify the code above the specified comment. testString: assert(/var a = 5;/.test(code) && /var b = 12;/.test(code) && /var c = 4\.6;/.test(code)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-subtraction.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-subtraction.english.md index 495479c7d9..9d186e51db 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-subtraction.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-subtraction.english.md @@ -24,15 +24,15 @@ Convert the assignments for a, b, and c t ```yml tests: - - text: a should equal 5 + - text: a should equal 5. testString: assert(a === 5); - - text: b should equal -6 + - text: b should equal -6. testString: assert(b === -6); - - text: c should equal 2 + - text: c should equal 2. testString: assert(c === 2); - - text: You should use the -= operator for each variable + - text: You should use the -= operator for each variable. testString: assert(code.match(/-=/g).length === 3); - - text: Do not modify the code above the line + - text: You should not modify the code above the specified comment. testString: assert(/var a = 11;/.test(code) && /var b = 9;/.test(code) && /var c = 3;/.test(code)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/concatenating-strings-with-plus-operator.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/concatenating-strings-with-plus-operator.english.md index 727b75789d..a87e1ecc39 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/concatenating-strings-with-plus-operator.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/concatenating-strings-with-plus-operator.english.md @@ -30,11 +30,11 @@ Build myStr from the strings "This is the start. " and tests: - text: myStr should have a value of This is the start. This is the end. testString: assert(myStr === "This is the start. This is the end."); - - text: Use the + operator to build myStr + - text: You should use the + operator to build myStr. testString: assert(code.match(/(["']).*(["'])\s*\+\s*(["']).*(["'])/g).length > 1); - text: myStr should be created using the var keyword. testString: assert(/var\s+myStr/.test(code)); - - text: Make sure to assign the result to the myStr variable. + - text: You should assign the result to the myStr variable. testString: assert(/myStr\s*=/.test(code)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/concatenating-strings-with-the-plus-equals-operator.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/concatenating-strings-with-the-plus-equals-operator.english.md index 57030c8906..5a277068bc 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/concatenating-strings-with-the-plus-equals-operator.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/concatenating-strings-with-the-plus-equals-operator.english.md @@ -24,7 +24,7 @@ Build myStr over several lines by concatenating these two strings: tests: - text: myStr should have a value of This is the first sentence. This is the second sentence. testString: assert(myStr === "This is the first sentence. This is the second sentence."); - - text: Use the += operator to build myStr + - text: You should use the += operator to build myStr. testString: assert(code.match(/\w\s*\+=\s*["']/g).length > 1 && code.match(/\w\s*\=\s*["']/g).length > 1); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/constructing-strings-with-variables.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/constructing-strings-with-variables.english.md index 349992482c..c72ac9574b 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/constructing-strings-with-variables.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/constructing-strings-with-variables.english.md @@ -21,9 +21,9 @@ Set myName to a string equal to your name and build myStrmyName should be set to a string at least 3 characters long + - text: myName should be set to a string at least 3 characters long. testString: assert(typeof myName !== 'undefined' && myName.length > 2); - - text: Use two + operators to build myStr with myName inside it + - text: You should use two + operators to build myStr with myName inside it. testString: assert(code.match(/["']\s*\+\s*myName\s*\+\s*["']/g).length > 0); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/decrement-a-number-with-javascript.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/decrement-a-number-with-javascript.english.md index bc307b47ef..5cff4c6e9a 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/decrement-a-number-with-javascript.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/decrement-a-number-with-javascript.english.md @@ -25,13 +25,13 @@ Change the code to use the -- operator on myVar. ```yml tests: - - text: myVar should equal 10 + - text: myVar should equal 10. testString: assert(myVar === 10); - - text: myVar = myVar - 1; should be changed + - text: myVar = myVar - 1; should be changed. testString: assert(/var\s*myVar\s*=\s*11;\s*\/*.*\s*([-]{2}\s*myVar|myVar\s*[-]{2});/.test(code)); - - text: Use the -- operator on myVar + - text: You should use the -- operator on myVar. testString: assert(/[-]{2}\s*myVar|myVar\s*[-]{2}/.test(code)); - - text: Do not change code above the line + - text: You should not change code above the specified comment. testString: assert(/var myVar = 11;/.test(code)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/delete-properties-from-a-javascript-object.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/delete-properties-from-a-javascript-object.english.md index 6d382f8711..a1492f86a1 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/delete-properties-from-a-javascript-object.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/delete-properties-from-a-javascript-object.english.md @@ -22,9 +22,9 @@ Delete the "tails" property from myDog. You may use ei ```yml tests: - - text: Delete the property "tails" from myDog. + - text: You should delete the property "tails" from myDog. testString: assert(typeof myDog === "object" && myDog.tails === undefined); - - text: Do not modify the myDog setup + - text: You should not modify the myDog setup. testString: 'assert(code.match(/"tails": 1/g).length > 1);' ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/divide-one-number-by-another-with-javascript.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/divide-one-number-by-another-with-javascript.english.md index 91cbb81cec..4689fa67ce 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/divide-one-number-by-another-with-javascript.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/divide-one-number-by-another-with-javascript.english.md @@ -30,9 +30,9 @@ Change the 0 so that the quotient is equal to 2< ```yml tests: - - text: Make the variable quotient equal to 2. + - text: The variable quotient should be equal to 2. testString: assert(quotient === 2); - - text: Use the / operator + - text: You should use the / operator. testString: assert(/\d+\s*\/\s*\d+/.test(code)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/global-vs.-local-scope-in-functions.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/global-vs.-local-scope-in-functions.english.md index e5064feb93..5424e40ed7 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/global-vs.-local-scope-in-functions.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/global-vs.-local-scope-in-functions.english.md @@ -32,11 +32,11 @@ Add a local variable to myOutfit function to override the value of ```yml tests: - - text: Do not change the value of the global outerWear + - text: You should not change the value of the global outerWear. testString: assert(outerWear === "T-Shirt"); - - text: myOutfit should return "sweater" + - text: myOutfit should return "sweater". testString: assert(myOutfit() === "sweater"); - - text: Do not change the return statement + - text: You should not change the return statement. testString: assert(/return outerWear/.test(code)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/increment-a-number-with-javascript.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/increment-a-number-with-javascript.english.md index 93e3cd9a0d..fd04edca6f 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/increment-a-number-with-javascript.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/increment-a-number-with-javascript.english.md @@ -26,13 +26,13 @@ Change the code to use the ++ operator on myVar. ```yml tests: - - text: myVar should equal 88 + - text: myVar should equal 88. testString: assert(myVar === 88); - - text: myVar = myVar + 1; should be changed + - text: myVar = myVar + 1; should be changed. testString: assert(/var\s*myVar\s*=\s*87;\s*\/*.*\s*([+]{2}\s*myVar|myVar\s*[+]{2});/.test(code)); - - text: Use the ++ operator + - text: You should use the ++ operator. testString: assert(/[+]{2}\s*myVar|myVar\s*[+]{2}/.test(code)); - - text: Do not change code above the line + - text: You should not change code above the specified comment. testString: assert(/var myVar = 87;/.test(code)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/initializing-variables-with-the-assignment-operator.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/initializing-variables-with-the-assignment-operator.english.md index 09885c4f92..bae80f1f31 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/initializing-variables-with-the-assignment-operator.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/initializing-variables-with-the-assignment-operator.english.md @@ -23,7 +23,7 @@ Define a variable a with var and initialize it to a va ```yml tests: - - text: Initialize a to a value of 9 + - text: You should initialize a to a value of 9. testString: assert(/var\s+a\s*=\s*9\s*/.test(code)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/introducing-else-statements.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/introducing-else-statements.english.md index b5d89bcae8..35f597db20 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/introducing-else-statements.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/introducing-else-statements.english.md @@ -40,9 +40,9 @@ tests: testString: assert(testElse(5) === "5 or Smaller"); - text: testElse(6) should return "Bigger than 5" testString: assert(testElse(6) === "Bigger than 5"); - - text: testElse(10) should return "Bigger than 5" + - text: testElse(10) should return "Bigger than 5". testString: assert(testElse(10) === "Bigger than 5"); - - text: Do not change the code above or below the lines. + - text: You should not change the code above or below the specified comments. testString: assert(/var result = "";/.test(code) && /return result;/.test(code)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-through-an-array-with-a-for-loop.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-through-an-array-with-a-for-loop.english.md index cb632c3d3a..7dd26b6914 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-through-an-array-with-a-for-loop.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-through-an-array-with-a-for-loop.english.md @@ -30,13 +30,13 @@ Declare and initialize a variable total to 0. Use a total should be declared and initialized to 0 + - text: total should be declared and initialized to 0. testString: assert(code.match(/(var|let|const)\s*?total\s*=\s*0.*?;?/)); - - text: total should equal 20 + - text: total should equal 20. testString: assert(total === 20); - - text: You should use a for loop to iterate through myArr + - text: You should use a for loop to iterate through myArr. testString: assert(code.match(/for\s*\(/g).length > 1 && code.match(/myArr\s*\[/)); - - text: Do not set total to 20 directly + - text: You should not set total to 20 directly. testString: assert(!code.match(/total[\s\+\-]*=\s*(0(?!\s*[;,]?$)|[1-9])/gm)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/local-scope-and-functions.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/local-scope-and-functions.english.md index 56b5045196..db92f8a0d8 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/local-scope-and-functions.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/local-scope-and-functions.english.md @@ -34,9 +34,9 @@ Declare a local variable myVar inside myLocalScope. Ru ```yml tests: - - text: No global myVar variable + - text: The code should not contain a global myVar variable. testString: assert(typeof myVar === 'undefined'); - - text: Add a local myVar variable + - text: You should add a local myVar variable. testString: assert(/function\s+myLocalScope\s*\(\s*\)\s*\{\s[\s\S]+\s*var\s*myVar\s*(\s*|=[\s\S]+)\s*;[\s\S]+}/.test(code)); diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/manipulate-arrays-with-pop.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/manipulate-arrays-with-pop.english.md index d9205ce61c..9d43b6fbbc 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/manipulate-arrays-with-pop.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/manipulate-arrays-with-pop.english.md @@ -33,7 +33,7 @@ Use the .pop() function to remove the last item from myArray< tests: - text: myArray should only contain [["John", 23]]. testString: assert((function(d){if(d[0][0] == 'John' && d[0][1] === 23 && d[1] == undefined){return true;}else{return false;}})(myArray)); - - text: Use pop() on myArray + - text: You should use pop() on myArray. testString: assert(/removedFromMyArray\s*=\s*myArray\s*.\s*pop\s*(\s*)/.test(code)); - text: removedFromMyArray should only contain ["cat", 2]. testString: assert((function(d){if(d[0] == 'cat' && d[1] === 2 && d[2] == undefined){return true;}else{return false;}})(removedFromMyArray)); diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/multiply-two-numbers-with-javascript.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/multiply-two-numbers-with-javascript.english.md index e56ebc4544..a0150f16ee 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/multiply-two-numbers-with-javascript.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/multiply-two-numbers-with-javascript.english.md @@ -30,9 +30,9 @@ Change the 0 so that product will equal 80. ```yml tests: - - text: Make the variable product equal 80 + - text: The variable product should be equal to 80. testString: assert(product === 80); - - text: Use the * operator + - text: You should use the * operator. testString: assert(/\*/.test(code)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/passing-values-to-functions-with-arguments.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/passing-values-to-functions-with-arguments.english.md index 2016f2326f..f1c9cf4503 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/passing-values-to-functions-with-arguments.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/passing-values-to-functions-with-arguments.english.md @@ -32,13 +32,13 @@ We have passed two arguments, "Hello" and "World". Ins ```yml tests: - - text: functionWithArgs should be a function + - text: functionWithArgs should be a function. testString: assert(typeof functionWithArgs === 'function'); - - text: functionWithArgs(1,2) should output 3 + - text: functionWithArgs(1,2) should output 3. testString: if(typeof functionWithArgs === "function") { capture(); functionWithArgs(1,2); uncapture(); } assert(logOutput == 3); - - text: functionWithArgs(7,9) should output 16 + - text: functionWithArgs(7,9) should output 16. testString: if(typeof functionWithArgs === "function") { capture(); functionWithArgs(7,9); uncapture(); } assert(logOutput == 16); - - text: Call functionWithArgs with two numbers after you define it. + - text: You should call functionWithArgs with two numbers after you define it. testString: assert(/^\s*functionWithArgs\s*\(\s*\d+\s*,\s*\d+\s*\)\s*/m.test(code)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/quoting-strings-with-single-quotes.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/quoting-strings-with-single-quotes.english.md index d8fc87fd57..b10c06f1f2 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/quoting-strings-with-single-quotes.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/quoting-strings-with-single-quotes.english.md @@ -43,9 +43,9 @@ Right now, the <a> tag in the string uses double quotes eve ```yml tests: - - text: Remove all the backslashes (\) + - text: You should remove all the backslashes (\). testString: assert(!/\\/g.test(code) && myStr.match('\\s*\\s*Link\\s*\\s*')); - - text: You should have two single quotes ' and four double quotes " + - text: You should have two single quotes ' and four double quotes ". testString: assert(code.match(/"/g).length === 4 && code.match(/'/g).length === 2); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/shopping-list.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/shopping-list.english.md index a2a397207d..e7287ab45b 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/shopping-list.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/shopping-list.english.md @@ -24,13 +24,13 @@ There should be at least 5 sub-arrays in the list. ```yml tests: - - text: myList should be an array + - text: myList should be an array. testString: assert(isArray); - - text: The first elements in each of your sub-arrays must all be strings + - text: The first elements in each of your sub-arrays should all be strings. testString: assert(hasString); - - text: The second elements in each of your sub-arrays must all be numbers + - text: The second elements in each of your sub-arrays should all be numbers. testString: assert(hasNumber); - - text: You must have at least 5 items in your list + - text: You should have at least 5 items in your list. testString: assert(count > 4); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/storing-values-with-the-assignment-operator.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/storing-values-with-the-assignment-operator.english.md index 933a307d24..478ecd3b29 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/storing-values-with-the-assignment-operator.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/storing-values-with-the-assignment-operator.english.md @@ -32,13 +32,13 @@ Assign the contents of a to variable b. ```yml tests: - - text: Do not change code above the line + - text: You should not change code above the specified comment. testString: assert(/var a;/.test(code) && /var b = 2;/.test(code)); - - text: a should have a value of 7 + - text: a should have a value of 7. testString: assert(typeof a === 'number' && a === 7); - - text: b should have a value of 7 + - text: b should have a value of 7. testString: assert(typeof b === 'number' && b === 7); - - text: a should be assigned to b with = + - text: a should be assigned to b with =. testString: assert(/b\s*=\s*a\s*;/g.test(code)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/subtract-one-number-from-another-with-javascript.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/subtract-one-number-from-another-with-javascript.english.md index 8b33390e05..cc0cf7513d 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/subtract-one-number-from-another-with-javascript.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/subtract-one-number-from-another-with-javascript.english.md @@ -30,9 +30,9 @@ Change the 0 so the difference is 12. ```yml tests: - - text: Make the variable difference equal 12. + - text: The variable difference should be equal to 12. testString: assert(difference === 12); - - text: Only subtract one number from 45. + - text: You should only subtract one number from 45. testString: assert(/var\s*difference\s*=\s*45\s*-\s*[0-9]*;(?!\s*[a-zA-Z0-9]+)/.test(code)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/understand-string-immutability.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/understand-string-immutability.english.md index 3b99c65d58..5575b79119 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/understand-string-immutability.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/understand-string-immutability.english.md @@ -35,9 +35,9 @@ Correct the assignment to myStr so it contains the string value of ```yml tests: - - text: myStr should have a value of Hello World + - text: myStr should have a value of Hello World. testString: assert(myStr === "Hello World"); - - text: Do not change the code above the line + - text: You should not change the code above the specified comment. testString: assert(/myStr = "Jello World"/.test(code)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-case-sensitivity-in-variables.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-case-sensitivity-in-variables.english.md index aa79cd845e..52f41397d2 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-case-sensitivity-in-variables.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-case-sensitivity-in-variables.english.md @@ -32,11 +32,11 @@ Modify the existing declarations and assignments so their names use camelCa ```yml tests: - - text: studlyCapVar is defined and has a value of 10 + - text: studlyCapVar should be defined and have a value of 10. testString: assert(typeof studlyCapVar !== 'undefined' && studlyCapVar === 10); - - text: properCamelCase is defined and has a value of "A String" + - text: properCamelCase should be defined and have a value of "A String". testString: assert(typeof properCamelCase !== 'undefined' && properCamelCase === "A String"); - - text: titleCaseOver is defined and has a value of 9000 + - text: titleCaseOver should be defined and have a value of 9000. testString: assert(typeof titleCaseOver !== 'undefined' && titleCaseOver === 9000); - text: studlyCapVar should use camelCase in both declaration and assignment sections. testString: assert(code.match(/studlyCapVar/g).length === 2); diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-undefined-value-returned-from-a-function.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-undefined-value-returned-from-a-function.english.md index f1d872ac2b..67187f61fe 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-undefined-value-returned-from-a-function.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-undefined-value-returned-from-a-function.english.md @@ -32,13 +32,13 @@ Create a function addFive without any arguments. This function adds ```yml tests: - - text: addFive should be a function + - text: addFive should be a function. testString: assert(typeof addFive === 'function'); - - text: Once both functions have ran, the sum should be equal to 8 + - text: Once both functions have ran, the sum should be equal to 8. testString: assert(sum === 8); - - text: Returned value from addFive should be undefined + - text: Returned value from addFive should be undefined. testString: assert(addFive() === undefined); - - text: Inside the addFive function, add 5 to the sum variable + - text: Inside the addFive function, you should add 5 to the sum variable. testString: assert(addFive.toString().replace(/\s/g, '').match(/sum=sum\+5|sum\+=5/)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-uninitialized-variables.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-uninitialized-variables.english.md index 5f7ac47c3b..4b12ac9efb 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-uninitialized-variables.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-uninitialized-variables.english.md @@ -21,13 +21,13 @@ Initialize the three variables a, b, and ca should be defined and evaluated to have the value of 6 + - text: a should be defined and evaluated to have the value of 6. testString: assert(typeof a === 'number' && a === 6); - - text: b should be defined and evaluated to have the value of 15 + - text: b should be defined and evaluated to have the value of 15. testString: assert(typeof b === 'number' && b === 15); - text: c should not contain undefined and should have a value of "I am a String!" testString: assert(!/undefined/.test(c) && c === "I am a String!"); - - text: Do not change code below the line + - text: You should not change code below the specified comment. testString: assert(/a = a \+ 1;/.test(code) && /b = b \+ 5;/.test(code) && /c = c \+ " String!";/.test(code)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/updating-object-properties.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/updating-object-properties.english.md index 1d4e805024..16183a063d 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/updating-object-properties.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/updating-object-properties.english.md @@ -36,9 +36,9 @@ Update the myDog object's name property. Let's change her name from ```yml tests: - - text: Update myDog's "name" property to equal "Happy Coder". + - text: You should update myDog's "name" property to equal "Happy Coder". testString: assert(/happy coder/gi.test(myDog.name)); - - text: Do not edit the myDog definition + - text: You should not edit the myDog definition. testString: 'assert(/"name": "Coder"/.test(code));' ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-last-character-in-a-string.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-last-character-in-a-string.english.md index 83f08194a8..e71d836080 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-last-character-in-a-string.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-last-character-in-a-string.english.md @@ -25,7 +25,7 @@ Use bracket notation to find the last character in the lastName tests: - text: lastLetterOfLastName should be "e". testString: assert(lastLetterOfLastName === "e"); - - text: You have to use .length to get the last letter. + - text: You should use .length to get the last letter. testString: assert(code.match(/\.length/g).length === 2); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-nth-to-last-character-in-a-string.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-nth-to-last-character-in-a-string.english.md index f677d74227..f987b861c7 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-nth-to-last-character-in-a-string.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-nth-to-last-character-in-a-string.english.md @@ -25,7 +25,7 @@ Use bracket notation to find the second-to-last character in the secondToLastLetterOfLastName should be "c". testString: assert(secondToLastLetterOfLastName === 'c'); - - text: You have to use .length to get the second last letter. + - text: You should use .length to get the second last letter. testString: assert(code.match(/\.length/g).length === 2); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/write-reusable-javascript-with-functions.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/write-reusable-javascript-with-functions.english.md index 63055a6769..0f90f62fff 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/write-reusable-javascript-with-functions.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/write-reusable-javascript-with-functions.english.md @@ -32,11 +32,11 @@ Each time the function is called it will print out the message "Hello Worl ```yml tests: - - text: reusableFunction should be a function + - text: reusableFunction should be a function. testString: assert(typeof reusableFunction === 'function'); - - text: reusableFunction should output "Hi World" to the dev console + - text: reusableFunction should output "Hi World" to the dev console. testString: assert(hiWorldWasLogged); - - text: Call reusableFunction after you define it + - text: You should call reusableFunction after you define it. testString: assert(/^\s*reusableFunction\(\)\s*/m.test(code)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-use-of-assignment-operator-instead-of-equality-operator.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-use-of-assignment-operator-instead-of-equality-operator.english.md index 1829f1eab9..8d0435e6b0 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-use-of-assignment-operator-instead-of-equality-operator.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-use-of-assignment-operator-instead-of-equality-operator.english.md @@ -36,7 +36,7 @@ Fix the condition so the program runs the right branch, and the appropriate valu tests: - text: Your code should fix the condition so it checks for equality, instead of using assignment. testString: assert(result == "Not equal!"); - - text: The condition can use either == or === to test for equality. + - text: The condition should use either == or === to test for equality. testString: assert(code.match(/x\s*?===?\s*?y/g)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/understanding-the-differences-between-the-freecodecamp-and-browser-console.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/understanding-the-differences-between-the-freecodecamp-and-browser-console.english.md index 5cf97fbeaf..4fc79352b9 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/understanding-the-differences-between-the-freecodecamp-and-browser-console.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/understanding-the-differences-between-the-freecodecamp-and-browser-console.english.md @@ -25,9 +25,9 @@ First, use console.clear() to clear the browser console. After that ```yml tests: - - text: Use console.clear() to clear the browser console. + - text: You should use console.clear() to clear the browser console. testString: const removeJSComments = code.replace(/\/\*[\s\S]*?\*\/|\/\/.*$/gm, ''); const noSpaces = removeJSComments.replace(/\s/g, ''); assert(noSpaces.match(/console.clear\(\)/)); - - text: Use console.log() to print the output variable. + - text: You should use console.log() to print the output variable. testString: const noSpaces = code.replace(/\s/g, ''); assert(noSpaces.match(/console\.log\(output\)/)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/create-strings-using-template-literals.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/create-strings-using-template-literals.english.md index 8e5abdcddd..7b8d7bf4c5 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/create-strings-using-template-literals.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/create-strings-using-template-literals.english.md @@ -47,11 +47,11 @@ Use an iterator method (any kind of loop) to get the desired output. tests: - text: resultDisplayArray should be an array containing result failure messages. testString: assert(typeof makeList(result.failure) === 'object' && resultDisplayArray.length === 3); - - text: resultDisplayArray is the desired output. + - text: resultDisplayArray should be equal to the specified output. testString: assert(makeList(result.failure).every((v, i) => v === `
  • ${result.failure[i]}
  • ` || v === `
  • ${result.failure[i]}
  • `)); - - text: Template strings and expression interpolation should be used + - text: Template strings and expression interpolation should be used. testString: getUserInput => assert(getUserInput('index').match(/(`.*\${.*}.*`)/)); - - text: An iterator should be used + - text: An iterator should be used. testString: getUserInput => assert(getUserInput('index').match(/for|map|reduce|forEach|while/)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/declare-a-read-only-variable-with-the-const-keyword.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/declare-a-read-only-variable-with-the-const-keyword.english.md index e411faea6f..07bfa86ed2 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/declare-a-read-only-variable-with-the-const-keyword.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/declare-a-read-only-variable-with-the-const-keyword.english.md @@ -31,7 +31,7 @@ Change the code so that all variables are declared using let or var
    does not exist in your code. + - text: var should not exist in your code. testString: getUserInput => assert(!getUserInput('index').match(/var/g)); - text: SENTENCE should be a constant variable declared with const. testString: getUserInput => assert(getUserInput('index').match(/(const SENTENCE)/g)); diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/explore-differences-between-the-var-and-let-keywords.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/explore-differences-between-the-var-and-let-keywords.english.md index 9400b9ba5a..9869fb777d 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/explore-differences-between-the-var-and-let-keywords.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/explore-differences-between-the-var-and-let-keywords.english.md @@ -48,7 +48,7 @@ Update the code so it only uses the let keyword. ```yml tests: - - text: var does not exist in code. + - text: var should not exist in the code. testString: getUserInput => assert(!getUserInput('index').match(/var/g)); - text: catName should be Oliver. testString: assert(catName === "Oliver"); diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/mutate-an-array-declared-with-const.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/mutate-an-array-declared-with-const.english.md index 8241bc5145..df730af4f2 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/mutate-an-array-declared-with-const.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/mutate-an-array-declared-with-const.english.md @@ -32,11 +32,11 @@ An array is declared as const s = [5, 7, 2]. Change the array to const keyword. + - text: You should not replace const keyword. testString: getUserInput => assert(getUserInput('index').match(/const/g)); - text: s should be a constant variable (by using const). testString: getUserInput => assert(getUserInput('index').match(/const\s+s/g)); - - text: Do not change the original array declaration. + - text: You should not change the original array declaration. testString: getUserInput => assert(getUserInput('index').match(/const\s+s\s*=\s*\[\s*5\s*,\s*7\s*,\s*2\s*\]\s*;?/g)); - text: s should be equal to [2, 5, 7]. testString: assert.deepEqual(s, [2, 5, 7]); diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/prevent-object-mutation.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/prevent-object-mutation.english.md index fe036ca8d7..f295ed1f59 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/prevent-object-mutation.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/prevent-object-mutation.english.md @@ -34,13 +34,13 @@ In this challenge you are going to use Object.freeze to prevent mat ```yml tests: - - text: Do not replace const keyword. + - text: You should not replace const keyword. testString: getUserInput => assert(getUserInput('index').match(/const/g)); - text: MATH_CONSTANTS should be a constant variable (by using const). testString: getUserInput => assert(getUserInput('index').match(/const\s+MATH_CONSTANTS/g)); - - text: Do not change original MATH_CONSTANTS. + - text: You should not change original MATH_CONSTANTS. testString: getUserInput => assert(getUserInput('index').match(/const\s+MATH_CONSTANTS\s+=\s+{\s+PI:\s+3.14\s+};/g)); - - text: PI equals 3.14. + - text: PI should equal 3.14. testString: assert(PI === 3.14); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/set-default-parameters-for-your-functions.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/set-default-parameters-for-your-functions.english.md index bbd72b1c87..6ef6e1e18f 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/set-default-parameters-for-your-functions.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/set-default-parameters-for-your-functions.english.md @@ -34,7 +34,7 @@ tests: testString: assert(increment(5, 2) === 7); - text: The result of increment(5) should be 6. testString: assert(increment(5) === 6); - - text: Default parameter 1 was used for value. + - text: A default parameter value of 1 should be used for value. testString: assert(code.match(/value\s*=\s*1/g)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use--to-import-everything-from-a-file.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use--to-import-everything-from-a-file.english.md index 7b96808d86..06745281d5 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use--to-import-everything-from-a-file.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use--to-import-everything-from-a-file.english.md @@ -32,7 +32,7 @@ The code in this file requires the contents of the file: string_functions. ```yml tests: - - text: Properly uses import * as syntax. + - text: Your code should properly use import * as syntax. testString: assert(code.match(/import\s*\*\s*as\s+stringFunctions\s+from\s*('|")\.\/string_functions\.js\1/g)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-arrays.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-arrays.english.md index 087420cc03..6358e902f2 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-arrays.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-arrays.english.md @@ -40,7 +40,7 @@ tests: testString: assert(a === 6); - text: Value of b should be 8, after swapping. testString: assert(b === 8); - - text: Should use array destructuring to swap a and b. + - text: You should use array destructuring to swap a and b. testString: assert(/\[\s*(\w)\s*,\s*(\w)\s*\]\s*=\s*\[\s*\2\s*,\s*\1\s*\]/g.test(code)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-the-spread-operator-to-evaluate-arrays-in-place.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-the-spread-operator-to-evaluate-arrays-in-place.english.md index 91399c12de..6cdb201b1b 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-the-spread-operator-to-evaluate-arrays-in-place.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-the-spread-operator-to-evaluate-arrays-in-place.english.md @@ -44,7 +44,7 @@ Copy all contents of arr1 into another array arr2 usin tests: - text: arr2 should be correct copy of arr1. testString: assert(arr2.every((v, i) => v === arr1[i])); - - text: ... spread operator was used to duplicate arr1. + - text: ... spread operator should be used to duplicate arr1. testString: assert(code.match(/Array\(\s*\.\.\.arr1\s*\)|\[\s*\.\.\.arr1\s*\]/)); - text: arr2 should remain unchanged when arr1 is changed. testString: assert((arr1, arr2) => {arr1.push('JUN'); return arr2.length < arr1.length}); diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/write-arrow-functions-with-parameters.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/write-arrow-functions-with-parameters.english.md index b20e0cc565..76eceb470f 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/write-arrow-functions-with-parameters.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/write-arrow-functions-with-parameters.english.md @@ -40,15 +40,15 @@ Rewrite the myConcat function which appends contents of arr2< ```yml tests: - - text: User did replace var keyword. + - text: You should replace the var keyword. testString: getUserInput => assert(!getUserInput('index').match(/var/g)); - text: myConcat should be a constant variable (by using const). testString: getUserInput => assert(getUserInput('index').match(/const\s+myConcat/g)); - - text: myConcat should be a function + - text: myConcat should be a function. testString: assert(typeof myConcat === 'function'); - - text: myConcat() returns the correct array + - text: myConcat() should return [1, 2, 3, 4, 5]. testString: assert(() => { const a = myConcat([1], [2]); return a[0] == 1 && a[1] == 2; }); - - text: function keyword was not used. + - text: function keyword should not be used. testString: getUserInput => assert(!getUserInput('index').match(/function/g)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/iterate-over-all-properties.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/iterate-over-all-properties.english.md index edcb44c7c1..016c618645 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/iterate-over-all-properties.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/iterate-over-all-properties.english.md @@ -53,7 +53,7 @@ tests: testString: assert(ownProps.indexOf('name') !== -1); - text: The prototypeProps array should include "numLegs". testString: assert(prototypeProps.indexOf('numLegs') !== -1); - - text: Solve this challenge without using the built in method Object.keys(). + - text: You should solve this challenge without using the built in method Object.keys(). testString: assert(!/\Object.keys/.test(code)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-own-properties.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-own-properties.english.md index 94fac04bd4..45db91989a 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-own-properties.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-own-properties.english.md @@ -49,9 +49,9 @@ Add the own properties of canary to the array ow tests: - text: ownProps should include the values "numLegs" and "name". testString: assert(ownProps.indexOf('name') !== -1 && ownProps.indexOf('numLegs') !== -1); - - text: Solve this challenge without using the built in method Object.keys(). + - text: You should solve this challenge without using the built in method Object.keys(). testString: assert(!/Object(\.keys|\[(['"`])keys\2\])/.test(code)); - - text: Solve this challenge without hardcoding the ownProps array. + - text: You should solve this challenge without hardcoding the ownProps array. testString: assert(!/\[\s*(?:'|")(?:name|numLegs)|(?:push|concat)\(\s*(?:'|")(?:name|numLegs)/.test(code)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-where-an-objects-prototype-comes-from.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-where-an-objects-prototype-comes-from.english.md index 279326b133..1137a9e0c0 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-where-an-objects-prototype-comes-from.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-where-an-objects-prototype-comes-from.english.md @@ -36,7 +36,7 @@ Use isPrototypeOf to check the prototype of beag ```yml tests: - - text: Show that Dog.prototype is the prototype of beagle + - text: You should show that Dog.prototype is the prototype of beagle testString: assert(/Dog\.prototype\.isPrototypeOf\(beagle\)/.test(code)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/verify-an-objects-constructor-with-instanceof.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/verify-an-objects-constructor-with-instanceof.english.md index 78afa7bae9..d4ca431dfc 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/verify-an-objects-constructor-with-instanceof.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/verify-an-objects-constructor-with-instanceof.english.md @@ -47,7 +47,7 @@ Create a new instance of the House constructor, calling it my tests: - text: myHouse should have a numBedrooms attribute set to a number. testString: assert(typeof myHouse.numBedrooms === 'number'); - - text: Be sure to verify that myHouse is an instance of House using the instanceof operator. + - text: You should verify that myHouse is an instance of House using the instanceof operator. testString: assert(/myHouse\s*instanceof\s*House/.test(code)); ```