diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/boo-who.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/boo-who.english.md index 989b0b02df..6846ae304b 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/boo-who.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/boo-who.english.md @@ -23,25 +23,25 @@ Remember to use booWho(true) should return true.'); + testString: assert.strictEqual(booWho(true), true); - text: booWho(false) should return true. - testString: assert.strictEqual(booWho(false), true, 'booWho(false) should return true.'); + testString: assert.strictEqual(booWho(false), true); - text: booWho([1, 2, 3]) should return false. - testString: assert.strictEqual(booWho([1, 2, 3]), false, 'booWho([1, 2, 3]) should return false.'); + testString: assert.strictEqual(booWho([1, 2, 3]), false); - text: booWho([].slice) should return false. - testString: assert.strictEqual(booWho([].slice), false, 'booWho([].slice) should return false.'); + testString: assert.strictEqual(booWho([].slice), false); - text: 'booWho({ "a": 1 }) should return false.' testString: 'assert.strictEqual(booWho({ "a": 1 }), false, ''booWho({ "a": 1 }) should return false.'');' - text: booWho(1) should return false. - testString: assert.strictEqual(booWho(1), false, 'booWho(1) should return false.'); + testString: assert.strictEqual(booWho(1), false); - text: booWho(NaN) should return false. - testString: assert.strictEqual(booWho(NaN), false, 'booWho(NaN) should return false.'); + testString: assert.strictEqual(booWho(NaN), false); - text: booWho("a") should return false. - testString: assert.strictEqual(booWho("a"), false, 'booWho("a") should return false.'); + testString: assert.strictEqual(booWho("a"), false); - text: booWho("true") should return false. - testString: assert.strictEqual(booWho("true"), false, 'booWho("true") should return false.'); + testString: assert.strictEqual(booWho("true"), false); - text: booWho("false") should return false. - testString: assert.strictEqual(booWho("false"), false, 'booWho("false") should return false.'); + testString: assert.strictEqual(booWho("false"), false); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/chunky-monkey.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/chunky-monkey.english.md index dadf004d59..9bccad2fbe 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/chunky-monkey.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/chunky-monkey.english.md @@ -22,19 +22,19 @@ Remember to use should return [["a", "b"], ["c", "d"]]. - testString: assert.deepEqual(chunkArrayInGroups(["a", "b", "c", "d"], 2), [["a", "b"], ["c", "d"]], 'chunkArrayInGroups(["a", "b", "c", "d"], 2) should return [["a", "b"], ["c", "d"]].'); + testString: assert.deepEqual(chunkArrayInGroups(["a", "b", "c", "d"], 2), [["a", "b"], ["c", "d"]]); - text: chunkArrayInGroups([0, 1, 2, 3, 4, 5], 3) should return [[0, 1, 2], [3, 4, 5]]. - testString: assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5], 3), [[0, 1, 2], [3, 4, 5]], 'chunkArrayInGroups([0, 1, 2, 3, 4, 5], 3) should return [[0, 1, 2], [3, 4, 5]].'); + testString: assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5], 3), [[0, 1, 2], [3, 4, 5]]); - text: chunkArrayInGroups([0, 1, 2, 3, 4, 5], 2) should return [[0, 1], [2, 3], [4, 5]]. - testString: assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5], 2), [[0, 1], [2, 3], [4, 5]], 'chunkArrayInGroups([0, 1, 2, 3, 4, 5], 2) should return [[0, 1], [2, 3], [4, 5]].'); + testString: assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5], 2), [[0, 1], [2, 3], [4, 5]]); - text: chunkArrayInGroups([0, 1, 2, 3, 4, 5], 4) should return [[0, 1, 2, 3], [4, 5]]. - testString: assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5], 4), [[0, 1, 2, 3], [4, 5]], 'chunkArrayInGroups([0, 1, 2, 3, 4, 5], 4) should return [[0, 1, 2, 3], [4, 5]].'); + testString: assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5], 4), [[0, 1, 2, 3], [4, 5]]); - text: chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6], 3) should return [[0, 1, 2], [3, 4, 5], [6]]. - testString: assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6], 3), [[0, 1, 2], [3, 4, 5], [6]], 'chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6], 3) should return [[0, 1, 2], [3, 4, 5], [6]].'); + testString: assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6], 3), [[0, 1, 2], [3, 4, 5], [6]]); - text: chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 4) should return [[0, 1, 2, 3], [4, 5, 6, 7], [8]]. - testString: assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 4), [[0, 1, 2, 3], [4, 5, 6, 7], [8]], 'chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 4) should return [[0, 1, 2, 3], [4, 5, 6, 7], [8]].'); + testString: assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 4), [[0, 1, 2, 3], [4, 5, 6, 7], [8]]); - text: chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 2) should return [[0, 1], [2, 3], [4, 5], [6, 7], [8]]. - testString: assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 2), [[0, 1], [2, 3], [4, 5], [6, 7], [8]], 'chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 2) should return [[0, 1], [2, 3], [4, 5], [6, 7], [8]].'); + testString: assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 2), [[0, 1], [2, 3], [4, 5], [6, 7], [8]]); ``` 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 1ca7ae2ba5..63b8c1b5e6 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 @@ -23,27 +23,27 @@ Remember to use should return true. - testString: assert(confirmEnding("Bastian", "n") === true, 'confirmEnding("Bastian", "n") should return true.'); + testString: assert(confirmEnding("Bastian", "n") === true); - text: confirmEnding("Congratulation", "on") should return true. - testString: assert(confirmEnding("Congratulation", "on") === true, 'confirmEnding("Congratulation", "on") should return true.'); + testString: assert(confirmEnding("Congratulation", "on") === true); - text: confirmEnding("Connor", "n") should return false. - testString: assert(confirmEnding("Connor", "n") === false, 'confirmEnding("Connor", "n") should return false.'); + testString: assert(confirmEnding("Connor", "n") === false); - text: confirmEnding("Walking on water and developing software from a specification are easy if both are frozen", "specification") should return false. - testString: assert(confirmEnding("Walking on water and developing software from a specification are easy if both are frozen", "specification") === false, 'confirmEnding("Walking on water and developing software from a specification are easy if both are frozen", "specification") should return false.'); + testString: assert(confirmEnding("Walking on water and developing software from a specification are easy if both are frozen", "specification") === false); - text: confirmEnding("He has to give me a new name", "name") should return true. - testString: assert(confirmEnding("He has to give me a new name", "name") === true, 'confirmEnding("He has to give me a new name", "name") should return true.'); + testString: assert(confirmEnding("He has to give me a new name", "name") === true); - text: confirmEnding("Open sesame", "same") should return true. - testString: assert(confirmEnding("Open sesame", "same") === true, 'confirmEnding("Open sesame", "same") should return true.'); + testString: assert(confirmEnding("Open sesame", "same") === true); - text: confirmEnding("Open sesame", "pen") should return false. - testString: assert(confirmEnding("Open sesame", "pen") === false, 'confirmEnding("Open sesame", "pen") should return false.'); + testString: assert(confirmEnding("Open sesame", "pen") === false); - text: confirmEnding("Open sesame", "game") should return false. - testString: assert(confirmEnding("Open sesame", "game") === false, 'confirmEnding("Open sesame", "game") should return false.'); + testString: assert(confirmEnding("Open sesame", "game") === false); - text: confirmEnding("If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing", "mountain") should return false. - 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, 'confirmEnding("If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing", "mountain") should return false.'); + 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, '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. - testString: assert(!(/\.endsWith\(.*?\)\s*?;?/.test(code)) && !(/\['endsWith'\]/.test(code)), 'Do 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-algorithm-scripting/convert-celsius-to-fahrenheit.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/convert-celsius-to-fahrenheit.english.md index 810752f734..c26c360dc9 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/convert-celsius-to-fahrenheit.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/convert-celsius-to-fahrenheit.english.md @@ -23,17 +23,17 @@ Don't worry too much about the function and return statements as they will be co ```yml tests: - text: convertToF(0) should return a number - testString: assert(typeof convertToF(0) === 'number', 'convertToF(0) should return a number'); + testString: assert(typeof convertToF(0) === 'number'); - text: convertToF(-30) should return a value of -22 - testString: assert(convertToF(-30) === -22, 'convertToF(-30) should return a value of -22'); + testString: assert(convertToF(-30) === -22); - text: convertToF(-10) should return a value of 14 - testString: assert(convertToF(-10) === 14, 'convertToF(-10) should return a value of 14'); + testString: assert(convertToF(-10) === 14); - text: convertToF(0) should return a value of 32 - testString: assert(convertToF(0) === 32, 'convertToF(0) should return a value of 32'); + testString: assert(convertToF(0) === 32); - text: convertToF(20) should return a value of 68 - testString: assert(convertToF(20) === 68, 'convertToF(20) should return a value of 68'); + testString: assert(convertToF(20) === 68); - text: convertToF(30) should return a value of 86 - testString: assert(convertToF(30) === 86, 'convertToF(30) should return a value of 86'); + testString: assert(convertToF(30) === 86); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/factorialize-a-number.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/factorialize-a-number.english.md index 68fb5bd608..327a4a8066 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/factorialize-a-number.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/factorialize-a-number.english.md @@ -26,15 +26,15 @@ Remember to use bouncer([7, "ate", "", false, 9]) should return [7, "ate", 9]. - testString: assert.deepEqual(bouncer([7, "ate", "", false, 9]), [7, "ate", 9], 'bouncer([7, "ate", "", false, 9]) should return [7, "ate", 9].'); + testString: assert.deepEqual(bouncer([7, "ate", "", false, 9]), [7, "ate", 9]); - text: bouncer(["a", "b", "c"]) should return ["a", "b", "c"]. - testString: assert.deepEqual(bouncer(["a", "b", "c"]), ["a", "b", "c"], 'bouncer(["a", "b", "c"]) should return ["a", "b", "c"].'); + testString: assert.deepEqual(bouncer(["a", "b", "c"]), ["a", "b", "c"]); - text: bouncer([false, null, 0, NaN, undefined, ""]) should return []. - testString: assert.deepEqual(bouncer([false, null, 0, NaN, undefined, ""]), [], 'bouncer([false, null, 0, NaN, undefined, ""]) should return [].'); + testString: assert.deepEqual(bouncer([false, null, 0, NaN, undefined, ""]), []); - text: bouncer([1, null, NaN, 2, undefined]) should return [1, 2]. - testString: assert.deepEqual(bouncer([1, null, NaN, 2, undefined]), [1, 2], 'bouncer([1, null, NaN, 2, undefined]) should return [1, 2].'); + testString: assert.deepEqual(bouncer([1, null, NaN, 2, undefined]), [1, 2]); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/find-the-longest-word-in-a-string.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/find-the-longest-word-in-a-string.english.md index fda8d10811..40cde894d3 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/find-the-longest-word-in-a-string.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/find-the-longest-word-in-a-string.english.md @@ -23,17 +23,17 @@ Remember to use should return a number. - testString: assert(typeof findLongestWordLength("The quick brown fox jumped over the lazy dog") === "number", 'findLongestWordLength("The quick brown fox jumped over the lazy dog") should return a number.'); + testString: assert(typeof findLongestWordLength("The quick brown fox jumped over the lazy dog") === "number"); - text: findLongestWordLength("The quick brown fox jumped over the lazy dog") should return 6. - testString: assert(findLongestWordLength("The quick brown fox jumped over the lazy dog") === 6, 'findLongestWordLength("The quick brown fox jumped over the lazy dog") should return 6.'); + testString: assert(findLongestWordLength("The quick brown fox jumped over the lazy dog") === 6); - text: findLongestWordLength("May the force be with you") should return 5. - testString: assert(findLongestWordLength("May the force be with you") === 5, 'findLongestWordLength("May the force be with you") should return 5.'); + testString: assert(findLongestWordLength("May the force be with you") === 5); - text: findLongestWordLength("Google do a barrel roll") should return 6. - testString: assert(findLongestWordLength("Google do a barrel roll") === 6, 'findLongestWordLength("Google do a barrel roll") should return 6.'); + testString: assert(findLongestWordLength("Google do a barrel roll") === 6); - text: findLongestWordLength("What is the average airspeed velocity of an unladen swallow") should return 8. - testString: assert(findLongestWordLength("What is the average airspeed velocity of an unladen swallow") === 8, 'findLongestWordLength("What is the average airspeed velocity of an unladen swallow") should return 8.'); + testString: assert(findLongestWordLength("What is the average airspeed velocity of an unladen swallow") === 8); - text: findLongestWordLength("What if we try a super-long word such as otorhinolaryngology") should return 19. - testString: assert(findLongestWordLength("What if we try a super-long word such as otorhinolaryngology") === 19, 'findLongestWordLength("What if we try a super-long word such as otorhinolaryngology") should return 19.'); + testString: assert(findLongestWordLength("What if we try a super-long word such as otorhinolaryngology") === 19); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/finders-keepers.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/finders-keepers.english.md index 176b839075..f9f3747541 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/finders-keepers.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/finders-keepers.english.md @@ -22,9 +22,9 @@ Remember to use findElement([1, 3, 5, 8, 9, 10], function(num) { return num % 2 === 0; }) should return 8.'); + testString: assert.strictEqual(findElement([1, 3, 5, 8, 9, 10], function(num) { return num % 2 === 0; }), 8); - text: findElement([1, 3, 5, 9], function(num) { return num % 2 === 0; }) should return undefined. - testString: assert.strictEqual(findElement([1, 3, 5, 9], function(num) { return num % 2 === 0; }), undefined, 'findElement([1, 3, 5, 9], function(num) { return num % 2 === 0; }) should return undefined.'); + testString: assert.strictEqual(findElement([1, 3, 5, 9], function(num) { return num % 2 === 0; }), undefined); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/mutations.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/mutations.english.md index 24aa3cd081..dce4d97acf 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/mutations.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/mutations.english.md @@ -25,23 +25,23 @@ Remember to use should return false. - testString: assert(mutation(["hello", "hey"]) === false, 'mutation(["hello", "hey"]) should return false.'); + testString: assert(mutation(["hello", "hey"]) === false); - text: mutation(["hello", "Hello"]) should return true. - testString: assert(mutation(["hello", "Hello"]) === true, 'mutation(["hello", "Hello"]) should return true.'); + testString: assert(mutation(["hello", "Hello"]) === true); - text: mutation(["zyxwvutsrqponmlkjihgfedcba", "qrstu"]) should return true. - testString: assert(mutation(["zyxwvutsrqponmlkjihgfedcba", "qrstu"]) === true, 'mutation(["zyxwvutsrqponmlkjihgfedcba", "qrstu"]) should return true.'); + testString: assert(mutation(["zyxwvutsrqponmlkjihgfedcba", "qrstu"]) === true); - text: mutation(["Mary", "Army"]) should return true. - testString: assert(mutation(["Mary", "Army"]) === true, 'mutation(["Mary", "Army"]) should return true.'); + testString: assert(mutation(["Mary", "Army"]) === true); - text: mutation(["Mary", "Aarmy"]) should return true. - testString: assert(mutation(["Mary", "Aarmy"]) === true, 'mutation(["Mary", "Aarmy"]) should return true.'); + testString: assert(mutation(["Mary", "Aarmy"]) === true); - text: mutation(["Alien", "line"]) should return true. - testString: assert(mutation(["Alien", "line"]) === true, 'mutation(["Alien", "line"]) should return true.'); + testString: assert(mutation(["Alien", "line"]) === true); - text: mutation(["floor", "for"]) should return true. - testString: assert(mutation(["floor", "for"]) === true, 'mutation(["floor", "for"]) should return true.'); + testString: assert(mutation(["floor", "for"]) === true); - text: mutation(["hello", "neo"]) should return false. - testString: assert(mutation(["hello", "neo"]) === false, 'mutation(["hello", "neo"]) should return false.'); + testString: assert(mutation(["hello", "neo"]) === false); - text: mutation(["voodoo", "no"]) should return false. - testString: assert(mutation(["voodoo", "no"]) === false, 'mutation(["voodoo", "no"]) should return false.'); + testString: assert(mutation(["voodoo", "no"]) === false); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/return-largest-numbers-in-arrays.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/return-largest-numbers-in-arrays.english.md index 041701ab8b..cffa7b5ff0 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/return-largest-numbers-in-arrays.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/return-largest-numbers-in-arrays.english.md @@ -23,13 +23,13 @@ Remember to use reverseString("hello") should return a string. - testString: assert(typeof reverseString("hello") === "string", 'reverseString("hello") should return a string.'); + testString: assert(typeof reverseString("hello") === "string"); - text: reverseString("hello") should become "olleh". - testString: assert(reverseString("hello") === "olleh", 'reverseString("hello") should become "olleh".'); + testString: assert(reverseString("hello") === "olleh"); - text: reverseString("Howdy") should become "ydwoH". - testString: assert(reverseString("Howdy") === "ydwoH", 'reverseString("Howdy") should become "ydwoH".'); + testString: assert(reverseString("Howdy") === "ydwoH"); - text: reverseString("Greetings from Earth") should return "htraE morf sgniteerG". - testString: assert(reverseString("Greetings from Earth") === "htraE morf sgniteerG", 'reverseString("Greetings from Earth") should return "htraE morf sgniteerG".'); + testString: assert(reverseString("Greetings from Earth") === "htraE morf sgniteerG"); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/slice-and-splice.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/slice-and-splice.english.md index 44890ae83d..d304557adb 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/slice-and-splice.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/slice-and-splice.english.md @@ -26,17 +26,17 @@ Remember to use should return ["a", 1, 2, "b"]. - testString: assert.deepEqual(frankenSplice(testArr1, testArr2, 1), ["a", 1, 2, "b"], 'frankenSplice([1, 2], ["a", "b"], 1) should return ["a", 1, 2, "b"].'); + testString: assert.deepEqual(frankenSplice(testArr1, testArr2, 1), ["a", 1, 2, "b"]); - text: frankenSplice(["claw", "tentacle"], ["head", "shoulders", "knees", "toes"], 2) should return ["head", "shoulders", "claw", "tentacle", "knees", "toes"]. - testString: assert.deepEqual(frankenSplice(["claw", "tentacle"], ["head", "shoulders", "knees", "toes"], 2), ["head", "shoulders", "claw", "tentacle", "knees", "toes"], 'frankenSplice(["claw", "tentacle"], ["head", "shoulders", "knees", "toes"], 2) should return ["head", "shoulders", "claw", "tentacle", "knees", "toes"].'); + testString: assert.deepEqual(frankenSplice(["claw", "tentacle"], ["head", "shoulders", "knees", "toes"], 2), ["head", "shoulders", "claw", "tentacle", "knees", "toes"]); - text: All elements from the first array should be added to the second array in their original order. - testString: assert.deepEqual(frankenSplice([1, 2, 3, 4], [], 0), [1, 2, 3, 4], 'All elements from the first array should be added to the second array in their original order.'); + testString: assert.deepEqual(frankenSplice([1, 2, 3, 4], [], 0), [1, 2, 3, 4]); - text: The first array should remain the same after the function runs. - testString: assert(testArr1[0] === 1 && testArr1[1] === 2, 'The first array should remain the same after the function runs.'); + testString: assert(testArr1[0] === 1 && testArr1[1] === 2); - text: The second array should remain the same after the function runs. - testString: assert(testArr2[0] === "a" && testArr2[1] === "b", 'The second array should remain the same after the function runs.'); + testString: assert(testArr2[0] === "a" && testArr2[1] === "b"); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/title-case-a-sentence.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/title-case-a-sentence.english.md index 2a99ebfe11..bb2b57a671 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/title-case-a-sentence.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/title-case-a-sentence.english.md @@ -23,13 +23,13 @@ Remember to use should return a string. - testString: assert(typeof titleCase("I'm a little tea pot") === "string", 'titleCase("I'm a little tea pot") should return a string.'); + testString: assert(typeof titleCase("I'm a little tea pot") === "string"); - text: titleCase("I'm a little tea pot") should return I'm A Little Tea Pot. - testString: assert(titleCase("I'm a little tea pot") === "I'm A Little Tea Pot", 'titleCase("I'm a little tea pot") should return I'm A Little Tea Pot.'); + testString: assert(titleCase("I'm a little tea pot") === "I'm A Little Tea Pot"); - text: titleCase("sHoRt AnD sToUt") should return Short And Stout. - testString: assert(titleCase("sHoRt AnD sToUt") === "Short And Stout", 'titleCase("sHoRt AnD sToUt") should return Short And Stout.'); + testString: assert(titleCase("sHoRt AnD sToUt") === "Short And Stout"); - text: titleCase("HERE IS MY HANDLE HERE IS MY SPOUT") should return Here Is My Handle Here Is My Spout. - testString: assert(titleCase("HERE IS MY HANDLE HERE IS MY SPOUT") === "Here Is My Handle Here Is My Spout", 'titleCase("HERE IS MY HANDLE HERE IS MY SPOUT") should return Here Is My Handle Here Is My Spout.'); + testString: assert(titleCase("HERE IS MY HANDLE HERE IS MY SPOUT") === "Here Is My Handle Here Is My Spout"); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/truncate-a-string.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/truncate-a-string.english.md index 398ee93db3..92547af744 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/truncate-a-string.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/truncate-a-string.english.md @@ -22,17 +22,17 @@ Remember to use should return "A-tisket...". - testString: assert(truncateString("A-tisket a-tasket A green and yellow basket", 8) === "A-tisket...", 'truncateString("A-tisket a-tasket A green and yellow basket", 8) should return "A-tisket...".'); + testString: assert(truncateString("A-tisket a-tasket A green and yellow basket", 8) === "A-tisket..."); - text: truncateString("Peter Piper picked a peck of pickled peppers", 11) should return "Peter Piper...". - testString: assert(truncateString("Peter Piper picked a peck of pickled peppers", 11) === "Peter Piper...", 'truncateString("Peter Piper picked a peck of pickled peppers", 11) should return "Peter Piper...".'); + testString: assert(truncateString("Peter Piper picked a peck of pickled peppers", 11) === "Peter Piper..."); - text: truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length) should return "A-tisket a-tasket A green and yellow basket". - testString: assert(truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length) === "A-tisket a-tasket A green and yellow basket", 'truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length) should return "A-tisket a-tasket A green and yellow basket".'); + testString: assert(truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length) === "A-tisket a-tasket A green and yellow basket"); - text: truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length + 2) should return "A-tisket a-tasket A green and yellow basket". - testString: assert(truncateString('A-tisket a-tasket A green and yellow basket', 'A-tisket a-tasket A green and yellow basket'.length + 2) === 'A-tisket a-tasket A green and yellow basket', 'truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length + 2) should return "A-tisket a-tasket A green and yellow basket".'); + testString: assert(truncateString('A-tisket a-tasket A green and yellow basket', 'A-tisket a-tasket A green and yellow basket'.length + 2) === 'A-tisket a-tasket A green and yellow basket'); - text: truncateString("A-", 1) should return "A...". - testString: assert(truncateString("A-", 1) === "A...", 'truncateString("A-", 1) should return "A...".'); + testString: assert(truncateString("A-", 1) === "A..."); - text: truncateString("Absolutely Longer", 2) should return "Ab...". - testString: assert(truncateString("Absolutely Longer", 2) === "Ab...", 'truncateString("Absolutely Longer", 2) should return "Ab...".'); + testString: assert(truncateString("Absolutely Longer", 2) === "Ab..."); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/where-do-i-belong.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/where-do-i-belong.english.md index 7e4eb3edbe..524983bb2e 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/where-do-i-belong.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/where-do-i-belong.english.md @@ -24,37 +24,37 @@ Remember to use getIndexToIns([10, 20, 30, 40, 50], 35) should return a number.'); + testString: assert(typeof(getIndexToIns([10, 20, 30, 40, 50], 35)) === "number"); - text: getIndexToIns([10, 20, 30, 40, 50], 30) should return 2. - testString: assert(getIndexToIns([10, 20, 30, 40, 50], 30) === 2, 'getIndexToIns([10, 20, 30, 40, 50], 30) should return 2.'); + testString: assert(getIndexToIns([10, 20, 30, 40, 50], 30) === 2); - text: getIndexToIns([10, 20, 30, 40, 50], 30) should return a number. - testString: assert(typeof(getIndexToIns([10, 20, 30, 40, 50], 30)) === "number", 'getIndexToIns([10, 20, 30, 40, 50], 30) should return a number.'); + testString: assert(typeof(getIndexToIns([10, 20, 30, 40, 50], 30)) === "number"); - text: getIndexToIns([40, 60], 50) should return 1. - testString: assert(getIndexToIns([40, 60], 50) === 1, 'getIndexToIns([40, 60], 50) should return 1.'); + testString: assert(getIndexToIns([40, 60], 50) === 1); - text: getIndexToIns([40, 60], 50) should return a number. - testString: assert(typeof(getIndexToIns([40, 60], 50)) === "number", 'getIndexToIns([40, 60], 50) should return a number.'); + testString: assert(typeof(getIndexToIns([40, 60], 50)) === "number"); - text: getIndexToIns([3, 10, 5], 3) should return 0. - testString: assert(getIndexToIns([3, 10, 5], 3) === 0, 'getIndexToIns([3, 10, 5], 3) should return 0.'); + testString: assert(getIndexToIns([3, 10, 5], 3) === 0); - text: getIndexToIns([3, 10, 5], 3) should return a number. - testString: assert(typeof(getIndexToIns([3, 10, 5], 3)) === "number", 'getIndexToIns([3, 10, 5], 3) should return a number.'); + testString: assert(typeof(getIndexToIns([3, 10, 5], 3)) === "number"); - text: getIndexToIns([5, 3, 20, 3], 5) should return 2. - testString: assert(getIndexToIns([5, 3, 20, 3], 5) === 2, 'getIndexToIns([5, 3, 20, 3], 5) should return 2.'); + testString: assert(getIndexToIns([5, 3, 20, 3], 5) === 2); - text: getIndexToIns([5, 3, 20, 3], 5) should return a number. - testString: assert(typeof(getIndexToIns([5, 3, 20, 3], 5)) === "number", 'getIndexToIns([5, 3, 20, 3], 5) should return a number.'); + testString: assert(typeof(getIndexToIns([5, 3, 20, 3], 5)) === "number"); - text: getIndexToIns([2, 20, 10], 19) should return 2. - testString: assert(getIndexToIns([2, 20, 10], 19) === 2, 'getIndexToIns([2, 20, 10], 19) should return 2.'); + testString: assert(getIndexToIns([2, 20, 10], 19) === 2); - text: getIndexToIns([2, 20, 10], 19) should return a number. - testString: assert(typeof(getIndexToIns([2, 20, 10], 19)) === "number", 'getIndexToIns([2, 20, 10], 19) should return a number.'); + testString: assert(typeof(getIndexToIns([2, 20, 10], 19)) === "number"); - text: getIndexToIns([2, 5, 10], 15) should return 3. - testString: assert(getIndexToIns([2, 5, 10], 15) === 3, 'getIndexToIns([2, 5, 10], 15) should return 3.'); + testString: assert(getIndexToIns([2, 5, 10], 15) === 3); - text: getIndexToIns([2, 5, 10], 15) should return a number. - testString: assert(typeof(getIndexToIns([2, 5, 10], 15)) === "number", 'getIndexToIns([2, 5, 10], 15) should return a number.'); + testString: assert(typeof(getIndexToIns([2, 5, 10], 15)) === "number"); - text: getIndexToIns([], 1) should return 0. - testString: assert(getIndexToIns([], 1) === 0, 'getIndexToIns([], 1) should return 0.'); + testString: assert(getIndexToIns([], 1) === 0); - text: getIndexToIns([], 1) should return a number. - testString: assert(typeof(getIndexToIns([], 1)) === "number", 'getIndexToIns([], 1) should return a number.'); + testString: assert(typeof(getIndexToIns([], 1)) === "number"); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-arguments-passed-in-the-wrong-order-when-calling-a-function.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-arguments-passed-in-the-wrong-order-when-calling-a-function.english.md index 6515156c50..55a7db67ad 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-arguments-passed-in-the-wrong-order-when-calling-a-function.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-arguments-passed-in-the-wrong-order-when-calling-a-function.english.md @@ -20,9 +20,9 @@ The function raiseToPower raises a base to an exponent. Unfortunate ```yml tests: - text: Your code should fix the variable power so it equals 2 raised to the 3rd power, not 3 raised to the 2nd power. - testString: assert(power == 8, 'Your code should fix the variable power so it equals 2 raised to the 3rd power, not 3 raised to the 2nd power.'); + testString: assert(power == 8); - text: Your code should use the correct order of the arguments for the raiseToPower function call. - testString: assert(code.match(/raiseToPower\(\s*?base\s*?,\s*?exp\s*?\);/g), 'Your code should use the correct order of the arguments for the raiseToPower function call.'); + testString: assert(code.match(/raiseToPower\(\s*?base\s*?,\s*?exp\s*?\);/g)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-missing-open-and-closing-parenthesis-after-a-function-call.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-missing-open-and-closing-parenthesis-after-a-function-call.english.md index 144ea93de3..a30258bd49 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-missing-open-and-closing-parenthesis-after-a-function-call.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-missing-open-and-closing-parenthesis-after-a-function-call.english.md @@ -30,9 +30,9 @@ Fix the code so the variable result is set to the value returned fr ```yml tests: - text: Your code should fix the variable result so it is set to the number that the function getNine returns. - testString: assert(result == 9, 'Your code should fix the variable result so it is set to the number that the function getNine returns.'); + testString: assert(result == 9); - text: Your code should call the getNine function. - testString: assert(code.match(/getNine\(\)/g).length == 2, 'Your code should call the getNine function.'); + testString: assert(code.match(/getNine\(\)/g).length == 2); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-misspelled-variable-and-function-names.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-misspelled-variable-and-function-names.english.md index f156ea0f64..85fd6d9829 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-misspelled-variable-and-function-names.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-misspelled-variable-and-function-names.english.md @@ -23,13 +23,13 @@ tests: - text: 'Check the spelling of the two variables used in the netWorkingCapital calculation, the console output should show that "Net working capital is: 2".' testString: 'assert(netWorkingCapital === 2, ''Check the spelling of the two variables used in the netWorkingCapital calculation, the console output should show that "Net working capital is: 2".'');' - text: There should be no instances of mis-spelled variables in the code. - testString: assert(!code.match(/recievables/g), 'There should be no instances of mis-spelled variables in the code.'); + testString: assert(!code.match(/recievables/g)); - text: The receivables variable should be declared and used properly in the code. - testString: assert(code.match(/receivables/g).length == 2, 'The receivables variable should be declared and used properly in the code.'); + testString: assert(code.match(/receivables/g).length == 2); - text: There should be no instances of mis-spelled variables in the code. - testString: assert(!code.match(/payable;/g), 'There should be no instances of mis-spelled variables in the code.'); + testString: assert(!code.match(/payable;/g)); - text: The payables variable should be declared and used properly in the code. - testString: assert(code.match(/payables/g).length == 2, 'The payables variable should be declared and used properly in the code.'); + testString: assert(code.match(/payables/g).length == 2); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-mixed-usage-of-single-and-double-quotes.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-mixed-usage-of-single-and-double-quotes.english.md index 22be2e6e61..3f2fbe6d85 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-mixed-usage-of-single-and-double-quotes.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-mixed-usage-of-single-and-double-quotes.english.md @@ -38,9 +38,9 @@ Fix the string so it either uses different quotes for the href valu ```yml tests: - text: Your code should fix the quotes around the href value "#Home" by either changing or escaping them. - testString: assert(code.match(//g), 'Your code should fix the quotes around the href value "#Home" by either changing or escaping them.'); + testString: assert(code.match(//g)); - text: Your code should keep the double quotes around the entire string. - testString: assert(code.match(/"

.*?<\/p>";/g), 'Your code should keep the double quotes around the entire string.'); + testString: assert(code.match(/"

.*?<\/p>";/g)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-off-by-one-errors-when-using-indexing.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-off-by-one-errors-when-using-indexing.english.md index 2842e6d5d2..9e703bfb56 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-off-by-one-errors-when-using-indexing.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-off-by-one-errors-when-using-indexing.english.md @@ -39,13 +39,13 @@ Fix the two indexing errors in the following function so all the numbers 1 throu ```yml tests: - text: Your code should set the initial condition of the loop so it starts at the first index. - testString: assert(code.match(/i\s*?=\s*?0\s*?;/g).length == 1, 'Your code should set the initial condition of the loop so it starts at the first index.'); + testString: assert(code.match(/i\s*?=\s*?0\s*?;/g).length == 1); - text: Your code should fix the initial condition of the loop so that the index starts at 0. - testString: assert(!code.match(/i\s?=\s*?1\s*?;/g), 'Your code should fix the initial condition of the loop so that the index starts at 0.'); + testString: assert(!code.match(/i\s?=\s*?1\s*?;/g)); - text: Your code should set the terminal condition of the loop so it stops at the last index. - testString: assert(code.match(/i\s*?<\s*?len\s*?;/g).length == 1, 'Your code should set the terminal condition of the loop so it stops at the last index.'); + testString: assert(code.match(/i\s*?<\s*?len\s*?;/g).length == 1); - text: Your code should fix the terminal condition of the loop so that it stops at 1 before the length. - testString: assert(!code.match(/i\s*?<=\s*?len;/g), 'Your code should fix the terminal condition of the loop so that it stops at 1 before the length.'); + testString: assert(!code.match(/i\s*?<=\s*?len;/g)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-unclosed-parentheses-brackets-braces-and-quotes.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-unclosed-parentheses-brackets-braces-and-quotes.english.md index 45f2b1dcd9..b953a7f6fb 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-unclosed-parentheses-brackets-braces-and-quotes.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/catch-unclosed-parentheses-brackets-braces-and-quotes.english.md @@ -21,7 +21,7 @@ Fix the two pair errors in the code. ```yml tests: - text: Your code should fix the missing piece of the array. - testString: assert(code.match(/myArray\s*?=\s*?\[\s*?1\s*?,\s*?2\s*?,\s*?3\s*?\];/g), 'Your code should fix the missing piece of the array.'); + testString: assert(code.match(/myArray\s*?=\s*?\[\s*?1\s*?,\s*?2\s*?,\s*?3\s*?\];/g)); - text: 'Your code should fix the missing piece of the .reduce() method. The console output should show that "Sum of array values is: 6".' testString: 'assert(arraySum === 6, ''Your code should fix the missing piece of the .reduce() method. The console output should show that "Sum of array values is: 6".'');' 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 1486121ed5..6a5abe79fb 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 @@ -34,9 +34,9 @@ Fix the condition so the program runs the right branch, and the appropriate valu ```yml tests: - text: Your code should fix the condition so it checks for equality, instead of using assignment. - testString: assert(result == "Not equal!", '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. - testString: assert(code.match(/x\s*?===?\s*?y/g), 'The condition can 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/prevent-infinite-loops-with-a-valid-terminal-condition.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/prevent-infinite-loops-with-a-valid-terminal-condition.english.md index d85caa5ceb..385fdd8b37 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/prevent-infinite-loops-with-a-valid-terminal-condition.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/prevent-infinite-loops-with-a-valid-terminal-condition.english.md @@ -31,9 +31,9 @@ The myFunc() function contains an infinite loop because the termina ```yml tests: - text: Your code should change the comparison operator in the terminal condition (the middle part) of the for loop. - testString: assert(code.match(/i\s*?<=\s*?4;/g).length == 1, 'Your code should change the comparison operator in the terminal condition (the middle part) of the for loop.'); + testString: assert(code.match(/i\s*?<=\s*?4;/g).length == 1); - text: Your code should fix the comparison operator in the terminal condition of the loop. - testString: assert(!code.match(/i\s*?!=\s*?4;/g), 'Your code should fix the comparison operator in the terminal condition of the loop.'); + testString: assert(!code.match(/i\s*?!=\s*?4;/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 97e8da997b..495dfc13be 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 @@ -26,11 +26,11 @@ Use console.log() to print the variables in the code where indicate ```yml tests: - text: Use console.log() to print the outputTwo variable. In your Browser Console this should print out the value of the variable two times. - testString: assert(code.match(/console\.log\(outputTwo\)/g), 'Use console.log() to print the outputTwo variable. In your Browser Console this should print out the value of the variable two times.'); + testString: assert(code.match(/console\.log\(outputTwo\)/g)); - text: Use console.log() to print the outputOne variable. - testString: assert(code.match(/console\.log\(outputOne\)/g), 'Use console.log() to print the outputOne variable.'); + testString: assert(code.match(/console\.log\(outputOne\)/g)); - text: Use console.clear() to modify your output so that outputOne variable only outputs once. - testString: assert(code.match(/^(\s*console.clear\(\);?\s*)$/gm), 'Use console.clear() to modify your output so that outputOne variable only outputs once.'); + testString: assert(code.match(/^(\s*console.clear\(\);?\s*)$/gm)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/use-caution-when-reinitializing-variables-inside-a-loop.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/use-caution-when-reinitializing-variables-inside-a-loop.english.md index 94cadf7430..2d005ac394 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/use-caution-when-reinitializing-variables-inside-a-loop.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/use-caution-when-reinitializing-variables-inside-a-loop.english.md @@ -21,11 +21,11 @@ The following function is supposed to create a two-dimensional array with ```yml tests: - text: Your code should set the matrix variable to an array holding 3 rows of 2 columns of zeroes each. - testString: assert(JSON.stringify(matrix) == "[[0,0],[0,0],[0,0]]", 'Your code should set the matrix variable to an array holding 3 rows of 2 columns of zeroes each.'); + testString: assert(JSON.stringify(matrix) == "[[0,0],[0,0],[0,0]]"); - text: The matrix variable should have 3 rows. - testString: assert(matrix.length == 3, 'The matrix variable should have 3 rows.'); + testString: assert(matrix.length == 3); - text: The matrix variable should have 2 columns in each row. - testString: assert(matrix[0].length == 2 && matrix[1].length === 2 && matrix[2].length === 2, 'The matrix variable should have 2 columns in each row.'); + testString: assert(matrix[0].length == 2 && matrix[1].length === 2 && matrix[2].length === 2); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/use-the-javascript-console-to-check-the-value-of-a-variable.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/use-the-javascript-console-to-check-the-value-of-a-variable.english.md index 858f058544..558f949615 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/use-the-javascript-console-to-check-the-value-of-a-variable.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/use-the-javascript-console-to-check-the-value-of-a-variable.english.md @@ -24,7 +24,7 @@ Use the console.log() method to print the value of the variable console.log() to check the value of the variable a. - testString: assert(code.match(/console\.log\(a\)/g), 'Your code should use console.log() to check the value of the variable a.'); + testString: assert(code.match(/console\.log\(a\)/g)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/use-typeof-to-check-the-type-of-a-variable.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/use-typeof-to-check-the-type-of-a-variable.english.md index 38dbc378d6..2783c85a4a 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/use-typeof-to-check-the-type-of-a-variable.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/debugging/use-typeof-to-check-the-type-of-a-variable.english.md @@ -30,11 +30,11 @@ Add two console.log() statements to check the typeof e ```yml tests: - text: Your code should use typeof in two console.log() statements to check the type of the variables. - testString: assert(code.match(/console\.log\(typeof[\( ].*\)?\)/g).length == 2, 'Your code should use typeof in two console.log() statements to check the type of the variables.'); + testString: assert(code.match(/console\.log\(typeof[\( ].*\)?\)/g).length == 2); - text: Your code should use typeof to check the type of the variable seven. - testString: assert(code.match(/typeof[\( ]seven\)?/g), 'Your code should use typeof to check the type of the variable seven.'); + testString: assert(code.match(/typeof[\( ]seven\)?/g)); - text: Your code should use typeof to check the type of the variable three. - testString: assert(code.match(/typeof[\( ]three\)?/g), 'Your code should use typeof to check the type of the variable three.'); + testString: assert(code.match(/typeof[\( ]three\)?/g)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/compare-scopes-of-the-var-and-let-keywords.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/compare-scopes-of-the-var-and-let-keywords.english.md index 04c94662bb..056a79b1bc 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/compare-scopes-of-the-var-and-let-keywords.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/compare-scopes-of-the-var-and-let-keywords.english.md @@ -83,11 +83,11 @@ This exercise is designed to illustrate the difference between how varvar should not exist in code. - testString: getUserInput => assert(!getUserInput('index').match(/var/g),'var should not exist in code.'); + testString: getUserInput => assert(!getUserInput('index').match(/var/g)); - text: The variable i declared in the if statement should equal "block scope". - testString: getUserInput => assert(getUserInput('index').match(/(i\s*=\s*).*\s*.*\s*.*\1('|")block\s*scope\2/g), 'The variable i declared in the if statement should equal "block scope".'); + testString: getUserInput => assert(getUserInput('index').match(/(i\s*=\s*).*\s*.*\s*.*\1('|")block\s*scope\2/g)); - text: checkScope() should return "function scope" - testString: assert(checkScope() === "function scope", 'checkScope() should return "function scope"'); + testString: assert(checkScope() === "function scope"); ``` 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 b17efc6bc9..03dd2231ce 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 @@ -44,14 +44,14 @@ Use an iterator method (any kind of loop) to get the desired output. ```yml tests: - - text: resultDisplayArray is an array containing result failure messages. - testString: assert(typeof makeList(result.failure) === 'object' && resultDisplayArray.length === 3, 'resultDisplayArray is a list containing result failure messages.'); + - 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. - testString: assert(makeList(result.failure).every((v, i) => v === `

  • ${result.failure[i]}
  • ` || v === `
  • ${result.failure[i]}
  • `), 'resultDisplayArray is the desired 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 - testString: getUserInput => assert(getUserInput('index').match(/(`.*\${.*}.*`)/), 'Template strings and expression interpolation should be used'); + testString: getUserInput => assert(getUserInput('index').match(/(`.*\${.*}.*`)/)); - text: An iterator should be used - testString: getUserInput => assert(getUserInput('index').match(/for|map|reduce|forEach|while/), '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 4195e6ff11..8bf436a8cd 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,13 +31,13 @@ Change the code so that all variables are declared using let or var does not exist in your code. - testString: getUserInput => assert(!getUserInput('index').match(/var/g),'var does 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), 'SENTENCE should be a constant variable declared with const.'); + testString: getUserInput => assert(getUserInput('index').match(/(const SENTENCE)/g)); - text: i should be declared with let. - testString: getUserInput => assert(getUserInput('index').match(/(let i)/g), 'i should be declared with let.'); + testString: getUserInput => assert(getUserInput('index').match(/(let i)/g)); - text: console.log should be changed to print the SENTENCE variable. - testString: getUserInput => assert(getUserInput('index').match(/console\.log\(\s*SENTENCE\s*\)\s*;?/g), 'console.log should be adjusted to print the variable SENTENCE.'); + testString: getUserInput => assert(getUserInput('index').match(/console\.log\(\s*SENTENCE\s*\)\s*;?/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 8095c344d2..942fcdad98 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,11 +48,11 @@ Update the code so it only uses the let keyword. ```yml tests: - text: var does not exist in code. - testString: getUserInput => assert(!getUserInput('index').match(/var/g),'var does not exist in code.'); + testString: getUserInput => assert(!getUserInput('index').match(/var/g)); - text: catName should be Oliver. - testString: assert(catName === "Oliver", 'catName should be Oliver.'); + testString: assert(catName === "Oliver"); - text: quote should be "Oliver says Meow!" - testString: assert(quote === "Oliver says Meow!", 'quote should be "Oliver says Meow!"'); + testString: assert(quote === "Oliver says Meow!"); ``` 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 66f75ce337..adfc6b3e02 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,13 +32,13 @@ An array is declared as const s = [5, 7, 2]. Change the array to const keyword. - testString: getUserInput => assert(getUserInput('index').match(/const/g), 'Do 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), '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. - testString: getUserInput => assert(getUserInput('index').match(/const\s+s\s*=\s*\[\s*5\s*,\s*7\s*,\s*2\s*\]\s*;?/g), 'Do 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], '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 c7bbc33e5c..30154e6b44 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. - testString: getUserInput => assert(getUserInput('index').match(/const/g), 'Do 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), '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. - testString: getUserInput => assert(getUserInput('index').match(/const\s+MATH_CONSTANTS\s+=\s+{\s+PI:\s+3.14\s+};/g), 'Do 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. - testString: assert(PI === 3.14, 'PI equals 3.14.'); + testString: assert(PI === 3.14); ``` 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 cd29a31783..4328ac1025 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. - testString: getUserInput => assert(!getUserInput('index').match(/var/g), 'User did replace 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), '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 - testString: assert(typeof myConcat === 'function', 'myConcat should be a function'); + testString: assert(typeof myConcat === 'function'); - text: myConcat() returns the correct array - testString: assert(() => { const a = myConcat([1], [2]); return a[0] == 1 && a[1] == 2; }, 'myConcat() returns the correct array'); + testString: assert(() => { const a = myConcat([1], [2]); return a[0] == 1 && a[1] == 2; }); - text: function keyword was not used. - testString: getUserInput => assert(!getUserInput('index').match(/function/g), 'function keyword was not used.'); + testString: getUserInput => assert(!getUserInput('index').match(/function/g)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/add-elements-to-the-end-of-an-array-using-concat-instead-of-push.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/add-elements-to-the-end-of-an-array-using-concat-instead-of-push.english.md index daa0e81796..3fa35a2cc2 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/add-elements-to-the-end-of-an-array-using-concat-instead-of-push.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/add-elements-to-the-end-of-an-array-using-concat-instead-of-push.english.md @@ -30,15 +30,15 @@ Change the nonMutatingPush function so it uses concat ```yml tests: - text: Your code should use the concat method. - testString: assert(code.match(/\.concat/g), 'Your code should use the concat method.'); + testString: assert(code.match(/\.concat/g)); - text: Your code should not use the push method. - testString: assert(!code.match(/\.push/g), 'Your code should not use the push method.'); + testString: assert(!code.match(/\.push/g)); - text: The first array should not change. - testString: assert(JSON.stringify(first) === JSON.stringify([1, 2, 3]), 'The first array should not change.'); + testString: assert(JSON.stringify(first) === JSON.stringify([1, 2, 3])); - text: The second array should not change. - testString: assert(JSON.stringify(second) === JSON.stringify([4, 5]), 'The second array should not change.'); + testString: assert(JSON.stringify(second) === JSON.stringify([4, 5])); - text: nonMutatingPush([1, 2, 3], [4, 5]) should return [1, 2, 3, 4, 5]. - testString: assert(JSON.stringify(nonMutatingPush([1, 2, 3], [4, 5])) === JSON.stringify([1, 2, 3, 4, 5]), 'nonMutatingPush([1, 2, 3], [4, 5]) should return [1, 2, 3, 4, 5].'); + testString: assert(JSON.stringify(nonMutatingPush([1, 2, 3], [4, 5])) === JSON.stringify([1, 2, 3, 4, 5])); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/apply-functional-programming-to-convert-strings-to-url-slugs.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/apply-functional-programming-to-convert-strings-to-url-slugs.english.md index f42de7af30..13b7e76188 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/apply-functional-programming-to-convert-strings-to-url-slugs.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/apply-functional-programming-to-convert-strings-to-url-slugs.english.md @@ -26,17 +26,17 @@ The output should not have any spaces ```yml tests: - text: The globalTitle variable should not change. - testString: assert(globalTitle === "Winter Is Coming", 'The globalTitle variable should not change.'); + testString: assert(globalTitle === "Winter Is Coming"); - text: Your code should not use the replace method for this challenge. - testString: assert(!code.match(/\.replace/g), 'Your code should not use the replace method for this challenge.'); + testString: assert(!code.match(/\.replace/g)); - text: urlSlug("Winter Is Coming") should return "winter-is-coming". - testString: assert(urlSlug("Winter Is Coming") === "winter-is-coming", 'urlSlug("Winter Is Coming") should return "winter-is-coming".'); + testString: assert(urlSlug("Winter Is Coming") === "winter-is-coming"); - text: urlSlug(" Winter Is  Coming") should return "winter-is-coming". - testString: assert(urlSlug(" Winter Is Coming") === "winter-is-coming", 'urlSlug(" Winter Is  Coming") should return "winter-is-coming".'); + testString: assert(urlSlug(" Winter Is Coming") === "winter-is-coming"); - text: urlSlug("A Mind Needs Books Like A Sword Needs A Whetstone") should return "a-mind-needs-books-like-a-sword-needs-a-whetstone". - testString: assert(urlSlug("A Mind Needs Books Like A Sword Needs A Whetstone") === "a-mind-needs-books-like-a-sword-needs-a-whetstone", 'urlSlug("A Mind Needs Books Like A Sword Needs A Whetstone") should return "a-mind-needs-books-like-a-sword-needs-a-whetstone".'); + testString: assert(urlSlug("A Mind Needs Books Like A Sword Needs A Whetstone") === "a-mind-needs-books-like-a-sword-needs-a-whetstone"); - text: urlSlug("Hold The Door") should return "hold-the-door". - testString: assert(urlSlug("Hold The Door") === "hold-the-door", 'urlSlug("Hold The Door") should return "hold-the-door".'); + testString: assert(urlSlug("Hold The Door") === "hold-the-door"); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/avoid-mutations-and-side-effects-using-functional-programming.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/avoid-mutations-and-side-effects-using-functional-programming.english.md index 686fbc540d..1b379014e3 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/avoid-mutations-and-side-effects-using-functional-programming.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/avoid-mutations-and-side-effects-using-functional-programming.english.md @@ -25,9 +25,9 @@ Fill in the code for the function incrementer so it returns the val ```yml tests: - text: Your function incrementer should not change the value of fixedValue. - testString: assert(fixedValue === 4, 'Your function incrementer should not change the value of fixedValue.'); + testString: assert(fixedValue === 4); - text: Your incrementer function should return a value that is one larger than the fixedValue value. - testString: assert(newValue === 5, 'Your incrementer function should return a value that is one larger than the fixedValue value.'); + testString: assert(newValue === 5); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/combine-an-array-into-a-string-using-the-join-method.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/combine-an-array-into-a-string-using-the-join-method.english.md index f8d0bb1a4f..5751c772fc 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/combine-an-array-into-a-string-using-the-join-method.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/combine-an-array-into-a-string-using-the-join-method.english.md @@ -28,17 +28,17 @@ Use the join method (among others) inside the sentensifyjoin method. - testString: assert(code.match(/\.join/g), 'Your code should use the join method.'); + testString: assert(code.match(/\.join/g)); - text: Your code should not use the replace method. - testString: assert(!code.match(/\.replace/g), 'Your code should not use the replace method.'); + testString: assert(!code.match(/\.replace/g)); - text: sentensify("May-the-force-be-with-you") should return a string. - testString: assert(typeof sentensify("May-the-force-be-with-you") === "string", 'sentensify("May-the-force-be-with-you") should return a string.'); + testString: assert(typeof sentensify("May-the-force-be-with-you") === "string"); - text: sentensify("May-the-force-be-with-you") should return "May the force be with you". - testString: assert(sentensify("May-the-force-be-with-you") === "May the force be with you", 'sentensify("May-the-force-be-with-you") should return "May the force be with you".'); + testString: assert(sentensify("May-the-force-be-with-you") === "May the force be with you"); - text: sentensify("The.force.is.strong.with.this.one") should return "The force is strong with this one". - testString: assert(sentensify("The.force.is.strong.with.this.one") === "The force is strong with this one", 'sentensify("The.force.is.strong.with.this.one") should return "The force is strong with this one".'); + testString: assert(sentensify("The.force.is.strong.with.this.one") === "The force is strong with this one"); - text: sentensify("There,has,been,an,awakening") should return "There has been an awakening". - testString: assert(sentensify("There,has,been,an,awakening") === "There has been an awakening", 'sentensify("There,has,been,an,awakening") should return "There has been an awakening".'); + testString: assert(sentensify("There,has,been,an,awakening") === "There has been an awakening"); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/combine-two-arrays-using-the-concat-method.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/combine-two-arrays-using-the-concat-method.english.md index 5a6eed4a3a..b59806ebc5 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/combine-two-arrays-using-the-concat-method.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/combine-two-arrays-using-the-concat-method.english.md @@ -26,13 +26,13 @@ Use the concat method in the nonMutatingConcat functio ```yml tests: - text: Your code should use the concat method. - testString: assert(code.match(/\.concat/g), 'Your code should use the concat method.'); + testString: assert(code.match(/\.concat/g)); - text: The first array should not change. - testString: assert(JSON.stringify(first) === JSON.stringify([1, 2, 3]), 'The first array should not change.'); + testString: assert(JSON.stringify(first) === JSON.stringify([1, 2, 3])); - text: The second array should not change. - testString: assert(JSON.stringify(second) === JSON.stringify([4, 5]), 'The second array should not change.'); + testString: assert(JSON.stringify(second) === JSON.stringify([4, 5])); - text: nonMutatingConcat([1, 2, 3], [4, 5]) should return [1, 2, 3, 4, 5]. - testString: assert(JSON.stringify(nonMutatingConcat([1, 2, 3], [4, 5])) === JSON.stringify([1, 2, 3, 4, 5]), 'nonMutatingConcat([1, 2, 3], [4, 5]) should return [1, 2, 3, 4, 5].'); + testString: assert(JSON.stringify(nonMutatingConcat([1, 2, 3], [4, 5])) === JSON.stringify([1, 2, 3, 4, 5])); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/implement-map-on-a-prototype.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/implement-map-on-a-prototype.english.md index 07e68441fe..5dd76eb5c5 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/implement-map-on-a-prototype.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/implement-map-on-a-prototype.english.md @@ -23,9 +23,9 @@ Write your own Array.prototype.myMap(), which should behave exactly ```yml tests: - text: new_s should equal [46, 130, 196, 10]. - testString: assert(JSON.stringify(new_s) === JSON.stringify([46, 130, 196, 10]), 'new_s should equal [46, 130, 196, 10].'); + testString: assert(JSON.stringify(new_s) === JSON.stringify([46, 130, 196, 10])); - text: Your code should not use the map method. - testString: assert(!code.match(/\.map/g), 'Your code should not use the map method.'); + testString: assert(!code.match(/\.map/g)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/implement-the-filter-method-on-a-prototype.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/implement-the-filter-method-on-a-prototype.english.md index ea73bf7427..2ec3cc34ef 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/implement-the-filter-method-on-a-prototype.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/implement-the-filter-method-on-a-prototype.english.md @@ -21,9 +21,9 @@ Write your own Array.prototype.myFilter(), which should behave exac ```yml tests: - text: new_s should equal [23, 65, 5]. - testString: assert(JSON.stringify(new_s) === JSON.stringify([23, 65, 5]), 'new_s should equal [23, 65, 5].'); + testString: assert(JSON.stringify(new_s) === JSON.stringify([23, 65, 5])); - text: Your code should not use the filter method. - testString: assert(!code.match(/\.filter/g), 'Your code should not use the filter method.'); + testString: assert(!code.match(/\.filter/g)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/introduction-to-currying-and-partial-application.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/introduction-to-currying-and-partial-application.english.md index 8764316316..4deacac5aa 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/introduction-to-currying-and-partial-application.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/introduction-to-currying-and-partial-application.english.md @@ -61,13 +61,13 @@ Fill in the body of the add function so it uses currying to add par ```yml tests: - text: add(10)(20)(30) should return 60. - testString: assert(add(10)(20)(30) === 60, 'add(10)(20)(30) should return 60.'); + testString: assert(add(10)(20)(30) === 60); - text: add(1)(2)(3) should return 6. - testString: assert(add(1)(2)(3) === 6, 'add(1)(2)(3) should return 6.'); + testString: assert(add(1)(2)(3) === 6); - text: add(11)(22)(33) should return 66. - testString: assert(add(11)(22)(33) === 66, 'add(11)(22)(33) should return 66.'); + testString: assert(add(11)(22)(33) === 66); - text: Your code should include a final statement that returns x + y + z. - testString: assert(code.match(/[xyz]\s*?\+\s*?[xyz]\s*?\+\s*?[xyz]/g), 'Your code should include a final statement that returns x + y + z.'); + testString: assert(code.match(/[xyz]\s*?\+\s*?[xyz]\s*?\+\s*?[xyz]/g)); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/learn-about-functional-programming.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/learn-about-functional-programming.english.md index 65b26585f6..46deec0a4a 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/learn-about-functional-programming.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/learn-about-functional-programming.english.md @@ -26,9 +26,9 @@ In the code editor, the prepareTea and getTea function ```yml tests: - text: The tea4TeamFCC variable should hold 40 cups of tea for the team. - testString: assert(tea4TeamFCC.length === 40, 'The tea4TeamFCC variable should hold 40 cups of tea for the team.'); + testString: assert(tea4TeamFCC.length === 40); - text: The tea4TeamFCC variable should hold cups of green tea. - testString: assert(tea4TeamFCC[0] === 'greenTea', 'The tea4TeamFCC variable should hold cups of green tea.'); + testString: assert(tea4TeamFCC[0] === 'greenTea'); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/pass-arguments-to-avoid-external-dependence-in-a-function.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/pass-arguments-to-avoid-external-dependence-in-a-function.english.md index e41b3918f1..59b3fd4235 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/pass-arguments-to-avoid-external-dependence-in-a-function.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/pass-arguments-to-avoid-external-dependence-in-a-function.english.md @@ -26,11 +26,11 @@ Write the incrementer function so it takes an argument, and then in ```yml tests: - text: Your function incrementer should not change the value of fixedValue. - testString: assert(fixedValue === 4, 'Your function incrementer should not change the value of fixedValue.'); + testString: assert(fixedValue === 4); - text: Your incrementer function should take a parameter. - testString: assert(incrementer.length === 1, 'Your incrementer function should take a parameter.'); + testString: assert(incrementer.length === 1); - text: Your incrementer function should return a value that is one larger than the fixedValue value. - testString: assert(newValue === 5, 'Your incrementer function should return a value that is one larger than the fixedValue value.'); + testString: assert(newValue === 5); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/refactor-global-variables-out-of-functions.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/refactor-global-variables-out-of-functions.english.md index d29cbe4eb3..1817f8d869 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/refactor-global-variables-out-of-functions.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/refactor-global-variables-out-of-functions.english.md @@ -23,7 +23,7 @@ Rewrite the code so the global array bookList is not changed inside ```yml tests: - text: bookList should not change and still equal ["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"]. - testString: assert(JSON.stringify(bookList) === JSON.stringify(["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"]), 'bookList should not change and still equal ["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"].'); + testString: assert(JSON.stringify(bookList) === JSON.stringify(["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"])); - text: newBookList should equal ["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae", "A Brief History of Time"]. testString: assert(JSON.stringify(newBookList) === JSON.stringify(['The Hound of the Baskervilles', 'On The Electrodynamics of Moving Bodies', 'Philosophiæ Naturalis Principia Mathematica', 'Disquisitiones Arithmeticae', 'A Brief History of Time']), 'newBookList should equal ["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae", "A Brief History of Time"].'); - text: newerBookList should equal ["The Hound of the Baskervilles", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"]. diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/remove-elements-from-an-array-using-slice-instead-of-splice.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/remove-elements-from-an-array-using-slice-instead-of-splice.english.md index 64eda4efb2..f42625bc0d 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/remove-elements-from-an-array-using-slice-instead-of-splice.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/remove-elements-from-an-array-using-slice-instead-of-splice.english.md @@ -29,13 +29,13 @@ Do not mutate the original array provided to the function. ```yml tests: - text: Your code should use the slice method. - testString: assert(code.match(/\.slice/g), 'Your code should use the slice method.'); + testString: assert(code.match(/\.slice/g)); - text: Your code should not use the splice method. - testString: assert(!code.match(/\.splice/g), 'Your code should not use the splice method.'); + testString: assert(!code.match(/\.splice/g)); - text: The inputCities array should not change. - testString: assert(JSON.stringify(inputCities) === JSON.stringify(["Chicago", "Delhi", "Islamabad", "London", "Berlin"]), 'The inputCities array should not change.'); + testString: assert(JSON.stringify(inputCities) === JSON.stringify(["Chicago", "Delhi", "Islamabad", "London", "Berlin"])); - text: nonMutatingSplice(["Chicago", "Delhi", "Islamabad", "London", "Berlin"]) should return ["Chicago", "Delhi", "Islamabad"]. - testString: assert(JSON.stringify(nonMutatingSplice(["Chicago", "Delhi", "Islamabad", "London", "Berlin"])) === JSON.stringify(["Chicago", "Delhi", "Islamabad"]), 'nonMutatingSplice(["Chicago", "Delhi", "Islamabad", "London", "Berlin"]) should return ["Chicago", "Delhi", "Islamabad"].'); + testString: assert(JSON.stringify(nonMutatingSplice(["Chicago", "Delhi", "Islamabad", "London", "Berlin"])) === JSON.stringify(["Chicago", "Delhi", "Islamabad"])); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/return-part-of-an-array-using-the-slice-method.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/return-part-of-an-array-using-the-slice-method.english.md index 2fd09507d1..3ea8809475 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/return-part-of-an-array-using-the-slice-method.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/return-part-of-an-array-using-the-slice-method.english.md @@ -28,15 +28,15 @@ Use the slice method in the sliceArray function to ret ```yml tests: - text: Your code should use the slice method. - testString: assert(code.match(/\.slice/g), 'Your code should use the slice method.'); + testString: assert(code.match(/\.slice/g)); - text: The inputAnim variable should not change. - testString: assert(JSON.stringify(inputAnim) === JSON.stringify(["Cat", "Dog", "Tiger", "Zebra", "Ant"]), 'The inputAnim variable should not change.'); + testString: assert(JSON.stringify(inputAnim) === JSON.stringify(["Cat", "Dog", "Tiger", "Zebra", "Ant"])); - text: sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 1, 3) should return ["Dog", "Tiger"]. - testString: assert(JSON.stringify(sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 1, 3)) === JSON.stringify(["Dog", "Tiger"]), 'sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 1, 3) should return ["Dog", "Tiger"].'); + testString: assert(JSON.stringify(sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 1, 3)) === JSON.stringify(["Dog", "Tiger"])); - text: sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 0, 1) should return ["Cat"]. - testString: assert(JSON.stringify(sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 0, 1)) === JSON.stringify(["Cat"]), 'sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 0, 1) should return ["Cat"].'); + testString: assert(JSON.stringify(sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 0, 1)) === JSON.stringify(["Cat"])); - text: sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 1, 4) should return ["Dog", "Tiger", "Zebra"]. - testString: assert(JSON.stringify(sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 1, 4)) === JSON.stringify(["Dog", "Tiger", "Zebra"]), 'sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 1, 4) should return ["Dog", "Tiger", "Zebra"].'); + testString: assert(JSON.stringify(sliceArray(["Cat", "Dog", "Tiger", "Zebra", "Ant"], 1, 4)) === JSON.stringify(["Dog", "Tiger", "Zebra"])); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/sort-an-array-alphabetically-using-the-sort-method.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/sort-an-array-alphabetically-using-the-sort-method.english.md index 096bc6d4b4..27b21ac76c 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/sort-an-array-alphabetically-using-the-sort-method.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/sort-an-array-alphabetically-using-the-sort-method.english.md @@ -45,13 +45,13 @@ Use the sort method in the alphabeticalOrder function ```yml tests: - text: Your code should use the sort method. - testString: assert(code.match(/\.sort/g), 'Your code should use the sort method.'); + testString: assert(code.match(/\.sort/g)); - text: alphabeticalOrder(["a", "d", "c", "a", "z", "g"]) should return ["a", "a", "c", "d", "g", "z"]. - testString: assert(JSON.stringify(alphabeticalOrder(["a", "d", "c", "a", "z", "g"])) === JSON.stringify(["a", "a", "c", "d", "g", "z"]), 'alphabeticalOrder(["a", "d", "c", "a", "z", "g"]) should return ["a", "a", "c", "d", "g", "z"].'); + testString: assert(JSON.stringify(alphabeticalOrder(["a", "d", "c", "a", "z", "g"])) === JSON.stringify(["a", "a", "c", "d", "g", "z"])); - text: alphabeticalOrder(["x", "h", "a", "m", "n", "m"]) should return ["a", "h", "m", "m", "n", "x"]. - testString: assert(JSON.stringify(alphabeticalOrder(["x", "h", "a", "m", "n", "m"])) === JSON.stringify(["a", "h", "m", "m", "n", "x"]), 'alphabeticalOrder(["x", "h", "a", "m", "n", "m"]) should return ["a", "h", "m", "m", "n", "x"].'); + testString: assert(JSON.stringify(alphabeticalOrder(["x", "h", "a", "m", "n", "m"])) === JSON.stringify(["a", "h", "m", "m", "n", "x"])); - text: alphabeticalOrder(["a", "a", "a", "a", "x", "t"]) should return ["a", "a", "a", "a", "t", "x"]. - testString: assert(JSON.stringify(alphabeticalOrder(["a", "a", "a", "a", "x", "t"])) === JSON.stringify(["a", "a", "a", "a", "t", "x"]), 'alphabeticalOrder(["a", "a", "a", "a", "x", "t"]) should return ["a", "a", "a", "a", "t", "x"].'); + testString: assert(JSON.stringify(alphabeticalOrder(["a", "a", "a", "a", "x", "t"])) === JSON.stringify(["a", "a", "a", "a", "t", "x"])); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/split-a-string-into-an-array-using-the-split-method.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/split-a-string-into-an-array-using-the-split-method.english.md index 1ba9a1a4c8..57a16339b2 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/split-a-string-into-an-array-using-the-split-method.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/split-a-string-into-an-array-using-the-split-method.english.md @@ -33,13 +33,13 @@ Use the split method inside the splitify function to s ```yml tests: - text: Your code should use the split method. - testString: assert(code.match(/\.split/g), 'Your code should use the split method.'); + testString: assert(code.match(/\.split/g)); - text: splitify("Hello World,I-am code") should return ["Hello", "World", "I", "am", "code"]. - testString: assert(JSON.stringify(splitify("Hello World,I-am code")) === JSON.stringify(["Hello", "World", "I", "am", "code"]), 'splitify("Hello World,I-am code") should return ["Hello", "World", "I", "am", "code"].'); + testString: assert(JSON.stringify(splitify("Hello World,I-am code")) === JSON.stringify(["Hello", "World", "I", "am", "code"])); - text: splitify("Earth-is-our home") should return ["Earth", "is", "our", "home"]. - testString: assert(JSON.stringify(splitify("Earth-is-our home")) === JSON.stringify(["Earth", "is", "our", "home"]), 'splitify("Earth-is-our home") should return ["Earth", "is", "our", "home"].'); + testString: assert(JSON.stringify(splitify("Earth-is-our home")) === JSON.stringify(["Earth", "is", "our", "home"])); - text: splitify("This.is.a-sentence") should return ["This", "is", "a", "sentence"]. - testString: assert(JSON.stringify(splitify("This.is.a-sentence")) === JSON.stringify(["This", "is", "a", "sentence"]), 'splitify("This.is.a-sentence") should return ["This", "is", "a", "sentence"].'); + testString: assert(JSON.stringify(splitify("This.is.a-sentence")) === JSON.stringify(["This", "is", "a", "sentence"])); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/understand-functional-programming-terminology.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/understand-functional-programming-terminology.english.md index 4de968d372..c6bdfeec9a 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/understand-functional-programming-terminology.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/understand-functional-programming-terminology.english.md @@ -27,13 +27,13 @@ Note: The data (the number of cups of tea) is supplied as the last argument. We' ```yml tests: - text: The tea4GreenTeamFCC variable should hold 27 cups of green tea for the team. - testString: assert(tea4GreenTeamFCC.length === 27, 'The tea4GreenTeamFCC variable should hold 27 cups of green tea for the team.'); + testString: assert(tea4GreenTeamFCC.length === 27); - text: The tea4GreenTeamFCC variable should hold cups of green tea. - testString: assert(tea4GreenTeamFCC[0] === 'greenTea', 'The tea4GreenTeamFCC variable should hold cups of green tea.'); + testString: assert(tea4GreenTeamFCC[0] === 'greenTea'); - text: The tea4BlackTeamFCC variable should hold 13 cups of black tea. - testString: assert(tea4BlackTeamFCC.length === 13, 'The tea4BlackTeamFCC variable should hold 13 cups of black tea.'); + testString: assert(tea4BlackTeamFCC.length === 13); - text: The tea4BlackTeamFCC variable should hold cups of black tea. - testString: assert(tea4BlackTeamFCC[0] === 'blackTea', 'The tea4BlackTeamFCC variable should hold cups of black tea.'); + testString: assert(tea4BlackTeamFCC[0] === 'blackTea'); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/use-the-every-method-to-check-that-every-element-in-an-array-meets-a-criteria.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/use-the-every-method-to-check-that-every-element-in-an-array-meets-a-criteria.english.md index 1aab38e0d5..9b94dc7f35 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/use-the-every-method-to-check-that-every-element-in-an-array-meets-a-criteria.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/use-the-every-method-to-check-that-every-element-in-an-array-meets-a-criteria.english.md @@ -30,13 +30,13 @@ Use the every method inside the checkPositive function ```yml tests: - text: Your code should use the every method. - testString: assert(code.match(/\.every/g), 'Your code should use the every method.'); + testString: assert(code.match(/\.every/g)); - text: checkPositive([1, 2, 3, -4, 5]) should return false. - testString: assert(!checkPositive([1, 2, 3, -4, 5]), 'checkPositive([1, 2, 3, -4, 5]) should return false.'); + testString: assert(!checkPositive([1, 2, 3, -4, 5])); - text: checkPositive([1, 2, 3, 4, 5]) should return true. - testString: assert(checkPositive([1, 2, 3, 4, 5]), 'checkPositive([1, 2, 3, 4, 5]) should return true.'); + testString: assert(checkPositive([1, 2, 3, 4, 5])); - text: checkPositive([1, -2, 3, -4, 5]) should return false. - testString: assert(!checkPositive([1, -2, 3, -4, 5]), 'checkPositive([1, -2, 3, -4, 5]) should return false.'); + testString: assert(!checkPositive([1, -2, 3, -4, 5])); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/use-the-filter-method-to-extract-data-from-an-array.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/use-the-filter-method-to-extract-data-from-an-array.english.md index 8678646b97..cfb40059ef 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/use-the-filter-method-to-extract-data-from-an-array.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/use-the-filter-method-to-extract-data-from-an-array.english.md @@ -21,11 +21,11 @@ The variable watchList holds an array of objects with information o ```yml tests: - text: The watchList variable should not change. - testString: assert(watchList[0].Title === "Inception" && watchList[4].Director == "James Cameron", 'The watchList variable should not change.'); + testString: assert(watchList[0].Title === "Inception" && watchList[4].Director == "James Cameron"); - text: Your code should use the filter method. - testString: assert(code.match(/\.filter/g), 'Your code should use the filter method.'); + testString: assert(code.match(/\.filter/g)); - text: Your code should not use a for loop. - testString: assert(!code.match(/for\s*?\(.+?\)/g), 'Your code should not use a for loop.'); + testString: assert(!code.match(/for\s*?\(.+?\)/g)); - text: 'filteredList should equal [{"title": "Inception","rating": "8.8"},{"title": "Interstellar","rating": "8.6"},{"title": "The Dark Knight","rating": "9.0"},{"title": "Batman Begins","rating": "8.3"}].' testString: 'assert.deepEqual(filteredList, [{"title": "Inception","rating": "8.8"},{"title": "Interstellar","rating": "8.6"},{"title": "The Dark Knight","rating": "9.0"},{"title": "Batman Begins","rating": "8.3"}], ''filteredList should equal [{"title": "Inception","rating": "8.8"},{"title": "Interstellar","rating": "8.6"},{"title": "The Dark Knight","rating": "9.0"},{"title": "Batman Begins","rating": "8.3"}].'');' diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/use-the-reduce-method-to-analyze-data.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/use-the-reduce-method-to-analyze-data.english.md index 55e734b740..b99b9bc5dc 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/use-the-reduce-method-to-analyze-data.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/use-the-reduce-method-to-analyze-data.english.md @@ -23,15 +23,15 @@ The variable watchList holds an array of objects with information o ```yml tests: - text: The watchList variable should not change. - testString: assert(watchList[0].Title === "Inception" && watchList[4].Director == "James Cameron", 'The watchList variable should not change.'); + testString: assert(watchList[0].Title === "Inception" && watchList[4].Director == "James Cameron"); - text: Your code should use the reduce method. - testString: assert(code.match(/\.reduce/g), 'Your code should use the reduce method.'); + testString: assert(code.match(/\.reduce/g)); - text: The getRating(watchList) should equal 8.675. - testString: assert(getRating(watchList) === 8.675, 'The getRating(watchList) should equal 8.675.'); + testString: assert(getRating(watchList) === 8.675); - text: Your code should not use a for loop. - testString: assert(!code.match(/for\s*?\(.*\)/g), 'Your code should not use a for loop.'); + testString: assert(!code.match(/for\s*?\(.*\)/g)); - text: Your code should return correct output after modifying the watchList object. - testString: assert(getRating(watchList.filter((_, i) => i < 1 || i > 2)) === 8.55, 'Your code should return correct output after modifying the watchList object'); + testString: assert(getRating(watchList.filter((_, i) => i < 1 || i > 2)) === 8.55); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/use-the-some-method-to-check-that-any-elements-in-an-array-meet-a-criteria.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/use-the-some-method-to-check-that-any-elements-in-an-array-meet-a-criteria.english.md index 5231070048..f433e1fc10 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/use-the-some-method-to-check-that-any-elements-in-an-array-meet-a-criteria.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/use-the-some-method-to-check-that-any-elements-in-an-array-meet-a-criteria.english.md @@ -30,13 +30,13 @@ Use the some method inside the checkPositive function ```yml tests: - text: Your code should use the some method. - testString: assert(code.match(/\.some/g), 'Your code should use the some method.'); + testString: assert(code.match(/\.some/g)); - text: checkPositive([1, 2, 3, -4, 5]) should return true. - testString: assert(checkPositive([1, 2, 3, -4, 5]), 'checkPositive([1, 2, 3, -4, 5]) should return true.'); + testString: assert(checkPositive([1, 2, 3, -4, 5])); - text: checkPositive([1, 2, 3, 4, 5]) should return true. - testString: assert(checkPositive([1, 2, 3, 4, 5]), 'checkPositive([1, 2, 3, 4, 5]) should return true.'); + testString: assert(checkPositive([1, 2, 3, 4, 5])); - text: checkPositive([-1, -2, -3, -4, -5]) should return false. - testString: assert(!checkPositive([-1, -2, -3, -4, -5]), 'checkPositive([-1, -2, -3, -4, -5]) should return false.'); + testString: assert(!checkPositive([-1, -2, -3, -4, -5])); ```