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 565787d64f..1289957276 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 @@ -54,7 +54,6 @@ tests: ```js function booWho(bool) { - // What is the new fad diet for ghost developers? The Boolean. return bool; } 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 d036e3ae21..03e97f0d73 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 @@ -47,7 +47,6 @@ tests: ```js function chunkArrayInGroups(arr, size) { - // Break it up. return arr; } 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 dcb941d77c..51aa68160d 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 @@ -56,8 +56,6 @@ tests: ```js function confirmEnding(str, target) { - // "Never give up and good luck will find you." - // -- Falcor return str; } diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/falsy-bouncer.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/falsy-bouncer.english.md index 22ab4e7a66..9c6e052406 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/falsy-bouncer.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/falsy-bouncer.english.md @@ -42,7 +42,6 @@ tests: ```js function bouncer(arr) { - // Don't show a false ID to this bouncer. return arr; } diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/repeat-a-string-repeat-a-string.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/repeat-a-string-repeat-a-string.english.md index ed0cdbf9af..0ce566ca68 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/repeat-a-string-repeat-a-string.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/repeat-a-string-repeat-a-string.english.md @@ -49,7 +49,6 @@ tests: ```js function repeatStringNumTimes(str, num) { - // repeat after me return str; } 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 17de12da49..0ad14e437c 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 @@ -42,7 +42,6 @@ tests: ```js function largestOfFour(arr) { - // You can do this! return arr; } 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 13b93dfccb..fc93292af3 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 @@ -49,7 +49,6 @@ tests: ```js function frankenSplice(arr1, arr2, n) { - // It's alive. It's alive! return arr2; } 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 a86e7c47d5..558dd04090 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 @@ -45,7 +45,6 @@ tests: ```js function truncateString(str, num) { - // Clear out that junk in your trunk return str; } 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 536c696b9e..e145cd7470 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 @@ -67,7 +67,6 @@ tests: ```js function getIndexToIns(arr, num) { - // Find my place in this sorted array. return num; } diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/iterate-through-all-an-arrays-items-using-for-loops.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/iterate-through-all-an-arrays-items-using-for-loops.english.md index edc99c5df8..2f6d6b14d2 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/iterate-through-all-an-arrays-items-using-for-loops.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/iterate-through-all-an-arrays-items-using-for-loops.english.md @@ -61,13 +61,12 @@ tests: ```js function filteredArray(arr, elem) { let newArr = []; - // change code below this line + // Only change code below this line - // change code above this line + // Only change code above this line return newArr; } -// change code here to test different cases: console.log(filteredArray([[3, 2, 3], [1, 6, 3], [3, 13, 26], [19, 3, 9]], 3)); ``` @@ -83,13 +82,11 @@ console.log(filteredArray([[3, 2, 3], [1, 6, 3], [3, 13, 26], [19, 3, 9]], 3)); ```js function filteredArray(arr, elem) { let newArr = []; - // change code below this line for (let i = 0; i diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/adding-a-default-option-in-switch-statements.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/adding-a-default-option-in-switch-statements.english.md index d9d7862b24..31da473db6 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/adding-a-default-option-in-switch-statements.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/adding-a-default-option-in-switch-statements.english.md @@ -75,7 +75,6 @@ function switchOfStuff(val) { return answer; } -// Change this value to test switchOfStuff(1); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/chaining-if-else-statements.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/chaining-if-else-statements.english.md index 6de0e3fe80..477b21f612 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/chaining-if-else-statements.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/chaining-if-else-statements.english.md @@ -81,7 +81,6 @@ function testSize(num) { // Only change code above this line } -// Change this value to test testSize(7); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-equality-operator.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-equality-operator.english.md index a8c7bd3bb6..56772d41ec 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-equality-operator.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-equality-operator.english.md @@ -69,7 +69,6 @@ function testEqual(val) { return "Not Equal"; } -// Change this value to test testEqual(10); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-greater-than-or-equal-to-operator.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-greater-than-or-equal-to-operator.english.md index 457cdc54a0..5bd9a5faa5 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-greater-than-or-equal-to-operator.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-greater-than-or-equal-to-operator.english.md @@ -70,7 +70,6 @@ function testGreaterOrEqual(val) { return "Less than 10"; } -// Change this value to test testGreaterOrEqual(10); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-inequality-operator.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-inequality-operator.english.md index 3799e64802..eb705e3915 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-inequality-operator.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-inequality-operator.english.md @@ -62,7 +62,6 @@ function testNotEqual(val) { return "Equal"; } -// Change this value to test testNotEqual(10); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-less-than-operator.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-less-than-operator.english.md index ebb2ba7ad9..51e528cc3f 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-less-than-operator.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-less-than-operator.english.md @@ -68,7 +68,6 @@ function testLessThan(val) { return "55 or Over"; } -// Change this value to test testLessThan(10); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-less-than-or-equal-to-operator.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-less-than-or-equal-to-operator.english.md index 9a5b9fbbcd..1e16a4affa 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-less-than-or-equal-to-operator.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-less-than-or-equal-to-operator.english.md @@ -70,7 +70,6 @@ function testLessOrEqual(val) { return "More Than 24"; } -// Change this value to test testLessOrEqual(10); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-equality-operator.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-equality-operator.english.md index c77dc69678..ca784fd89b 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-equality-operator.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-equality-operator.english.md @@ -57,7 +57,6 @@ function testStrict(val) { return "Not Equal"; } -// Change this value to test testStrict(10); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-inequality-operator.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-inequality-operator.english.md index a576e223f2..ebdbd652c1 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-inequality-operator.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-inequality-operator.english.md @@ -58,7 +58,6 @@ function testStrictNotEqual(val) { return "Equal"; } -// Change this value to test testStrictNotEqual(10); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparisons-with-the-logical-and-operator.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparisons-with-the-logical-and-operator.english.md index 3a38b289e9..7f460dd9b2 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparisons-with-the-logical-and-operator.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparisons-with-the-logical-and-operator.english.md @@ -85,7 +85,6 @@ function testLogicalAnd(val) { return "No"; } -// Change this value to test testLogicalAnd(10); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparisons-with-the-logical-or-operator.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparisons-with-the-logical-or-operator.english.md index c7f1f2a64c..fcfab94917 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparisons-with-the-logical-or-operator.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/comparisons-with-the-logical-or-operator.english.md @@ -89,7 +89,6 @@ function testLogicalOr(val) { return "Inside"; } -// Change this value to test testLogicalOr(15); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/counting-cards.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/counting-cards.english.md index 2c1fa6768c..1211816ed3 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/counting-cards.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/counting-cards.english.md @@ -61,8 +61,6 @@ function cc(card) { // Only change code above this line } -// Add/remove calls to test your function. -// Note: Only the last will display cc(2); cc(3); cc(7); cc('K'); cc('A'); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/generate-random-whole-numbers-within-a-range.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/generate-random-whole-numbers-within-a-range.english.md index a9c8abf690..e5862af21d 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/generate-random-whole-numbers-within-a-range.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/generate-random-whole-numbers-within-a-range.english.md @@ -59,7 +59,6 @@ function randomRange(myMin, myMax) { } -// Change these values to test your function var myRandom = randomRange(5, 15); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/golf-code.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/golf-code.english.md index 93bab08108..7c62d6c5b5 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/golf-code.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/golf-code.english.md @@ -66,7 +66,6 @@ function golfScore(par, strokes) { // Only change code above this line } -// Change these values to test golfScore(5, 4); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/introducing-else-if-statements.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/introducing-else-if-statements.english.md index 17bc552af4..c231aaebba 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/introducing-else-if-statements.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/introducing-else-if-statements.english.md @@ -71,7 +71,6 @@ function testElseIf(val) { return "Between 5 and 10"; } -// Change this value to test testElseIf(7); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/introducing-else-statements.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/introducing-else-statements.english.md index 35f597db20..56b3742686 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/introducing-else-statements.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/introducing-else-statements.english.md @@ -71,7 +71,6 @@ function testElse(val) { return result; } -// Change this value to test testElse(4); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/logical-order-in-if-else-statements.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/logical-order-in-if-else-statements.english.md index f6e04ec2d1..d8f0835703 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/logical-order-in-if-else-statements.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/logical-order-in-if-else-statements.english.md @@ -85,7 +85,6 @@ function orderMyLogic(val) { } } -// Change this value to test orderMyLogic(7); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/manipulating-complex-objects.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/manipulating-complex-objects.english.md index 0839e36331..b55a3f3530 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/manipulating-complex-objects.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/manipulating-complex-objects.english.md @@ -99,7 +99,7 @@ var myMusic = [ ], "gold": true } - // Add record here + // Add a record here ]; ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/multiple-identical-options-in-switch-statements.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/multiple-identical-options-in-switch-statements.english.md index f792c55547..64368361d5 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/multiple-identical-options-in-switch-statements.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/multiple-identical-options-in-switch-statements.english.md @@ -79,7 +79,6 @@ function sequentialSizes(val) { return answer; } -// Change this value to test sequentialSizes(1); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/practice-comparing-different-values.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/practice-comparing-different-values.english.md index fd26f7756d..3e5be2411f 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/practice-comparing-different-values.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/practice-comparing-different-values.english.md @@ -61,7 +61,6 @@ function compareEquality(a, b) { return "Not Equal"; } -// Change this value to test compareEquality(10, "10"); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/profile-lookup.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/profile-lookup.english.md index 086716a5f5..f567d93b2b 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/profile-lookup.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/profile-lookup.english.md @@ -84,7 +84,6 @@ function lookUpProfile(name, prop){ // Only change code above this line } -// Change these values to test your function lookUpProfile("Akira", "likes"); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/record-collection.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/record-collection.english.md index 6ba9591117..e0592d5981 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/record-collection.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/record-collection.english.md @@ -91,9 +91,7 @@ function updateRecords(id, prop, value) { return collection; } -// Alter values below to test your code updateRecords(5439, "artist", "ABBA"); - ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/replacing-if-else-chains-with-switch.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/replacing-if-else-chains-with-switch.english.md index 77cdc9c99d..593174311d 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/replacing-if-else-chains-with-switch.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/replacing-if-else-chains-with-switch.english.md @@ -98,7 +98,6 @@ function chainToSwitch(val) { return answer; } -// Change this value to test chainToSwitch(7); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/returning-boolean-values-from-functions.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/returning-boolean-values-from-functions.english.md index 6eac5bef35..669f4b016d 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/returning-boolean-values-from-functions.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/returning-boolean-values-from-functions.english.md @@ -68,7 +68,6 @@ function isLess(a, b) { // Only change code above this line } -// Change these values to test isLess(10, 15); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/selecting-from-many-options-with-switch-statements.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/selecting-from-many-options-with-switch-statements.english.md index 7fe5b87807..e34faced05 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/selecting-from-many-options-with-switch-statements.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/selecting-from-many-options-with-switch-statements.english.md @@ -68,7 +68,6 @@ function caseInSwitch(val) { return answer; } -// Change this value to test caseInSwitch(1); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/use-conditional-logic-with-if-statements.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/use-conditional-logic-with-if-statements.english.md index 4d99f01827..532fde4989 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/use-conditional-logic-with-if-statements.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/use-conditional-logic-with-if-statements.english.md @@ -78,7 +78,6 @@ function trueOrFalse(wasThatTrue) { } -// Change this value to test trueOrFalse(true); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/using-objects-for-lookups.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/using-objects-for-lookups.english.md index 809363cb28..cfdfdcbbf2 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/using-objects-for-lookups.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/using-objects-for-lookups.english.md @@ -99,7 +99,6 @@ function phoneticLookup(val) { return result; } -// Change this value to test phoneticLookup("charlie"); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/create-a-module-script.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/create-a-module-script.english.md index 66afa66d62..6f16307c67 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/create-a-module-script.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/create-a-module-script.english.md @@ -43,9 +43,9 @@ tests: ```html - + - + ``` @@ -59,9 +59,7 @@ tests: ```html - - ``` 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 7b8d7bf4c5..0fa47d51b7 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 @@ -37,7 +37,16 @@ This new way of creating strings gives you more flexibility to create robust str ## Instructions
Use template literal syntax with backticks to display each entry of the result object's failure array. Each entry should be wrapped inside an li element with the class attribute text-warning, and listed within the resultDisplayArray. -Use an iterator method (any kind of loop) to get the desired output. +Use an iterator method (any kind of loop) to get the desired output (shown below). + +```js +[ + '
  • no-var
  • ', + '
  • var-on-top
  • ', + '
  • linebreak
  • ' +] +``` +
    ## Tests @@ -71,18 +80,13 @@ const result = { function makeList(arr) { "use strict"; - // change code below this line + // Only change code below this line const resultDisplayArray = null; - // change code above this line + // Only change code above this line return resultDisplayArray; } -/** - * makeList(result.failure) should return: - * [ `
  • no-var
  • `, - * `
  • var-on-top
  • `, - * `
  • linebreak
  • ` ] - **/ + const resultDisplayArray = makeList(result.failure); ``` @@ -108,12 +112,7 @@ function makeList(arr) { return resultDisplayArray; } -/** - * makeList(result.failure) should return: - * [ `
  • no-var
  • `, - * `
  • var-on-top
  • `, - * `
  • linebreak
  • ` ] - **/ + const resultDisplayArray = makeList(result.failure); ``` 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 07bfa86ed2..480727ea24 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 @@ -53,14 +53,14 @@ tests: function printManyTimes(str) { "use strict"; - // change code below this line + // Only change code below this line var sentence = str + " is cool!"; for (var i = 0; i < str.length; i+=2) { console.log(sentence); } - // change code above this line + // Only change code above this line } printManyTimes("freeCodeCamp"); @@ -79,15 +79,11 @@ printManyTimes("freeCodeCamp"); function printManyTimes(str) { "use strict"; - // change code below this line - const SENTENCE = str + " is cool!"; for (let i = 0; i < str.length; i+=2) { console.log(SENTENCE); } - // change code above this line - } printManyTimes("freeCodeCamp"); ``` 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 df730af4f2..5bef8eae60 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 @@ -54,11 +54,11 @@ tests: const s = [5, 7, 2]; function editInPlace() { 'use strict'; - // change code below this line + // Only change code below this line // s = [2, 5, 7]; <- this is invalid - // change code above this line + // Only change code above this line } editInPlace(); ``` @@ -76,13 +76,9 @@ editInPlace(); const s = [5, 7, 2]; function editInPlace() { 'use strict'; - // change code below this line - - // s = [2, 5, 7]; <- this is invalid s[0] = 2; s[1] = 5; s[2] = 7; - // change code above this line } editInPlace(); ``` 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 f295ed1f59..36e338107a 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 @@ -58,10 +58,10 @@ function freezeObj() { const MATH_CONSTANTS = { PI: 3.14 }; - // change code below this line + // Only change code below this line - // change code above this line + // Only change code above this line try { MATH_CONSTANTS.PI = 99; } catch(ex) { @@ -87,10 +87,8 @@ function freezeObj() { const MATH_CONSTANTS = { PI: 3.14 }; - // change code below this line Object.freeze(MATH_CONSTANTS); - // change code above this line try { MATH_CONSTANTS.PI = 99; } catch(ex) { diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-class-syntax-to-define-a-constructor-function.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-class-syntax-to-define-a-constructor-function.english.md index 3202c6ad20..ed67216604 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-class-syntax-to-define-a-constructor-function.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-class-syntax-to-define-a-constructor-function.english.md @@ -65,12 +65,12 @@ tests:
    ```js -/* Alter code below this line */ +// Only change code below this line -/* Alter code above this line */ +// Only change code above this line const carrot = new Vegetable('carrot'); -console.log(carrot.name); // => should be 'carrot' +console.log(carrot.name); // Should display 'carrot' ```
    diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-arrays.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-arrays.english.md index 6358e902f2..e328e110f0 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-arrays.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-arrays.english.md @@ -54,9 +54,9 @@ tests: ```js let a = 8, b = 6; -// change code below this line +// Only change code below this line -// change code above this line +// Only change code above this line console.log(a); // should be 6 console.log(b); // should be 8 ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-nested-objects.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-nested-objects.english.md index 0ed315237c..a9de381ef6 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-nested-objects.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-nested-objects.english.md @@ -65,12 +65,12 @@ const LOCAL_FORECAST = { tomorrow: { low: 68, high: 80 } }; -// change code below this line +// Only change code below this line const lowToday = LOCAL_FORECAST.today.low; const highToday = LOCAL_FORECAST.today.high; -// change code above this line +// Only change code above this line console.log(lowToday); // should be 64 console.log(highToday); // should be 77 @@ -89,12 +89,8 @@ const LOCAL_FORECAST = { tomorrow: { low: 68, high: 80 } }; -// change code below this line - const { today: { low: lowToday, high: highToday }} = LOCAL_FORECAST; -// change code above this line - console.log(highToday); // should be 77 console.log(highTomorrow); // should be 80 ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-objects.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-objects.english.md index 4691ea6f24..bd3123aab1 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-objects.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-objects.english.md @@ -56,12 +56,12 @@ const HIGH_TEMPERATURES = { tomorrow: 80 }; -// change code below this line +// Only change code below this line const highToday = HIGH_TEMPERATURES.today; const highTomorrow = HIGH_TEMPERATURES.tomorrow; -// change code above this line +// Only change code above this line console.log(yesterday) // should be not defined console.log(highToday); // should be 77 @@ -81,12 +81,8 @@ const HIGH_TEMPERATURES = { tomorrow: 80 }; -// change code below this line - const { today: highToday, tomorrow: highTomorrow } = HIGH_TEMPERATURES; -// change code above this line - console.log(highToday); // should be 77 console.log(highTomorrow); // should be 80 ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-extract-values-from-objects.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-extract-values-from-objects.english.md index 5974a5696b..c0e29f673b 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-extract-values-from-objects.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-extract-values-from-objects.english.md @@ -61,12 +61,12 @@ const HIGH_TEMPERATURES = { tomorrow: 80 }; -// change code below this line +// Only change code below this line const today = HIGH_TEMPERATURES.today; const tomorrow = HIGH_TEMPERATURES.tomorrow; -// change code above this line +// Only change code above this line console.log(yesterday) // should be not defined console.log(today); // should be 77 @@ -86,12 +86,8 @@ const HIGH_TEMPERATURES = { tomorrow: 80 }; -// change code below this line - const { today, tomorrow } = HIGH_TEMPERATURES; -// change code above this line - console.log(yesterday) // should be not defined console.log(today); // should be 77 console.log(tomorrow); // should be 80 diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-pass-an-object-as-a-functions-parameters.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-pass-an-object-as-a-functions-parameters.english.md index 5107e09db9..380376ba23 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-pass-an-object-as-a-functions-parameters.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-pass-an-object-as-a-functions-parameters.english.md @@ -67,10 +67,10 @@ const stats = { average: 35.85 }; -// use function argument destructuring -// change code below this line +// Use function argument destructuring +// Only change code below this line const half = (stats) => (stats.max + stats.min) / 2.0; -// change code above this line +// Only change code above this line console.log(stats); // should be object console.log(half(stats)); // should be 28.015 diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-getters-and-setters-to-control-access-to-an-object.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-getters-and-setters-to-control-access-to-an-object.english.md index d07ae18109..fec340f2d4 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-getters-and-setters-to-control-access-to-an-object.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-getters-and-setters-to-control-access-to-an-object.english.md @@ -75,9 +75,9 @@ tests:
    ```js -/* Alter code below this line */ +// Only change code below this line -/* Alter code above this line */ +// Only change code above this line const thermos = new Thermostat(76); // setting in Fahrenheit scale let temp = thermos.temperature; // 24.44 in C @@ -95,8 +95,6 @@ temp = thermos.temperature; // 26 in C
    ```js - -/* Alter code below this line */ class Thermostat { constructor(fahrenheit) { this._tempInCelsius = 5/9 * (fahrenheit - 32); @@ -108,7 +106,6 @@ class Thermostat { this._tempInCelsius = newTemp; } } -/* Alter code above this line */ const thermos = new Thermostat(76); // setting in Fahrenheit scale let temp = thermos.temperature; // 24.44 in C diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/write-concise-declarative-functions-with-es6.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/write-concise-declarative-functions-with-es6.english.md index 518008b7fc..ea73909047 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/write-concise-declarative-functions-with-es6.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/write-concise-declarative-functions-with-es6.english.md @@ -58,14 +58,14 @@ tests:
    ```js -// change code below this line +// Only change code below this line const bicycle = { gear: 2, setGear: function(newGear) { this.gear = newGear; } }; -// change code above this line +// Only change code above this line bicycle.setGear(3); console.log(bicycle.gear); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/write-concise-object-literal-declarations-using-object-property-shorthand.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/write-concise-object-literal-declarations-using-object-property-shorthand.english.md index 6ee770ce87..0c369e1ab7 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/write-concise-object-literal-declarations-using-object-property-shorthand.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/write-concise-object-literal-declarations-using-object-property-shorthand.english.md @@ -54,13 +54,13 @@ tests: ```js const createPerson = (name, age, gender) => { "use strict"; - // change code below this line + // Only change code below this line return { name: name, age: age, gender: gender }; - // change code above this line + // Only change code above this line }; console.log(createPerson("Zodiac Hasbro", 56, "male")); // returns a proper object ``` 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 4b557b3dca..81e237dd9c 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 @@ -41,17 +41,14 @@ tests:
    ```js -/** - * A long process to prepare tea. - * @return {string} A cup of tea. - **/ +// Function that returns a string representing a cup of green tea const prepareTea = () => 'greenTea'; -/** - * Get given number of cups of tea. - * @param {number} numOfCups Number of required cups of tea. - * @return {Array} Given amount of tea cups. - **/ +/* +Given a function (representing the tea type) and number of cups needed, the +following function returns an array of strings (each representing a cup of +a specific type of tea). +*/ const getTea = (numOfCups) => { const teaCups = []; @@ -59,15 +56,12 @@ const getTea = (numOfCups) => { const teaCup = prepareTea(); teaCups.push(teaCup); } - return teaCups; }; -// Add your code below this line - -const tea4TeamFCC = null; // :( - -// Add your code above this line +// Only change code below this line +const tea4TeamFCC = null; +// Only change code above this line console.log(tea4TeamFCC); ``` 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 00c81d3985..fe0cf15e08 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 @@ -15,7 +15,10 @@ Adding one to a number is not very exciting, but we can apply these principles w ## Instructions
    -Rewrite the code so the global array bookList is not changed inside either function. The add function should add the given bookName to the end of an array. The remove function should remove the given bookName from an array. Both functions should return an array, and any new parameters should be added before the bookName parameter. +Rewrite the code so the global array bookList is not changed inside either function. The add function should add the given bookName to the end of the array passed to it and return a new array (list). The remove function should remove the given bookName from the array passed to it. + +Note: Both functions should return an array, and any new parameters should be added before the bookName parameter. +
    ## Tests @@ -45,22 +48,16 @@ tests: // the global variable var bookList = ["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "PhilosophiƦ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"]; -/* This function should add a book to the list and return the list */ -// New parameters should come before bookName - -// Add your code below this line +// Change code below this line function add (bookName) { bookList.push(bookName); return bookList; - // Add your code above this line + // Change code above this line } -/* This function should remove a book from the list and return the list */ -// New parameters should come before the bookName one - -// Add your code below this line +// Change code below this line function remove (bookName) { var book_index = bookList.indexOf(bookName); if (book_index >= 0) { @@ -68,7 +65,7 @@ function remove (bookName) { bookList.splice(book_index, 1); return bookList; - // Add your code above this line + // Change code above this line } } @@ -89,22 +86,13 @@ console.log(bookList);
    ```js -// the global variable +// The global variable var bookList = ["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "PhilosophiƦ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"]; -/* This function should add a book to the list and return the list */ -// New parameters should come before the bookName one - -// Add your code below this line function add (bookList, bookName) { return [...bookList, bookName]; - // Add your code above this line } -/* This function should remove a book from the list and return the list */ -// New parameters should come before the bookName one - -// Add your code below this line function remove (bookList, bookName) { const bookListCopy = [...bookList]; const bookNameIndex = bookList.indexOf(bookName); @@ -112,7 +100,6 @@ function remove (bookList, bookName) { bookListCopy.splice(bookNameIndex, 1); } return bookListCopy; - // Add your code above this line } var newBookList = add(bookList, 'A Brief History of Time'); 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 f57efd4e4c..d034f164a9 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 @@ -46,24 +46,17 @@ tests:
    ```js -/** - * A long process to prepare green tea. - * @return {string} A cup of green tea. - **/ +// Function that returns a string representing a cup of green tea const prepareGreenTea = () => 'greenTea'; -/** - * A long process to prepare black tea. - * @return {string} A cup of black tea. - **/ +// Function that returns a string representing a cup of black tea const prepareBlackTea = () => 'blackTea'; -/** - * Get given number of cups of tea. - * @param {function():string} prepareTea The type of tea preparing function. - * @param {number} numOfCups Number of required cups of tea. - * @return {Array} Given amount of tea cups. - **/ +/* +Given a function (representing the tea type) and number of cups needed, the +following function returns an array of strings (each representing a cup of +a specific type of tea). +*/ const getTea = (prepareTea, numOfCups) => { const teaCups = []; @@ -71,16 +64,13 @@ const getTea = (prepareTea, numOfCups) => { const teaCup = prepareTea(); teaCups.push(teaCup); } - return teaCups; }; -// Add your code below this line - -const tea4GreenTeamFCC = null; // :( -const tea4BlackTeamFCC = null; // :( - -// Add your code above this line +// Only change code below this line +const tea4GreenTeamFCC = null; +const tea4BlackTeamFCC = null; +// Only change code above this line console.log( tea4GreenTeamFCC, diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/understand-the-hazards-of-using-imperative-code.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/understand-the-hazards-of-using-imperative-code.english.md index d4a93b900c..1b484dc4e2 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/understand-the-hazards-of-using-imperative-code.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/understand-the-hazards-of-using-imperative-code.english.md @@ -47,7 +47,7 @@ tests: ```js // tabs is an array of titles of each site open within the window var Window = function(tabs) { - this.tabs = tabs; // we keep a record of the array inside the object + this.tabs = tabs; // We keep a record of the array inside the object }; // When you join two windows into one window @@ -58,7 +58,7 @@ Window.prototype.join = function (otherWindow) { // When you open a new tab at the end Window.prototype.tabOpen = function (tab) { - this.tabs.push('new tab'); // let's open a new tab for now + this.tabs.push('new tab'); // Let's open a new tab for now return this; }; @@ -67,10 +67,10 @@ Window.prototype.tabClose = function (index) { // Only change code below this line - var tabsBeforeIndex = this.tabs.splice(0, index); // get the tabs before the tab - var tabsAfterIndex = this.tabs.splice(index + 1); // get the tabs after the tab + var tabsBeforeIndex = this.tabs.splice(0, index); // Get the tabs before the tab + var tabsAfterIndex = this.tabs.splice(index + 1); // Get the tabs after the tab - this.tabs = tabsBeforeIndex.concat(tabsAfterIndex); // join them together + this.tabs = tabsBeforeIndex.concat(tabsAfterIndex); // Join them together // Only change code above this line @@ -80,13 +80,13 @@ Window.prototype.tabClose = function (index) { // Let's create three browser windows var workWindow = new Window(['GMail', 'Inbox', 'Work mail', 'Docs', 'freeCodeCamp']); // Your mailbox, drive, and other work sites var socialWindow = new Window(['FB', 'Gitter', 'Reddit', 'Twitter', 'Medium']); // Social sites -var videoWindow = new Window(['Netflix', 'YouTube', 'Vimeo', 'Vine']); // Entertainment sites +var videoWindow = new Window(['Netflix', 'YouTube', 'Vimeo', 'Vine']); // Entertainment sites // Now perform the tab opening, closing, and other operations var finalTabs = socialWindow - .tabOpen() // Open a new tab for cat memes - .join(videoWindow.tabClose(2)) // Close third tab in video window, and join - .join(workWindow.tabClose(1).tabOpen()); + .tabOpen() // Open a new tab for cat memes + .join(videoWindow.tabClose(2)) // Close third tab in video window, and join + .join(workWindow.tabClose(1).tabOpen()); console.log(finalTabs.tabs); ``` @@ -102,7 +102,7 @@ console.log(finalTabs.tabs); ```js // tabs is an array of titles of each site open within the window var Window = function(tabs) { - this.tabs = tabs; // we keep a record of the array inside the object + this.tabs = tabs; // We keep a record of the array inside the object }; // When you join two windows into one window @@ -113,16 +113,16 @@ Window.prototype.join = function (otherWindow) { // When you open a new tab at the end Window.prototype.tabOpen = function (tab) { - this.tabs.push('new tab'); // let's open a new tab for now + this.tabs.push('new tab'); // Let's open a new tab for now return this; }; // When you close a tab Window.prototype.tabClose = function (index) { - var tabsBeforeIndex = this.tabs.slice(0, index); // get the tabs before the tab - var tabsAfterIndex = this.tabs.slice(index + 1); // get the tabs after the tab + var tabsBeforeIndex = this.tabs.slice(0, index); // Get the tabs before the tab + var tabsAfterIndex = this.tabs.slice(index + 1); // Get the tabs after the tab - this.tabs = tabsBeforeIndex.concat(tabsAfterIndex); // join them together + this.tabs = tabsBeforeIndex.concat(tabsAfterIndex); // Join them together return this; }; @@ -133,9 +133,9 @@ var videoWindow = new Window(['Netflix', 'YouTube', 'Vimeo', 'Vine']); // Enter // Now perform the tab opening, closing, and other operations var finalTabs = socialWindow - .tabOpen() // Open a new tab for cat memes - .join(videoWindow.tabClose(2)) // Close third tab in video window, and join - .join(workWindow.tabClose(1).tabOpen()); + .tabOpen() // Open a new tab for cat memes + .join(videoWindow.tabClose(2)) // Close third tab in video window, and join + .join(workWindow.tabClose(1).tabOpen()); ```
    diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/convert-html-entities.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/convert-html-entities.english.md index 64241c27c1..c4f3aefa75 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/convert-html-entities.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/convert-html-entities.english.md @@ -47,7 +47,6 @@ tests: ```js function convertHTML(str) { - // :) return str; } diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/diff-two-arrays.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/diff-two-arrays.english.md index b0466fe601..168f59cbdb 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/diff-two-arrays.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/diff-two-arrays.english.md @@ -65,7 +65,6 @@ tests: ```js function diffArray(arr1, arr2) { var newArr = []; - // Same, same; but different. return newArr; } @@ -101,7 +100,6 @@ function diffArray(arr1, arr2) { Object.keys(h2).forEach(function(e) { if (!(e in h1)) newArr.push(h2[e]); }); - // Same, same; but different. return newArr; } ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/drop-it.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/drop-it.english.md index 8edfd6fb33..944083bbcf 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/drop-it.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/drop-it.english.md @@ -46,7 +46,6 @@ tests: ```js function dropElements(arr, func) { - // Drop them elements. return arr; } @@ -65,7 +64,6 @@ dropElements([1, 2, 3], function(n) {return n < 3; }); ```js function dropElements(arr, func) { - // Drop them elements. while (arr.length && !func(arr[0])) { arr.shift(); } diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/everything-be-true.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/everything-be-true.english.md index 9c48c9b5e1..77d2515588 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/everything-be-true.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/everything-be-true.english.md @@ -54,7 +54,6 @@ tests: ```js function truthCheck(collection, pre) { - // Is everyone being true? return pre; } @@ -73,7 +72,6 @@ truthCheck([{"user": "Tinky-Winky", "sex": "male"}, {"user": "Dipsy", "sex": "ma ```js function truthCheck(collection, pre) { - // Does everyone have one of these? return collection.every(function(e) { return e[pre]; }); } ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/seek-and-destroy.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/seek-and-destroy.english.md index 1179b4254a..ec94af9ed8 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/seek-and-destroy.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/seek-and-destroy.english.md @@ -46,7 +46,6 @@ tests: ```js function destroyer(arr) { - // Remove all the values return arr; } @@ -69,7 +68,6 @@ function destroyer(arr) { [].slice.call(arguments, 1).forEach(function(e) { hash[e] = true; }); - // Remove all the values return arr.filter(function(e) { return !(e in hash);}); } diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/spinal-tap-case.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/spinal-tap-case.english.md index 806849c35d..4a14828dba 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/spinal-tap-case.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/spinal-tap-case.english.md @@ -43,8 +43,6 @@ tests: ```js function spinalCase(str) { - // "It's such a fine line between stupid, and clever." - // --David St. Hubbins return str; } @@ -63,8 +61,6 @@ spinalCase('This Is Spinal Tap'); ```js function spinalCase(str) { - // "It's such a fine line between stupid, and clever." - // --David St. Hubbins str = str.replace(/([a-z](?=[A-Z]))/g, '$1 '); return str.toLowerCase().replace(/\ |\_/g, '-'); } diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/steamroller.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/steamroller.english.md index d03d289b76..fc698e38b2 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/steamroller.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/steamroller.english.md @@ -42,7 +42,6 @@ tests: ```js function steamrollArray(arr) { - // I'm a steamroller, baby return arr; } diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/wherefore-art-thou.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/wherefore-art-thou.english.md index 1c1d1da682..02d920efd7 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/wherefore-art-thou.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/wherefore-art-thou.english.md @@ -46,7 +46,6 @@ tests: ```js function whatIsInAName(collection, source) { - // What's in a name? var arr = []; // Only change code below this line diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/caesars-cipher.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/caesars-cipher.english.md index 530258751f..dcf4ac0e07 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/caesars-cipher.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/caesars-cipher.english.md @@ -43,12 +43,11 @@ tests:
    ```js -function rot13(str) { // LBH QVQ VG! +function rot13(str) { return str; } -// Change the inputs below to test rot13("SERR PBQR PNZC"); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/cash-register.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/cash-register.english.md index 42c1f7bebc..0d5fcd22bb 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/cash-register.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/cash-register.english.md @@ -15,6 +15,23 @@ Return {status: "INSUFFICIENT_FUNDS", change: []} if cash-in-drawer Return {status: "CLOSED", change: [...]} with cash-in-drawer as the value for the key change if it is equal to the change due. Otherwise, return {status: "OPEN", change: [...]}, with the change due in coins and bills, sorted in highest to lowest order, as the value of the change key.
    Currency UnitAmount
    Penny$0.01 (PENNY)
    Nickel$0.05 (NICKEL)
    Dime$0.1 (DIME)
    Quarter$0.25 (QUARTER)
    Dollar$1 (DOLLAR)
    Five Dollars$5 (FIVE)
    Ten Dollars$10 (TEN)
    Twenty Dollars$20 (TWENTY)
    One-hundred Dollars$100 (ONE HUNDRED)
    + +See below for an example of a cash-in-drawer array: + +```js +[ + ["PENNY", 1.01], + ["NICKEL", 2.05], + ["DIME", 3.1], + ["QUARTER", 4.25], + ["ONE", 90], + ["FIVE", 55], + ["TEN", 20], + ["TWENTY", 60], + ["ONE HUNDRED", 100] +] +``` +
    ## Instructions @@ -52,21 +69,9 @@ tests: ```js function checkCashRegister(price, cash, cid) { var change; - // Here is your change, ma'am. return change; } -// Example cash-in-drawer array: -// [["PENNY", 1.01], -// ["NICKEL", 2.05], -// ["DIME", 3.1], -// ["QUARTER", 4.25], -// ["ONE", 90], -// ["FIVE", 55], -// ["TEN", 20], -// ["TWENTY", 60], -// ["ONE HUNDRED", 100]] - checkCashRegister(19.5, 20, [["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.1], ["QUARTER", 4.25], ["ONE", 90], ["FIVE", 55], ["TEN", 20], ["TWENTY", 60], ["ONE HUNDRED", 100]]); ``` diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/palindrome-checker.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/palindrome-checker.english.md index ab3edad101..e89e202049 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/palindrome-checker.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/palindrome-checker.english.md @@ -63,7 +63,6 @@ tests: ```js function palindrome(str) { - // Good luck! return true; } diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/telephone-number-validator.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/telephone-number-validator.english.md index edbc2d05d1..12cb814e5b 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/telephone-number-validator.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/telephone-number-validator.english.md @@ -90,7 +90,6 @@ tests: ```js function telephoneCheck(str) { - // Good luck! return true; } diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-the-prototype-chain.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-the-prototype-chain.english.md index 8d3c1fbe7a..bfd7cfe08f 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-the-prototype-chain.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-the-prototype-chain.english.md @@ -14,21 +14,20 @@ function Bird(name) { this.name = name; } -typeof Bird.prototype; // => object +typeof Bird.prototype; // yields 'object' ``` Because a prototype is an object, a prototype can have its own prototype! In this case, the prototype of Bird.prototype is Object.prototype: ```js -Object.prototype.isPrototypeOf(Bird.prototype); -// returns true +Object.prototype.isPrototypeOf(Bird.prototype); // returns true ``` How is this useful? You may recall the hasOwnProperty method from a previous challenge: ```js let duck = new Bird("Donald"); -duck.hasOwnProperty("name"); // => true +duck.hasOwnProperty("name"); // yields true ``` The hasOwnProperty method is defined in Object.prototype, which can be accessed by Bird.prototype, which can then be accessed by duck. This is an example of the prototype chain. @@ -65,7 +64,7 @@ function Dog(name) { let beagle = new Dog("Snoopy"); -Dog.prototype.isPrototypeOf(beagle); // => true +Dog.prototype.isPrototypeOf(beagle); // yields true // Fix the code below so that it evaluates to true ???.isPrototypeOf(Dog.prototype); diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/verify-an-objects-constructor-with-instanceof.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/verify-an-objects-constructor-with-instanceof.english.md index d4ca431dfc..6e3470d34d 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/verify-an-objects-constructor-with-instanceof.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/verify-an-objects-constructor-with-instanceof.english.md @@ -60,8 +60,6 @@ tests:
    ```js -/* jshint expr: true */ - function House(numBedrooms) { this.numBedrooms = numBedrooms; }