diff --git a/challenges/advanced-bonfires.json b/challenges/advanced-bonfires.json
index b186b9290d..dd4b9d3778 100644
--- a/challenges/advanced-bonfires.json
+++ b/challenges/advanced-bonfires.json
@@ -20,27 +20,27 @@
],
"tests": [
"assert.isBoolean(telephoneCheck(\"555-555-5555\"), 'message: should return a boolean.');",
- "assert(telephoneCheck(\"1 555-555-5555\") === true, 'message: 1 555-555-5555
should return true.');",
- "assert(telephoneCheck(\"1 (555) 555-5555\") === true, 'message: 1 (555) 555-5555
should return true.');",
- "assert(telephoneCheck(\"5555555555\") === true, 'message: 5555555555
should return true.');",
- "assert(telephoneCheck(\"555-555-5555\") === true, 'message: 555-555-5555
should return true.');",
- "assert(telephoneCheck(\"(555)555-5555\") === true, 'message: (555)555-5555
should return true.');",
- "assert(telephoneCheck(\"1(555)555-5555\") === true, 'message: 1(555)555-5555
should return true.');",
- "assert(telephoneCheck(\"1 555 555 5555\") === true, 'message: 1 555 555 5555
should return true.');",
- "assert(telephoneCheck(\"555-555-5555\") === true, 'message: 555-555-5555
should return true.');",
- "assert(telephoneCheck(\"1 456 789 4444\") === true, 'message: 1 456 789 4444
should return true.');",
- "assert(telephoneCheck(\"123**&!!asdf#\") === false, 'message: 123**&!!asdf#
should return false.');",
- "assert(telephoneCheck(\"55555555\") === false, 'message: 55555555
should return false.');",
- "assert(telephoneCheck(\"(6505552368)\") === false, 'message: (6505552368)
should return false');",
- "assert(telephoneCheck(\"2 (757) 622-7382\") === false, 'message: 2 (757) 622-7382
should return false.');",
- "assert(telephoneCheck(\"0 (757) 622-7382\") === false, 'message: 0 (757) 622-7382
should return false.');",
- "assert(telephoneCheck(\"-1 (757) 622-7382\") === false, 'message: -1 (757) 622-7382
should return false');",
- "assert(telephoneCheck(\"2 757 622-7382\") === false, 'message: 2 757 622-7382
should return false.');",
- "assert(telephoneCheck(\"10 (757) 622-7382\") === false, 'message: 10 (757) 622-7382
should return false.');",
- "assert(telephoneCheck(\"27576227382\") === false, 'message: 27576227382
should return false.');",
- "assert(telephoneCheck(\"(275)76227382\") === false, 'message: (275)76227382
should return false.');",
- "assert(telephoneCheck(\"2(757)6227382\") === false, 'message: 2(757)6227382
should return false.');",
- "assert(telephoneCheck(\"2(757)622-7382\") === false, 'message: 2(757)622-7382
should return false.');"
+ "assert(telephoneCheck(\"1 555-555-5555\") === true, 'message: telephoneCheck(\"1 555-555-5555\")
should return true.');",
+ "assert(telephoneCheck(\"1 (555) 555-5555\") === true, 'message: telephoneCheck(\"1 (555) 555-5555\")
should return true.');",
+ "assert(telephoneCheck(\"5555555555\") === true, 'message: telephoneCheck(\"5555555555\")
should return true.');",
+ "assert(telephoneCheck(\"555-555-5555\") === true, 'message: telephoneCheck(\"555-555-5555\")
should return true.');",
+ "assert(telephoneCheck(\"(555)555-5555\") === true, 'message: telephoneCheck(\"(555)555-5555\")
should return true.');",
+ "assert(telephoneCheck(\"1(555)555-5555\") === true, 'message: telephoneCheck(\"1(555)555-5555\")
should return true.');",
+ "assert(telephoneCheck(\"1 555 555 5555\") === true, 'message: telephoneCheck(\"1 555 555 5555\")
should return true.');",
+ "assert(telephoneCheck(\"555-555-5555\") === true, 'message: telephoneCheck(\"555-555-5555\")
should return true.');",
+ "assert(telephoneCheck(\"1 456 789 4444\") === true, 'message: telephoneCheck(\"1 456 789 4444\")
should return true.');",
+ "assert(telephoneCheck(\"123**&!!asdf#\") === false, 'message: telephoneCheck(\"123**&!!asdf#\")
should return false.');",
+ "assert(telephoneCheck(\"55555555\") === false, 'message: telephoneCheck(\"55555555\")
should return false.');",
+ "assert(telephoneCheck(\"(6505552368)\") === false, 'message: telephoneCheck(\"(6505552368)\")
should return false');",
+ "assert(telephoneCheck(\"2 (757) 622-7382\") === false, 'message: telephoneCheck(\"2 (757) 622-7382\")
should return false.');",
+ "assert(telephoneCheck(\"0 (757) 622-7382\") === false, 'message: telephoneCheck(\"0 (757) 622-7382\")
should return false.');",
+ "assert(telephoneCheck(\"-1 (757) 622-7382\") === false, 'message: telephoneCheck(\"-1 (757) 622-7382\")
should return false');",
+ "assert(telephoneCheck(\"2 757 622-7382\") === false, 'message: telephoneCheck(\"2 757 622-7382\")
should return false.');",
+ "assert(telephoneCheck(\"10 (757) 622-7382\") === false, 'message: telephoneCheck(\"10 (757) 622-7382\")
should return false.');",
+ "assert(telephoneCheck(\"27576227382\") === false, 'message: telephoneCheck(\"27576227382\")
should return false.');",
+ "assert(telephoneCheck(\"(275)76227382\") === false, 'message: telephoneCheck(\"(275)76227382\")
should return false.');",
+ "assert(telephoneCheck(\"2(757)6227382\") === false, 'message: telephoneCheck(\"2(757)6227382\")
should return false.');",
+ "assert(telephoneCheck(\"2(757)622-7382\") === false, 'message: telephoneCheck(\"2(757)622-7382\")
should return false.');"
],
"challengeSeed": [
"function telephoneCheck(str) {",
@@ -85,10 +85,10 @@
"sym([1, 2, 3], [5, 2, 1, 4]);"
],
"tests": [
- "assert.sameMembers(sym([1, 2, 3], [5, 2, 1, 4]), [3, 5, 4], 'message: [1, 2, 3], [5, 2, 1, 4]
should return [3, 5, 4]
.');",
- "assert.sameMembers(sym([1, 2, 5], [2, 3, 5], [3, 4, 5]), [1, 4, 5], 'message: [1, 2, 5], [2, 3, 5], [3, 4, 5]
should return [1, 4, 5]
');",
- "assert.sameMembers(sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]), [1, 4, 5], 'message: [1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]
should return [1, 4, 5]
.');",
- "assert.sameMembers(sym([1, 1]), [1], 'message: [1, 1]
should return [1]
.');"
+ "assert.sameMembers(sym([1, 2, 3], [5, 2, 1, 4]), [3, 5, 4], 'message: sym([1, 2, 3], [5, 2, 1, 4])
should return [3, 5, 4]
.');",
+ "assert.sameMembers(sym([1, 2, 5], [2, 3, 5], [3, 4, 5]), [1, 4, 5], 'message: sym([1, 2, 5], [2, 3, 5], [3, 4, 5])
should return [1, 4, 5]
');",
+ "assert.sameMembers(sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]), [1, 4, 5], 'message: sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5])
should return [1, 4, 5]
.');",
+ "assert.sameMembers(sym([1, 1]), [1], 'message: sym([1, 1])
should return [1]
.');"
],
"MDNlinks": [
"Array.reduce()",
@@ -139,13 +139,13 @@
"drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]);"
],
"tests": [
- "assert.isArray(drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]), 'message: 19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]
should return an array.');",
- "assert.isString(drawer(19.50, 20.00, [['PENNY', 0.01], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]), 'message: 19.50, 20.00, [['PENNY', 0.01], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]
should return a string.');",
- "assert.isString(drawer(19.50, 20.00, [['PENNY', 0.50], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]), 'message: 19.50, 20.00, [['PENNY', 0.50], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]
should return a string.');",
- "assert.deepEqual(drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]), [['QUARTER', 0.50]], 'message: 19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]])
should return [['QUARTER', 0.50]]
.');",
- "assert.deepEqual(drawer(3.26, 100.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]), [['TWENTY', 60.00], ['TEN', 20.00], ['FIVE', 15], ['ONE', 1], ['QUARTER', 0.50], ['DIME', 0.20], ['PENNY', 0.04]], 'message: 3.26, 100.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]
should return [['TWENTY', 60.00], ['TEN', 20.00], ['FIVE', 15], ['ONE', 1], ['QUARTER', 0.50], ['DIME', 0.20], ['PENNY', 0.04]]
.');",
- "assert.deepEqual(drawer(19.50, 20.00, [['PENNY', 0.01], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]), 'Insufficient Funds', 'message: 19.50, 20.00, [['PENNY', 0.01], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]
should return \"Insufficient Funds\".');",
- "assert.deepEqual(drawer(19.50, 20.00, [['PENNY', 0.50], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]), \"Closed\", 'message: 19.50, 20.00, [['PENNY', 0.50], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]
should return \"Closed\".');"
+ "assert.isArray(drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]), 'message: drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]])
should return an array.');",
+ "assert.isString(drawer(19.50, 20.00, [['PENNY', 0.01], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]), 'message: drawer(19.50, 20.00, [['PENNY', 0.01], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]])
should return a string.');",
+ "assert.isString(drawer(19.50, 20.00, [['PENNY', 0.50], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]), 'message: drawer(19.50, 20.00, [['PENNY', 0.50], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]])
should return a string.');",
+ "assert.deepEqual(drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]), [['QUARTER', 0.50]], 'message: drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]])
should return [['QUARTER', 0.50]]
.');",
+ "assert.deepEqual(drawer(3.26, 100.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]), [['TWENTY', 60.00], ['TEN', 20.00], ['FIVE', 15], ['ONE', 1], ['QUARTER', 0.50], ['DIME', 0.20], ['PENNY', 0.04]], 'message: drawer(3.26, 100.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]])
should return [['TWENTY', 60.00], ['TEN', 20.00], ['FIVE', 15], ['ONE', 1], ['QUARTER', 0.50], ['DIME', 0.20], ['PENNY', 0.04]]
.');",
+ "assert.deepEqual(drawer(19.50, 20.00, [['PENNY', 0.01], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]), 'Insufficient Funds', 'message: drawer(19.50, 20.00, [['PENNY', 0.01], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]])
should return \"Insufficient Funds\".');",
+ "assert.deepEqual(drawer(19.50, 20.00, [['PENNY', 0.50], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]), \"Closed\", 'message: drawer(19.50, 20.00, [['PENNY', 0.50], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]])
should return \"Closed\".');"
],
"MDNlinks": [
"Global Object"
@@ -197,10 +197,10 @@
"tests": [
"assert.isArray(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), 'message: inventory()
should return an array.');",
"assert.equal(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]).length, 6, 'message: inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]).length
should return an array with a length of 6.');",
- "assert.deepEqual(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), [[88, 'Bowling Ball'], [2, 'Dirty Sock'], [3, 'Hair Pin'], [3, 'Half-Eaten Apple'], [5, 'Microphone'], [7, 'Toothpaste']], 'message: [[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]
should return [[88, 'Bowling Ball'], [2, 'Dirty Sock'], [3, 'Hair Pin'], [3, 'Half-Eaten Apple'], [5, 'Microphone'], [7, 'Toothpaste']]
.');",
- "assert.deepEqual(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], []), [[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], 'message: [[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], []
should return [[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']]
.);",
- "assert.deepEqual(inventory([], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), [[67, 'Bowling Ball'], [2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [7, 'Toothpaste']], 'message: [], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]
should return [[67, 'Bowling Ball'], [2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [7, 'Toothpaste']]
.');",
- "assert.deepEqual(inventory([[0, 'Bowling Ball'], [0, 'Dirty Sock'], [0, 'Hair Pin'], [0, 'Microphone']], [[1, 'Hair Pin'], [1, 'Half-Eaten Apple'], [1, 'Bowling Ball'], [1, 'Toothpaste']]), [[1, 'Bowling Ball'], [0, 'Dirty Sock'], [1, 'Hair Pin'], [1, 'Half-Eaten Apple'], [0, 'Microphone'], [1, 'Toothpaste']], 'message: [[0, 'Bowling Ball'], [0, 'Dirty Sock'], [0, 'Hair Pin'], [0, 'Microphone']], [[1, 'Hair Pin'], [1, 'Half-Eaten Apple'], [1, 'Bowling Ball'], [1, 'Toothpaste']]
should return [[1, 'Bowling Ball'], [0, 'Dirty Sock'], [1, 'Hair Pin'], [1, 'Half-Eaten Apple'], [0, 'Microphone'], [1, 'Toothpaste']]
.');"
+ "assert.deepEqual(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), [[88, 'Bowling Ball'], [2, 'Dirty Sock'], [3, 'Hair Pin'], [3, 'Half-Eaten Apple'], [5, 'Microphone'], [7, 'Toothpaste']], 'message: inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']])
should return [[88, 'Bowling Ball'], [2, 'Dirty Sock'], [3, 'Hair Pin'], [3, 'Half-Eaten Apple'], [5, 'Microphone'], [7, 'Toothpaste']]
.');",
+ "assert.deepEqual(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], []), [[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], 'message: inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [])
should return [[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']]
.);",
+ "assert.deepEqual(inventory([], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), [[67, 'Bowling Ball'], [2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [7, 'Toothpaste']], 'message: inventory([], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']])
should return [[67, 'Bowling Ball'], [2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [7, 'Toothpaste']]
.');",
+ "assert.deepEqual(inventory([[0, 'Bowling Ball'], [0, 'Dirty Sock'], [0, 'Hair Pin'], [0, 'Microphone']], [[1, 'Hair Pin'], [1, 'Half-Eaten Apple'], [1, 'Bowling Ball'], [1, 'Toothpaste']]), [[1, 'Bowling Ball'], [0, 'Dirty Sock'], [1, 'Hair Pin'], [1, 'Half-Eaten Apple'], [0, 'Microphone'], [1, 'Toothpaste']], 'message: inventory([[0, 'Bowling Ball'], [0, 'Dirty Sock'], [0, 'Hair Pin'], [0, 'Microphone']], [[1, 'Hair Pin'], [1, 'Half-Eaten Apple'], [1, 'Bowling Ball'], [1, 'Toothpaste']])
should return [[1, 'Bowling Ball'], [0, 'Dirty Sock'], [1, 'Hair Pin'], [1, 'Half-Eaten Apple'], [0, 'Microphone'], [1, 'Toothpaste']]
.');"
],
"MDNlinks": [
"Global Array Object"
@@ -235,13 +235,13 @@
"permAlone('aab');"
],
"tests": [
- "assert.isNumber(permAlone('aab'), 'message: aab
should return a number.');",
- "assert.strictEqual(permAlone('aab'), 2, 'message: aab
should return 2
.');",
- "assert.strictEqual(permAlone('aaa'), 0, 'message: aaa
should return 0
.');",
- "assert.strictEqual(permAlone('aabb'), 8, 'message: aabb
should return 8
.');",
- "assert.strictEqual(permAlone('abcdefa'), 3600, 'message: abcdefa
should return 3600
.');",
- "assert.strictEqual(permAlone('abfdefa'), 2640, 'message: abfdefa
should return 2640
.');",
- "assert.strictEqual(permAlone('zzzzzzzz'), 0, 'message: zzzzzzzz
should return 0
.');"
+ "assert.isNumber(permAlone('aab'), 'message: permAlone()
should return a number.');",
+ "assert.strictEqual(permAlone('aab'), 2, 'message: permAlone(aab)
should return 2.');",
+ "assert.strictEqual(permAlone('aaa'), 0, 'message: permAlone(aaa)
should return 0.');",
+ "assert.strictEqual(permAlone('aabb'), 8, 'message: permAlone(aabb)
should return 8.');",
+ "assert.strictEqual(permAlone('abcdefa'), 3600, 'message: permAlone(abcdefa)
should return 3600.');",
+ "assert.strictEqual(permAlone('abfdefa'), 2640, 'message: permAlone(abfdefa)
should return 2640.');",
+ "assert.strictEqual(permAlone('zzzzzzzz'), 0, 'message: permAlone(zzzzzzzz)
should return 0.');"
],
"MDNlinks": [
"Permutations",
@@ -281,12 +281,12 @@
"friendly(['2015-07-01', '2015-07-04']);"
],
"tests": [
- "assert.deepEqual(friendly(['2015-07-01', '2015-07-04']), ['July 1st','4th'], 'message: [\"2015-07-01\", \"2015-07-04\"]
should return [\"July 1st\",\"4th\"]
.');",
- "assert.deepEqual(friendly(['2015-12-01', '2016-02-03']), ['December 1st','February 3rd'], 'message: [\"2015-12-01\", \"2016-02-03\"]
should return [\"December 1st\",\"February 3rd\"]
.');",
- "assert.deepEqual(friendly(['2015-12-01', '2017-02-03']), ['December 1st, 2015','February 3rd, 2017'], 'message: [\"2015-12-01\", \"2017-02-03\"]
should return [\"December 1st, 2015\",\"February 3rd, 2017\"]
.');",
- "assert.deepEqual(friendly(['2016-03-01', '2016-05-05']), ['March 1st','May 5th'], 'message: [\"2016-03-01\", \"2016-05-05\"]
should return [\"March 1st\",\"May 5th\"]
');",
- "assert.deepEqual(friendly(['2017-01-01', '2017-01-01']), ['January 1st, 2017'], 'message: [\"2017-01-01\", \"2017-01-01\"]
should return [\"January 1st, 2017\"]
.');",
- "assert.deepEqual(friendly(['2022-09-05', '2023-09-04']), ['September 5th, 2022','September 4th, 2023'], 'message: [\"2022-09-05\", \"2023-09-04\"]
should return [\"September 5th, 2022\",\"September 4th, 2023\"]
.');"
+ "assert.deepEqual(friendly(['2015-07-01', '2015-07-04']), ['July 1st','4th'], 'message: friendly([\"2015-07-01\", \"2015-07-04\"])
should return [\"July 1st\",\"4th\"]
.');",
+ "assert.deepEqual(friendly(['2015-12-01', '2016-02-03']), ['December 1st','February 3rd'], 'message: friendly([\"2015-12-01\", \"2016-02-03\"])
should return [\"December 1st\",\"February 3rd\"]
.');",
+ "assert.deepEqual(friendly(['2015-12-01', '2017-02-03']), ['December 1st, 2015','February 3rd, 2017'], 'message: friendly([\"2015-12-01\", \"2017-02-03\"])
should return [\"December 1st, 2015\",\"February 3rd, 2017\"]
.');",
+ "assert.deepEqual(friendly(['2016-03-01', '2016-05-05']), ['March 1st','May 5th'], 'message: friendly([\"2016-03-01\", \"2016-05-05\"])
should return [\"March 1st\",\"May 5th\"]
');",
+ "assert.deepEqual(friendly(['2017-01-01', '2017-01-01']), ['January 1st, 2017'], 'message: friendly([\"2017-01-01\", \"2017-01-01\"])
should return [\"January 1st, 2017\"]
.');",
+ "assert.deepEqual(friendly(['2022-09-05', '2023-09-04']), ['September 5th, 2022','September 4th, 2023'], 'message: friendly([\"2022-09-05\", \"2023-09-04\"])
should return [\"September 5th, 2022\",\"September 4th, 2023\"]
.');"
],
"MDNlinks": [
"String.split()",
diff --git a/challenges/basic-bonfires.json b/challenges/basic-bonfires.json
index f94842ebaa..c903c225d5 100644
--- a/challenges/basic-bonfires.json
+++ b/challenges/basic-bonfires.json
@@ -13,8 +13,8 @@
"Make this function return true no matter what."
],
"tests": [
- "assert(typeof(meetBonfire()) === \"boolean\", 'message: The result should be a Boolean value of true or false.');",
- "assert(meetBonfire() === true, 'message: Your meetBonfire()
function should return true
.');"
+ "assert(typeof(meetBonfire()) === \"boolean\", 'message: meetBonfire()
should return a boolean value.');",
+ "assert(meetBonfire() === true, 'message: meetBonfire()
should return true.');"
],
"challengeSeed": [
"function meetBonfire(argument) {",
@@ -46,10 +46,10 @@
"title": "Reverse a String",
"difficulty": "1.01",
"tests": [
- "assert(typeof(reverseString(\"hello\")) === \"string\", 'message: reverseString()
should return a string.');",
- "assert(reverseString(\"hello\") === \"olleh\", 'message: \"hello\"
should become \"olleh\"
.');",
- "assert(reverseString(\"Howdy\") === \"ydwoH\", 'message: \"Howdy\"
should become \"ydwoH\"
.');",
- "assert(reverseString(\"Greetings from Earth\") === \"htraE morf sgniteerG\", 'message: \"Greetings from Earth\"
should return \"htraE morf sgniteerG\"
.');"
+ "assert(typeof(reverseString(\"hello\")) === \"string\", 'message: reverseString()
should return a string.');",
+ "assert(reverseString(\"hello\") === \"olleh\", 'message: reverseString(\"hello\")
should become \"olleh\"
.');",
+ "assert(reverseString(\"Howdy\") === \"ydwoH\", 'message: reverseString(\"Howdy\")
should become \"ydwoH\"
.');",
+ "assert(reverseString(\"Greetings from Earth\") === \"htraE morf sgniteerG\", 'message: reverseString(\"Greetings from Earth\")
should return \"htraE morf sgniteerG\"
.');"
],
"description": [
"Reverse the provided string.",
@@ -87,11 +87,11 @@
"id": "a302f7aae1aa3152a5b413bc",
"title": "Factorialize a Number",
"tests": [
- "assert(typeof(factorialize(5)) === \"number\", 'message: factorialize()
should return a number.');",
- "assert(factorialize(5) === 120, 'message: 5
should return 120
.');",
- "assert(factorialize(10) === 3628800, 'message: 10
should return 3,628,800
.');",
- "assert(factorialize(20) === 2432902008176640000, 'message: 20
should return 2,432,902,008,176,640,000
.');",
- "assert(factorialize(0) === 1, 'message: 0
should return 1.');"
+ "assert(typeof(factorialize(5)) === \"number\", 'message: factorialize()
should return a number.');",
+ "assert(factorialize(5) === 120, 'message: factorialize(5)
should return 120.');",
+ "assert(factorialize(10) === 3628800, 'message: factorialize(10)
should return 3,628,800.');",
+ "assert(factorialize(20) === 2432902008176640000, 'message: factorialize(20)
should return 2,432,902,008,176,640,000.');",
+ "assert(factorialize(0) === 1, 'message: factorialize(0)
should return 1.');"
],
"difficulty": "1.02",
"description": [
@@ -136,17 +136,17 @@
"Remember to use Read-Search-Ask if you get stuck. Write your own code."
],
"tests": [
- "assert(typeof(palindrome(\"eye\")) === \"boolean\", 'message: palindrome() should return a boolean.');",
- "assert(palindrome(\"eye\") === true, 'message: \"eye\"
should return true.');",
- "assert(palindrome(\"race car\") === true, 'message: \"race car\"
should return true.');",
- "assert(palindrome(\"not a palindrome\") === false, 'message: \"not a palindrome\"
should return false.');",
- "assert(palindrome(\"A man, a plan, a canal. Panama\") === true, 'message: \"A man, a plan, a canal. Panama\"
should return true.');",
- "assert(palindrome(\"never odd or even\") === true, 'message: \"never odd or even\"
should return true.');",
- "assert(palindrome(\"nope\") === false, 'message: \"nope\"
should return false.');",
- "assert(palindrome(\"almostomla\") === false, 'message: \"almostomla\"
should return false.');",
- "assert(palindrome(\"My age is 0, 0 si ega ym.\") === true, 'message: \"My age is 0, 0 si ega ym.\"
should return true.');",
- "assert(palindrome(\"1 eye for of 1 eye.\") === false, 'message: \"1 eye for of 1 eye.\"
should return false.');",
- "assert(palindrome(\"0_0 (: /-\\ :) 0-0\") === true, 'message: \"0_0 (: /-\\\\ :) 0-0\"
should return true.');"
+ "assert(typeof(palindrome(\"eye\")) === \"boolean\", 'message: palindrome() should return a boolean.');",
+ "assert(palindrome(\"eye\") === true, 'message: palindrome(\"eye\")
should return true.');",
+ "assert(palindrome(\"race car\") === true, 'message: palindrome(\"race car\")
should return true.');",
+ "assert(palindrome(\"not a palindrome\") === false, 'message: palindrome(\"not a palindrome\")
should return false.');",
+ "assert(palindrome(\"A man, a plan, a canal. Panama\") === true, 'message: palindrome(\"A man, a plan, a canal. Panama\")
should return true.');",
+ "assert(palindrome(\"never odd or even\") === true, 'message: palindrome(\"never odd or even\")
should return true.');",
+ "assert(palindrome(\"nope\") === false, 'message: palindrome(\"nope\")
should return false.');",
+ "assert(palindrome(\"almostomla\") === false, 'message: palindrome(\"almostomla\")
should return false.');",
+ "assert(palindrome(\"My age is 0, 0 si ega ym.\") === true, 'message: palindrome(\"My age is 0, 0 si ega ym.\")
should return true.');",
+ "assert(palindrome(\"1 eye for of 1 eye.\") === false, 'message: palindrome(\"1 eye for of 1 eye.\")
should return false.');",
+ "assert(palindrome(\"0_0 (: /-\\ :) 0-0\") === true, 'message: palindrome(\"0_0 (: /-\\\\ :) 0-0\")
should return true.');"
],
"challengeSeed": [
"function palindrome(str) {",
@@ -192,12 +192,12 @@
"findLongestWord(\"The quick brown fox jumped over the lazy dog\");"
],
"tests": [
- "assert(typeof(findLongestWord(\"The quick brown fox jumped over the lazy dog\")) === \"number\", 'message: findLongestWord()
should return a number.');",
- "assert(findLongestWord(\"The quick brown fox jumped over the lazy dog\") === 6, 'message: \"The quick brown fox jumped over the lazy dog\"
should return 6
.');",
- "assert(findLongestWord(\"May the force be with you\") === 5, 'message: \"May the force be with you\"
should return 5
.');",
- "assert(findLongestWord(\"Google do a barrel roll\") === 6, 'message: \"Google do a barrel roll\"
should return 6
.');",
- "assert(findLongestWord(\"What is the average airspeed velocity of an unladen swallow\") === 8, 'message: \"What is the average airspeed velocity of an unladen swallow\"
should return 8
.');",
- "assert(findLongestWord(\"What if we try a super-long word such as otorhinolaryngology\") === 19, 'message: \"What if we try a super-long word such as otorhinolaryngology\"
should return 19
.');"
+ "assert(typeof(findLongestWord(\"The quick brown fox jumped over the lazy dog\")) === \"number\", 'message: findLongestWord()
should return a number.');",
+ "assert(findLongestWord(\"The quick brown fox jumped over the lazy dog\") === 6, 'message: findLongestWord(\"The quick brown fox jumped over the lazy dog\")
should return 6.');",
+ "assert(findLongestWord(\"May the force be with you\") === 5, 'message: findLongestWord(\"May the force be with you\")
should return 5.');",
+ "assert(findLongestWord(\"Google do a barrel roll\") === 6, 'message: findLongestWord(\"Google do a barrel roll\")
should return 6.');",
+ "assert(findLongestWord(\"What is the average airspeed velocity of an unladen swallow\") === 8, 'message: findLongestWord(\"What is the average airspeed velocity of an unladen swallow\")
should return 8.');",
+ "assert(findLongestWord(\"What if we try a super-long word such as otorhinolaryngology\") === 19, 'message: findLongestWord(\"What if we try a super-long word such as otorhinolaryngology\")
should return 19.');"
],
"MDNlinks": [
"String.split()",
@@ -233,10 +233,10 @@
"titleCase(\"I'm a little tea pot\", \"\");"
],
"tests": [
- "assert(typeof(titleCase(\"I'm a little tea pot\")) === \"string\", 'message: titleCase()
should return a string.');",
- "assert(titleCase(\"I'm a little tea pot\") === \"I'm A Little Tea Pot\", 'message: \"I'm a little tea pot\"
should return \"I'm A Little Tea Pot\"
.');",
- "assert(titleCase(\"sHoRt AnD sToUt\") === \"Short And Stout\", 'message: \"sHoRt AnD sToUt\"
should return \"Short And Stout\"
.');",
- "assert(titleCase(\"HERE IS MY HANDLE HERE IS MY SPOUT\") === \"Here Is My Handle Here Is My Spout\", 'message: \"HERE IS MY HANDLE HERE IS MY SPOUT\"
should return \"Here Is My Handle Here Is My Spout\"
');"
+ "assert(typeof(titleCase(\"I'm a little tea pot\")) === \"string\", 'message: titleCase()
should return a string.');",
+ "assert(titleCase(\"I'm a little tea pot\") === \"I'm A Little Tea Pot\", 'message: titleCase(\"I'm a little tea pot\")
should return \"I'm A Little Tea Pot\".');",
+ "assert(titleCase(\"sHoRt AnD sToUt\") === \"Short And Stout\", 'message: titleCase(\"sHoRt AnD sToUt\")
should return \"Short And Stout\".');",
+ "assert(titleCase(\"HERE IS MY HANDLE HERE IS MY SPOUT\") === \"Here Is My Handle Here Is My Spout\", 'message: titleCase(\"HERE IS MY HANDLE HERE IS MY SPOUT\")
should return \"Here Is My Handle Here Is My Spout\".');"
],
"MDNlinks": [
"String.charAt()"
@@ -273,9 +273,9 @@
"largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);"
],
"tests": [
- "assert(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]).constructor === Array, 'message: largestOfFour()
should return an array.');",
- "assert.deepEqual(largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]]), [27,5,39,1001], 'message: [[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]]
should return [27,5,39,1001]
.');",
- "assert.deepEqual(largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]), [9,35,97,1000000], 'message: [[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]
should return [9, 35, 97, 1000000]
.');"
+ "assert(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]).constructor === Array, 'message: largestOfFour()
should return an array.');",
+ "assert.deepEqual(largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]]), [27,5,39,1001], 'message: largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]])
should return [27,5,39,1001]
.');",
+ "assert.deepEqual(largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]), [9,35,97,1000000], 'message: largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]])
should return [9, 35, 97, 1000000]
.');"
],
"MDNlinks": [
"Comparison Operators"
@@ -311,11 +311,11 @@
"end(\"Bastian\", \"n\", \"\");"
],
"tests": [
- "assert(end(\"Bastian\", \"n\") === true, 'message: \"Bastian\", \"n\"
should return true.');",
- "assert(end(\"Connor\", \"n\") === false, 'message: \"Connor\", \"n\"
should return false.');",
- "assert(end(\"Walking on water and developing software from a specification are easy if both are frozen.\", \"specification\") === false, 'message: \"Walking on water and developing software from a specification are easy if both are frozen.\", \"specification\")
should return false.');",
- "assert(end(\"He has to give me a new name\", \"name\") === true, 'message: \"He has to give me a new name\", \"name\"
should return true.');",
- "assert(end(\"If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing\", \"mountain\") === false, 'message: \"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.');"
+ "assert(end(\"Bastian\", \"n\") === true, 'message: end(\"Bastian\", \"n\")
should return true.');",
+ "assert(end(\"Connor\", \"n\") === false, 'message: end(\"Connor\", \"n\")
should return false.');",
+ "assert(end(\"Walking on water and developing software from a specification are easy if both are frozen.\", \"specification\") === false, 'message: end(\"Walking on water and developing software from a specification are easy if both are frozen.\", \"specification\")
should return false.');",
+ "assert(end(\"He has to give me a new name\", \"name\") === true, 'message: end(\"He has to give me a new name\", \"name\")
should return true.');",
+ "assert(end(\"If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing\", \"mountain\") === false, 'message: end(\"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.');"
],
"MDNlinks": [
"String.substr()"
@@ -350,9 +350,9 @@
"repeat(\"abc\", 3, \"\");"
],
"tests": [
- "assert(repeat(\"*\", 3) === \"***\", 'message: \"*\", 3
should return \"***\"
.');",
- "assert(repeat(\"abc\", 3) === \"abcabcabc\", 'message: \"abc\", 3
should return \"abcabcabc\"
.');",
- "assert(repeat(\"abc\", -2) === \"\", 'message: \"abc\", -2
should return \"\"
.');"
+ "assert(repeat(\"*\", 3) === \"***\", 'message: repeat(\"*\", 3)
should return \"***\"
.');",
+ "assert(repeat(\"abc\", 3) === \"abcabcabc\", 'message: repeat(\"abc\", 3)
should return \"abcabcabc\"
.');",
+ "assert(repeat(\"abc\", -2) === \"\", 'message: repeat(\"abc\", -2)
should return \"\"
.');"
],
"MDNlinks": [
"Global String Object"
@@ -388,10 +388,10 @@
"truncate(\"A-tisket a-tasket A green and yellow basket\", 11, \"\");"
],
"tests": [
- "assert(truncate(\"A-tisket a-tasket A green and yellow basket\", 11) === \"A-tisket...\", 'message: \"A-tisket a-tasket A green and yellow basket\", 1
should return \"A-tisket...\"
.');",
- "assert(truncate(\"Peter Piper picked a peck of pickled peppers\", 14) === \"Peter Piper...\", 'message: \"Peter Piper picked a peck of pickled peppers\", 14
should return \"Peter Piper...\"
.');",
- "assert(truncate(\"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\", 'message: \"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\"
.');",
- "assert(truncate('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', 'message: \"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\"
.');"
+ "assert(truncate(\"A-tisket a-tasket A green and yellow basket\", 11) === \"A-tisket...\", 'message: truncate(\"A-tisket a-tasket A green and yellow basket\", 1)
should return \"A-tisket...\".');",
+ "assert(truncate(\"Peter Piper picked a peck of pickled peppers\", 14) === \"Peter Piper...\", 'message: truncate(\"Peter Piper picked a peck of pickled peppers\", 14)
should return \"Peter Piper...\".');",
+ "assert(truncate(\"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\", 'message: truncate(\"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\".');",
+ "assert(truncate('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', 'message: truncate(\"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\".');"
],
"MDNlinks": [
"String.slice()"
@@ -426,10 +426,10 @@
"chunk([\"a\", \"b\", \"c\", \"d\"], 2, \"\");"
],
"tests": [
- "assert.deepEqual(chunk([\"a\", \"b\", \"c\", \"d\"], 2), [[\"a\", \"b\"], [\"c\", \"d\"]], 'message: [\"a\", \"b\", \"c\", \"d\"], 2
should return [[\"a\", \"b\"], [\"c\", \"d\"]]
.');",
- "assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 3), [[0, 1, 2], [3, 4, 5]], 'message: [0, 1, 2, 3, 4, 5]
should return [[0, 1, 2], [3, 4, 5]]
.');",
- "assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 2), [[0, 1], [2, 3], [4, 5]], 'message: [0, 1, 2, 3, 4, 5], 2
should return [[0, 1], [2, 3], [4, 5]]
.');",
- "assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 4), [[0, 1, 2, 3], [4, 5]], 'message: [0, 1, 2, 3, 4, 5], 4
should return [[0, 1, 2, 3], [4, 5]]
.');"
+ "assert.deepEqual(chunk([\"a\", \"b\", \"c\", \"d\"], 2), [[\"a\", \"b\"], [\"c\", \"d\"]], 'message: chunk([\"a\", \"b\", \"c\", \"d\"], 2)
should return [[\"a\", \"b\"], [\"c\", \"d\"]]
.');",
+ "assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 3), [[0, 1, 2], [3, 4, 5]], 'message: chunk([0, 1, 2, 3, 4, 5], 3)
should return [[0, 1, 2], [3, 4, 5]]
.');",
+ "assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 2), [[0, 1], [2, 3], [4, 5]], 'message: chunk([0, 1, 2, 3, 4, 5], 2)
should return [[0, 1], [2, 3], [4, 5]]
.');",
+ "assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 4), [[0, 1, 2, 3], [4, 5]], 'message: chunk([0, 1, 2, 3, 4, 5], 4)
should return [[0, 1, 2, 3], [4, 5]]
.');"
],
"MDNlinks": [
"Array.push()"
@@ -464,9 +464,9 @@
"slasher([1, 2, 3], 2, \"\");"
],
"tests": [
- "assert.deepEqual(slasher([1, 2, 3], 2), [3], 'message: [1, 2, 3], 2, [3]
should return [3]
.');",
- "assert.deepEqual(slasher([1, 2, 3], 0), [1, 2, 3], 'message: [1, 2, 3], 0
should return [1, 2, 3]
.');",
- "assert.deepEqual(slasher([1, 2, 3], 9), [], 'message: [1, 2, 3], 9
should return []
.');"
+ "assert.deepEqual(slasher([1, 2, 3], 2), [3], 'message: slasher([1, 2, 3], 2, [3])
should return [3]
.');",
+ "assert.deepEqual(slasher([1, 2, 3], 0), [1, 2, 3], 'message: slasher([1, 2, 3], 0)
should return [1, 2, 3]
.');",
+ "assert.deepEqual(slasher([1, 2, 3], 9), [], 'message: slasher([1, 2, 3], 9)
should return []
.');"
],
"MDNlinks": [
"Array.slice()",
@@ -504,14 +504,14 @@
"mutation([\"hello\", \"hey\"], \"\");"
],
"tests": [
- "assert(mutation([\"hello\", \"hey\"]) === false, 'message: [\"hello\", \"hey\"]
should return false.');",
- "assert(mutation([\"hello\", \"Hello\"]) === true, 'message: [\"hello\", \"Hello\"]
should return true.');",
- "assert(mutation([\"zyxwvutsrqponmlkjihgfedcba\", \"qrstu\"]) === true, 'message: [\"zyxwvutsrqponmlkjihgfedcba\", \"qrstu\"]
should return true.');",
- "assert(mutation([\"Mary\", \"Army\"]) === true, 'message: [\"Mary\", \"Army\"]
should return true.');",
- "assert(mutation([\"Mary\", \"Aarmy\"]) === true, 'message: [\"Mary\", \"Aarmy\"]
should return true.');",
- "assert(mutation([\"Alien\", \"line\"]) === true, 'message: [\"Alien\", \"line\"]
should return true.');",
- "assert(mutation([\"floor\", \"for\"]) === true, 'message: [\"floor\", \"for\"]
should return true.');",
- "assert(mutation([\"hello\", \"neo\"]) === false, 'message: [\"hello\", \"neo\"]
should return false.');"
+ "assert(mutation([\"hello\", \"hey\"]) === false, 'message: mutation([\"hello\", \"hey\"])
should return false.');",
+ "assert(mutation([\"hello\", \"Hello\"]) === true, 'message: mutation([\"hello\", \"Hello\"])
should return true.');",
+ "assert(mutation([\"zyxwvutsrqponmlkjihgfedcba\", \"qrstu\"]) === true, 'message: mutation([\"zyxwvutsrqponmlkjihgfedcba\", \"qrstu\"])
should return true.');",
+ "assert(mutation([\"Mary\", \"Army\"]) === true, 'message: mutation([\"Mary\", \"Army\"])
should return true.');",
+ "assert(mutation([\"Mary\", \"Aarmy\"]) === true, 'message: mutation([\"Mary\", \"Aarmy\"])
should return true.');",
+ "assert(mutation([\"Alien\", \"line\"]) === true, 'message: mutation([\"Alien\", \"line\"])
should return true.');",
+ "assert(mutation([\"floor\", \"for\"]) === true, 'message: mutation([\"floor\", \"for\"])
should return true.');",
+ "assert(mutation([\"hello\", \"neo\"]) === false, 'message: mutation([\"hello\", \"neo\"])
should return false.');"
],
"MDNlinks": [
"Array.indexOf()"
@@ -547,9 +547,9 @@
"bouncer([7, \"ate\", \"\", false, 9], \"\");"
],
"tests": [
- "assert.deepEqual(bouncer([7, \"ate\", \"\", false, 9]), [7, \"ate\", 9], 'message: [7, \"ate\", \"\", false, 9]
should return [7, \"ate\", 9]
.');",
- "assert.deepEqual(bouncer([\"a\", \"b\", \"c\"]), [\"a\", \"b\", \"c\"], 'message: [\"a\", \"b\", \"c\"]
should return [\"a\", \"b\", \"c\"]
.');",
- "assert.deepEqual(bouncer([false, null, 0, NaN, undefined, '']), [], 'message: [false, null, 0]
should return []
.');"
+ "assert.deepEqual(bouncer([7, \"ate\", \"\", false, 9]), [7, \"ate\", 9], 'message: bouncer([7, \"ate\", \"\", false, 9])
should return [7, \"ate\", 9]
.');",
+ "assert.deepEqual(bouncer([\"a\", \"b\", \"c\"]), [\"a\", \"b\", \"c\"], 'message: bouncer([\"a\", \"b\", \"c\"])
should return [\"a\", \"b\", \"c\"]
.');",
+ "assert.deepEqual(bouncer([false, null, 0, NaN, undefined, '']), [], 'message: bouncer([false, null, 0])
should return []
.');"
],
"MDNlinks": [
"Boolean Objects",
@@ -585,11 +585,11 @@
"destroyer([1, 2, 3, 1, 2, 3], 2, 3, \"\");"
],
"tests": [
- "assert.deepEqual(destroyer([1, 2, 3, 1, 2, 3], 2, 3), [1, 1], 'message: [1, 2, 3, 1, 2, 3], 2, 3
should return [1, 1]
.');",
- "assert.deepEqual(destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3), [1, 5, 1], 'message: [1, 2, 3, 5, 1, 2, 3], 2, 3
should return [1, 5, 1]
.');",
- "assert.deepEqual(destroyer([3, 5, 1, 2, 2], 2, 3, 5), [1], 'message: [3, 5, 1, 2, 2], 2, 3, 5
should return [1]
.');",
- "assert.deepEqual(destroyer([2, 3, 2, 3], 2, 3), [], 'message: [2, 3, 2, 3], 2, 3
should return []
.');",
- "assert.deepEqual(destroyer([\"tree\", \"hamburger\", 53], \"tree\", 53), [\"hamburger\"], 'message: [\"tree\", \"hamburger\", 53], \"tree\", 53)
should return [\"hamburger\"]
.');"
+ "assert.deepEqual(destroyer([1, 2, 3, 1, 2, 3], 2, 3), [1, 1], 'message: destroyer([1, 2, 3, 1, 2, 3], 2, 3)
should return [1, 1]
.');",
+ "assert.deepEqual(destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3), [1, 5, 1], 'message: destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3)
should return [1, 5, 1]
.');",
+ "assert.deepEqual(destroyer([3, 5, 1, 2, 2], 2, 3, 5), [1], 'message: destroyer([3, 5, 1, 2, 2], 2, 3, 5)
should return [1]
.');",
+ "assert.deepEqual(destroyer([2, 3, 2, 3], 2, 3), [], 'message: destroyer([2, 3, 2, 3], 2, 3)
should return []
.');",
+ "assert.deepEqual(destroyer([\"tree\", \"hamburger\", 53], \"tree\", 53), [\"hamburger\"], 'message: destroyer([\"tree\", \"hamburger\", 53], \"tree\", 53)
should return [\"hamburger\"]
.');"
],
"MDNlinks": [
"Arguments object",
@@ -629,12 +629,12 @@
"Array.sort()"
],
"tests": [
- "assert(where([10, 20, 30, 40, 50], 35) === 3, 'message: [10, 20, 30, 40, 50], 35
should return 3
.');",
- "assert(where([10, 20, 30, 40, 50], 30) === 2, 'message: [10, 20, 30, 40, 50], 30)
should return 2
.');",
- "assert(where([40, 60], 50) === 1, 'message: [40, 60,], 50
should return 1
.');",
- "assert(where([5, 3, 20, 3], 3) === 0, 'message: [5, 3, 20, 3], 3
should return 0
.');",
- "assert(where([2, 20, 10], 1) === 0, 'message: [2, 20, 10], 1
should return 0
.');",
- "assert(where([2, 5, 10], 15) === 3, 'message: [2, 5, 10], 15
should return 3
.');"
+ "assert(where([10, 20, 30, 40, 50], 35) === 3, 'message: where([10, 20, 30, 40, 50], 35)
should return 3
.');",
+ "assert(where([10, 20, 30, 40, 50], 30) === 2, 'message: where([10, 20, 30, 40, 50], 30)
should return 2
.');",
+ "assert(where([40, 60], 50) === 1, 'message: where([40, 60,], 50)
should return 1
.');",
+ "assert(where([5, 3, 20, 3], 3) === 0, 'message: where([5, 3, 20, 3], 3)
should return 0
.');",
+ "assert(where([2, 20, 10], 1) === 0, 'message: where([2, 20, 10], 1)
should return 0
.');",
+ "assert(where([2, 5, 10], 15) === 3, 'message: where([2, 5, 10], 15)
should return 3
.');"
],
"type": "bonfire",
"challengeType": 5,