add messages to basic and advanced bonfires

This commit is contained in:
Quincy Larson
2015-09-28 19:55:58 -07:00
parent 40ec3852cc
commit 144ae3bef2
2 changed files with 125 additions and 125 deletions

View File

@ -19,28 +19,28 @@
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> if you get stuck. Try to pair program. Write your own code."
],
"tests": [
"assert.isBoolean(telephoneCheck(\"555-555-5555\") === 'should return a boolean.');",
"assert(telephoneCheck(\"1 555-555-5555\") === true, '<code>1 555-555-5555</code> should return true.');",
"assert(telephoneCheck(\"1 (555) 555-5555\") === true, '<code>1 &#40;555&#41; 555-5555</code> should return true.');",
"assert(telephoneCheck(\"5555555555\") === true, '<code>5555555555</code> should return true.');",
"assert(telephoneCheck(\"555-555-5555\") === true, '<code>555-555-5555</code> should return true.');",
"assert(telephoneCheck(\"(555)555-5555\") === true, '<code>&#40;555&#41;555-5555</code> should return true.');",
"assert(telephoneCheck(\"1(555)555-5555\") === true, '<code>1&#40;555&#41;555-5555</code> should return true.');",
"assert(telephoneCheck(\"1 555 555 5555\") === true, '<code>1 555 555 5555</code> should return true.');",
"assert(telephoneCheck(\"555-555-5555\") === true, '<code>555-555-5555</code> should return true.');",
"assert(telephoneCheck(\"1 456 789 4444\") === true, '<code>1 456 789 4444</code> should return true.');",
"assert(telephoneCheck(\"123**&!!asdf#\") === false, '<code>123**&!!asdf#</code> should return false.');",
"assert(telephoneCheck(\"55555555\") === false, '<code>55555555</code> should return false.');",
"assert(telephoneCheck(\"(6505552368)\") === false, '<code>&#40;6505552368&#41;</code> should return false');",
"assert(telephoneCheck(\"2 (757) 622-7382\") === false, '<code>2 &#40;757&#41; 622-7382</code> should return false.');",
"assert(telephoneCheck(\"0 (757) 622-7382\") === false, '<code>0 &#40;757&#41; 622-7382</code> should return false.');",
"assert(telephoneCheck(\"-1 (757) 622-7382\") === false, '<code>-1 &#40;757&#41; 622-7382</code> should return false');",
"assert(telephoneCheck(\"2 757 622-7382\") === false, '<code>2 757 622-7382</code> should return false.');",
"assert(telephoneCheck(\"10 (757) 622-7382\") === false, '<code>10 &#40;757&#41; 622-7382</code> should return false.');",
"assert(telephoneCheck(\"27576227382\") === false, '<code>27576227382</code> should return false.');",
"assert(telephoneCheck(\"(275)76227382\") === false, '<code>&#40;275&#41;76227382</code> should return false.');",
"assert(telephoneCheck(\"2(757)6227382\") === false, '<code>2&#40;757&#41;6227382</code> should return false.');",
"assert(telephoneCheck(\"2(757)622-7382\") === false, '<code>2&#40;757&#41;622-7382</code> should return false.');"
"assert.isBoolean(telephoneCheck(\"555-555-5555\"), 'message: should return a boolean.');",
"assert(telephoneCheck(\"1 555-555-5555\") === true, 'message: <code>1 555-555-5555</code> should return true.');",
"assert(telephoneCheck(\"1 (555) 555-5555\") === true, 'message: <code>1 &#40;555&#41; 555-5555</code> should return true.');",
"assert(telephoneCheck(\"5555555555\") === true, 'message: <code>5555555555</code> should return true.');",
"assert(telephoneCheck(\"555-555-5555\") === true, 'message: <code>555-555-5555</code> should return true.');",
"assert(telephoneCheck(\"(555)555-5555\") === true, 'message: <code>&#40;555&#41;555-5555</code> should return true.');",
"assert(telephoneCheck(\"1(555)555-5555\") === true, 'message: <code>1&#40;555&#41;555-5555</code> should return true.');",
"assert(telephoneCheck(\"1 555 555 5555\") === true, 'message: <code>1 555 555 5555</code> should return true.');",
"assert(telephoneCheck(\"555-555-5555\") === true, 'message: <code>555-555-5555</code> should return true.');",
"assert(telephoneCheck(\"1 456 789 4444\") === true, 'message: <code>1 456 789 4444</code> should return true.');",
"assert(telephoneCheck(\"123**&!!asdf#\") === false, 'message: <code>123**&!!asdf#</code> should return false.');",
"assert(telephoneCheck(\"55555555\") === false, 'message: <code>55555555</code> should return false.');",
"assert(telephoneCheck(\"(6505552368)\") === false, 'message: <code>&#40;6505552368&#41;</code> should return false');",
"assert(telephoneCheck(\"2 (757) 622-7382\") === false, 'message: <code>2 &#40;757&#41; 622-7382</code> should return false.');",
"assert(telephoneCheck(\"0 (757) 622-7382\") === false, 'message: <code>0 &#40;757&#41; 622-7382</code> should return false.');",
"assert(telephoneCheck(\"-1 (757) 622-7382\") === false, 'message: <code>-1 &#40;757&#41; 622-7382</code> should return false');",
"assert(telephoneCheck(\"2 757 622-7382\") === false, 'message: <code>2 757 622-7382</code> should return false.');",
"assert(telephoneCheck(\"10 (757) 622-7382\") === false, 'message: <code>10 &#40;757&#41; 622-7382</code> should return false.');",
"assert(telephoneCheck(\"27576227382\") === false, 'message: <code>27576227382</code> should return false.');",
"assert(telephoneCheck(\"(275)76227382\") === false, 'message: <code>&#40;275&#41;76227382</code> should return false.');",
"assert(telephoneCheck(\"2(757)6227382\") === false, 'message: <code>2&#40;757&#41;6227382</code> should return false.');",
"assert(telephoneCheck(\"2(757)622-7382\") === false, 'message: <code>2&#40;757&#41;622-7382</code> 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], '<code>[1, 2, 3], [5, 2, 1, 4]</code> should return <code>[3, 5, 4]</code>.');",
"assert.sameMembers(sym([1, 2, 5], [2, 3, 5], [3, 4, 5]), [1, 4, 5], '<code>[1, 2, 5], [2, 3, 5], [3, 4, 5]</code> should return <code>[1, 4, 5]</code>');",
"assert.sameMembers(sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]), [1, 4, 5], '<code>[1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]</code> should return <code>[1, 4, 5]</code>.');",
"assert.sameMembers(sym([1, 1]), [1], '<code>[1, 1]</code> should return <code>[1]</code>.');"
"assert.sameMembers(sym([1, 2, 3], [5, 2, 1, 4]), [3, 5, 4], 'message: <code>[1, 2, 3], [5, 2, 1, 4]</code> should return <code>[3, 5, 4]</code>.');",
"assert.sameMembers(sym([1, 2, 5], [2, 3, 5], [3, 4, 5]), [1, 4, 5], 'message: <code>[1, 2, 5], [2, 3, 5], [3, 4, 5]</code> should return <code>[1, 4, 5]</code>');",
"assert.sameMembers(sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]), [1, 4, 5], 'message: <code>[1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]</code> should return <code>[1, 4, 5]</code>.');",
"assert.sameMembers(sym([1, 1]), [1], 'message: <code>[1, 1]</code> should return <code>[1]</code>.');"
],
"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]]), '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]]), '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]]), '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]], 'return correct change');",
"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] ], 'return correct change with multiple coins and bills');",
"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', '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\", 'cash-in-drawer equals change');"
"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: <code>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]]</code> 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: <code>19.50, 20.00, [['PENNY', 0.01], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]</code> 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: <code>19.50, 20.00, [['PENNY', 0.50], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]</code> 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: <code>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]])</code> should return <code>[['QUARTER', 0.50]]</code>.');",
"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: <code>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]]</code> should return <code>[['TWENTY', 60.00], ['TEN', 20.00], ['FIVE', 15], ['ONE', 1], ['QUARTER', 0.50], ['DIME', 0.20], ['PENNY', 0.04]]</code>.');",
"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: <code>19.50, 20.00, [['PENNY', 0.01], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]</code> 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: <code>19.50, 20.00, [['PENNY', 0.50], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]</code> should return \"Closed\".');"
],
"MDNlinks": [
"Global Object"
@ -195,12 +195,12 @@
"inventory(curInv, newInv);"
],
"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']]), '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, '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']]);",
"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']]);",
"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']]);",
"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']]);"
"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: <code>inventory()</code> 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: <code>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</code> 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: <code>[[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]</code> should return <code>[[88, 'Bowling Ball'], [2, 'Dirty Sock'], [3, 'Hair Pin'], [3, 'Half-Eaten Apple'], [5, 'Microphone'], [7, 'Toothpaste']]</code>.');",
"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: <code>[[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], []</code> should return <code>[[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']]</code>.);",
"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: <code>[], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]</code> should return <code>[[67, 'Bowling Ball'], [2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [7, 'Toothpaste']]</code>.');",
"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: <code>[[0, 'Bowling Ball'], [0, 'Dirty Sock'], [0, 'Hair Pin'], [0, 'Microphone']], [[1, 'Hair Pin'], [1, 'Half-Eaten Apple'], [1, 'Bowling Ball'], [1, 'Toothpaste']]</code> should return <code>[[1, 'Bowling Ball'], [0, 'Dirty Sock'], [1, 'Hair Pin'], [1, 'Half-Eaten Apple'], [0, 'Microphone'], [1, 'Toothpaste']]</code>.');"
],
"MDNlinks": [
"Global Array Object"
@ -235,13 +235,13 @@
"permAlone('aab');"
],
"tests": [
"assert.isNumber(permAlone('aab'), '<code>aab</code> should return a number.');",
"assert.strictEqual(permAlone('aab'), 2, '<code>aab</code> should return <code>2</code>.');",
"assert.strictEqual(permAlone('aaa'), 0, '<code>aaa</code> should return <code>0</code>.');",
"assert.strictEqual(permAlone('aabb'), 8, '<code>aabb</code> should return <code>8</code>.');",
"assert.strictEqual(permAlone('abcdefa'), 3600, '<code>abcdefa</code> should return <code>3600</code>.');",
"assert.strictEqual(permAlone('abfdefa'), 2640, '<code>abfdefa</code> should return <code>2640</code>.');",
"assert.strictEqual(permAlone('zzzzzzzz'), 0, '<code>zzzzzzzz</code> should return <code>0</code>.');"
"assert.isNumber(permAlone('aab'), 'message: <code>aab</code> should return a number.');",
"assert.strictEqual(permAlone('aab'), 2, 'message: <code>aab</code> should return <code>2</code>.');",
"assert.strictEqual(permAlone('aaa'), 0, 'message: <code>aaa</code> should return <code>0</code>.');",
"assert.strictEqual(permAlone('aabb'), 8, 'message: <code>aabb</code> should return <code>8</code>.');",
"assert.strictEqual(permAlone('abcdefa'), 3600, 'message: <code>abcdefa</code> should return <code>3600</code>.');",
"assert.strictEqual(permAlone('abfdefa'), 2640, 'message: <code>abfdefa</code> should return <code>2640</code>.');",
"assert.strictEqual(permAlone('zzzzzzzz'), 0, 'message: <code>zzzzzzzz</code> should return <code>0</code>.');"
],
"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'], '<code>[\"2015-07-01\", \"2015-07-04\"]</code> should return <code>[\"July 1st\",\"4th\"]</code>.');",
"assert.deepEqual(friendly(['2015-12-01', '2016-02-03']), ['December 1st','February 3rd'], '<code>[\"2015-12-01\", \"2016-02-03\"]</code> should return <code>[\"December 1st\",\"February 3rd\"]</code>.');",
"assert.deepEqual(friendly(['2015-12-01', '2017-02-03']), ['December 1st, 2015','February 3rd, 2017'], '<code>[\"2015-12-01\", \"2017-02-03\"]</code> should return <code>[\"December 1st, 2015\",\"February 3rd, 2017\"]</code>.');",
"assert.deepEqual(friendly(['2016-03-01', '2016-05-05']), ['March 1st','May 5th'], '<code>[\"2016-03-01\", \"2016-05-05\"]</code> should return <code>[\"March 1st\",\"May 5th\"]</code>');",
"assert.deepEqual(friendly(['2017-01-01', '2017-01-01']), ['January 1st, 2017'], '<code>[\"2017-01-01\", \"2017-01-01\"]</code> should return <code>[\"January 1st, 2017\"]</code>.');",
"assert.deepEqual(friendly(['2022-09-05', '2023-09-04']), ['September 5th, 2022','September 4th, 2023'], '<code>[\"2022-09-05\", \"2023-09-04\"]</code> should return <code>[\"September 5th, 2022\",\"September 4th, 2023\"]</code>.');"
"assert.deepEqual(friendly(['2015-07-01', '2015-07-04']), ['July 1st','4th'], 'message: <code>[\"2015-07-01\", \"2015-07-04\"]</code> should return <code>[\"July 1st\",\"4th\"]</code>.');",
"assert.deepEqual(friendly(['2015-12-01', '2016-02-03']), ['December 1st','February 3rd'], 'message: <code>[\"2015-12-01\", \"2016-02-03\"]</code> should return <code>[\"December 1st\",\"February 3rd\"]</code>.');",
"assert.deepEqual(friendly(['2015-12-01', '2017-02-03']), ['December 1st, 2015','February 3rd, 2017'], 'message: <code>[\"2015-12-01\", \"2017-02-03\"]</code> should return <code>[\"December 1st, 2015\",\"February 3rd, 2017\"]</code>.');",
"assert.deepEqual(friendly(['2016-03-01', '2016-05-05']), ['March 1st','May 5th'], 'message: <code>[\"2016-03-01\", \"2016-05-05\"]</code> should return <code>[\"March 1st\",\"May 5th\"]</code>');",
"assert.deepEqual(friendly(['2017-01-01', '2017-01-01']), ['January 1st, 2017'], 'message: <code>[\"2017-01-01\", \"2017-01-01\"]</code> should return <code>[\"January 1st, 2017\"]</code>.');",
"assert.deepEqual(friendly(['2022-09-05', '2023-09-04']), ['September 5th, 2022','September 4th, 2023'], 'message: <code>[\"2022-09-05\", \"2023-09-04\"]</code> should return <code>[\"September 5th, 2022\",\"September 4th, 2023\"]</code>.');"
],
"MDNlinks": [
"String.split()",

View File

@ -13,8 +13,8 @@
"Make this function return true no matter what."
],
"tests": [
"assert(typeof(meetBonfire()) === \"boolean\", 'The result should be a Boolean value of true or false.');",
"assert(meetBonfire() === true, 'Your <code>meetBonfire()</code> function should return <code>true</code>.');"
"assert(typeof(meetBonfire()) === \"boolean\", 'message: The result should be a Boolean value of true or false.');",
"assert(meetBonfire() === true, 'message: Your <code>meetBonfire()</code> function should return <code>true</code>.');"
],
"challengeSeed": [
"function meetBonfire(argument) {",
@ -46,10 +46,10 @@
"title": "Reverse a String",
"difficulty": "1.01",
"tests": [
"assert(typeof(reverseString(\"hello\")) === \"string\", '<code>reverseString&#40;&#41;</code> should return a string.');",
"assert(reverseString(\"hello\") === \"olleh\", '<code>\"hello\"</code> should become <code>\"olleh\"</code>.');",
"assert(reverseString(\"Howdy\") === \"ydwoH\", '<code>\"Howdy\"</code> should become <code>\"ydwoH\"</code>.');",
"assert(reverseString(\"Greetings from Earth\") === \"htraE morf sgniteerG\", '<code>\"Greetings from Earth\"</code> should return <code>\"htraE morf sgniteerG\"</code>.');"
"assert(typeof(reverseString(\"hello\")) === \"string\", 'message: <code>reverseString&#40;&#41;</code> should return a string.');",
"assert(reverseString(\"hello\") === \"olleh\", 'message: <code>\"hello\"</code> should become <code>\"olleh\"</code>.');",
"assert(reverseString(\"Howdy\") === \"ydwoH\", 'message: <code>\"Howdy\"</code> should become <code>\"ydwoH\"</code>.');",
"assert(reverseString(\"Greetings from Earth\") === \"htraE morf sgniteerG\", 'message: <code>\"Greetings from Earth\"</code> should return <code>\"htraE morf sgniteerG\"</code>.');"
],
"description": [
"Reverse the provided string.",
@ -87,11 +87,11 @@
"id": "a302f7aae1aa3152a5b413bc",
"title": "Factorialize a Number",
"tests": [
"assert(typeof(factorialize(5)) === \"number\", '<code>factorialize&#40;&#41;</code> should return a number.');",
"assert(factorialize(5) === 120, '<code>5</code> should return <code>120</code>.');",
"assert(factorialize(10) === 3628800, '<code>10</code> should return <code>3,628,800</code>.');",
"assert(factorialize(20) === 2432902008176640000, '<code>20</code> should return <code>2,432,902,008,176,640,000</code>.');",
"assert(factorialize(0) === 1, '<code>0</code> should return 1.');"
"assert(typeof(factorialize(5)) === \"number\", 'message: <code>factorialize&#40;&#41;</code> should return a number.');",
"assert(factorialize(5) === 120, 'message: <code>5</code> should return <code>120</code>.');",
"assert(factorialize(10) === 3628800, 'message: <code>10</code> should return <code>3,628,800</code>.');",
"assert(factorialize(20) === 2432902008176640000, 'message: <code>20</code> should return <code>2,432,902,008,176,640,000</code>.');",
"assert(factorialize(0) === 1, 'message: <code>0</code> should return 1.');"
],
"difficulty": "1.02",
"description": [
@ -136,17 +136,17 @@
"Remember to use <a href=\"//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck\" target=\"_blank\">Read-Search-Ask</a> if you get stuck. Write your own code."
],
"tests": [
"assert(typeof(palindrome(\"eye\")) === \"boolean\", '<code>palindrome&#40;&#41;<code> should return a boolean.');",
"assert(palindrome(\"eye\") === true, '<code>\"eye\"</code> should return true.');",
"assert(palindrome(\"race car\") === true, '<code>\"race car\"</code> should return true.');",
"assert(palindrome(\"not a palindrome\") === false, '<code>\"not a palindrome\"</code> should return false.');",
"assert(palindrome(\"A man, a plan, a canal. Panama\") === true, '<code>\"A man, a plan, a canal. Panama\"</code> should return true.');",
"assert(palindrome(\"never odd or even\") === true, '<code>\"never odd or even\"</code> should return true.');",
"assert(palindrome(\"nope\") === false, '<code>\"nope\"</code> should return false.');",
"assert(palindrome(\"almostomla\") === false, '<code>\"almostomla\"</code> should return false.');",
"assert(palindrome(\"My age is 0, 0 si ega ym.\") === true, '<code>\"My age is 0, 0 si ega ym.\"</code> should return true.');",
"assert(palindrome(\"1 eye for of 1 eye.\") === false, '<code>\"1 eye for of 1 eye.\"</code> should return false.');",
"assert(palindrome(\"0_0 (: /-\\ :) 0-0\") === true, '<code>\"0_0 (: /-\\\\ :) 0-0\"</code> should return true.');"
"assert(typeof(palindrome(\"eye\")) === \"boolean\", 'message: <code>palindrome&#40;&#41;<code> should return a boolean.');",
"assert(palindrome(\"eye\") === true, 'message: <code>\"eye\"</code> should return true.');",
"assert(palindrome(\"race car\") === true, 'message: <code>\"race car\"</code> should return true.');",
"assert(palindrome(\"not a palindrome\") === false, 'message: <code>\"not a palindrome\"</code> should return false.');",
"assert(palindrome(\"A man, a plan, a canal. Panama\") === true, 'message: <code>\"A man, a plan, a canal. Panama\"</code> should return true.');",
"assert(palindrome(\"never odd or even\") === true, 'message: <code>\"never odd or even\"</code> should return true.');",
"assert(palindrome(\"nope\") === false, 'message: <code>\"nope\"</code> should return false.');",
"assert(palindrome(\"almostomla\") === false, 'message: <code>\"almostomla\"</code> should return false.');",
"assert(palindrome(\"My age is 0, 0 si ega ym.\") === true, 'message: <code>\"My age is 0, 0 si ega ym.\"</code> should return true.');",
"assert(palindrome(\"1 eye for of 1 eye.\") === false, 'message: <code>\"1 eye for of 1 eye.\"</code> should return false.');",
"assert(palindrome(\"0_0 (: /-\\ :) 0-0\") === true, 'message: <code>\"0_0 (: /-\\\\ :) 0-0\"</code> 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\", '<code>findLongestWord&#40;&#41;</code> should return a number.');",
"assert(findLongestWord(\"The quick brown fox jumped over the lazy dog\") === 6, '<code>\"The quick brown fox jumped over the lazy dog\"</code> should return <code>6</code>.');",
"assert(findLongestWord(\"May the force be with you\") === 5, '<code>\"May the force be with you\"</code> should return <code>5</code>.');",
"assert(findLongestWord(\"Google do a barrel roll\") === 6, '<code>\"Google do a barrel roll\"</code> should return <code>6</code>.');",
"assert(findLongestWord(\"What is the average airspeed velocity of an unladen swallow\") === 8, '<code>\"What is the average airspeed velocity of an unladen swallow\"</code> should return <code>8</code>.');",
"assert(findLongestWord(\"What if we try a super-long word such as otorhinolaryngology\") === 19, '<code>\"What if we try a super-long word such as otorhinolaryngology\"</code> should return <code>19</code>.');"
"assert(typeof(findLongestWord(\"The quick brown fox jumped over the lazy dog\")) === \"number\", 'message: <code>findLongestWord&#40;&#41;</code> should return a number.');",
"assert(findLongestWord(\"The quick brown fox jumped over the lazy dog\") === 6, 'message: <code>\"The quick brown fox jumped over the lazy dog\"</code> should return <code>6</code>.');",
"assert(findLongestWord(\"May the force be with you\") === 5, 'message: <code>\"May the force be with you\"</code> should return <code>5</code>.');",
"assert(findLongestWord(\"Google do a barrel roll\") === 6, 'message: <code>\"Google do a barrel roll\"</code> should return <code>6</code>.');",
"assert(findLongestWord(\"What is the average airspeed velocity of an unladen swallow\") === 8, 'message: <code>\"What is the average airspeed velocity of an unladen swallow\"</code> should return <code>8</code>.');",
"assert(findLongestWord(\"What if we try a super-long word such as otorhinolaryngology\") === 19, 'message: <code>\"What if we try a super-long word such as otorhinolaryngology\"</code> should return <code>19</code>.');"
],
"MDNlinks": [
"String.split()",
@ -233,10 +233,10 @@
"titleCase(\"I'm a little tea pot\", \"\");"
],
"tests": [
"assert(typeof(titleCase(\"I&#39;m a little tea pot\")) === \"string\", '<code>titleCase&#40;&#41;</code> should return a string.');",
"assert(titleCase(\"I&#39;m a little tea pot\") === \"I&#39;m A Little Tea Pot\", '<code>\"I&#39;m a little tea pot\"</code> should return <code>\"I&#39;m A Little Tea Pot\"</code>.');",
"assert(titleCase(\"sHoRt AnD sToUt\") === \"Short And Stout\", '<code>\"sHoRt AnD sToUt\"</code> should return <code>\"Short And Stout\"</code>.');",
"assert(titleCase(\"HERE IS MY HANDLE HERE IS MY SPOUT\") === \"Here Is My Handle Here Is My Spout\", '<code>\"HERE IS MY HANDLE HERE IS MY SPOUT\"</code> should return <code>\"Here Is My Handle Here Is My Spout\"</code>');"
"assert(typeof(titleCase(\"I&#39;m a little tea pot\")) === \"string\", 'message: <code>titleCase&#40;&#41;</code> should return a string.');",
"assert(titleCase(\"I&#39;m a little tea pot\") === \"I&#39;m A Little Tea Pot\", 'message: <code>\"I&#39;m a little tea pot\"</code> should return <code>\"I&#39;m A Little Tea Pot\"</code>.');",
"assert(titleCase(\"sHoRt AnD sToUt\") === \"Short And Stout\", 'message: <code>\"sHoRt AnD sToUt\"</code> should return <code>\"Short And Stout\"</code>.');",
"assert(titleCase(\"HERE IS MY HANDLE HERE IS MY SPOUT\") === \"Here Is My Handle Here Is My Spout\", 'message: <code>\"HERE IS MY HANDLE HERE IS MY SPOUT\"</code> should return <code>\"Here Is My Handle Here Is My Spout\"</code>');"
],
"MDNlinks": [
"String.charAt()"
@ -311,11 +311,11 @@
"end(\"Bastian\", \"n\", \"\");"
],
"tests": [
"assert(end(\"Bastian\", \"n\") === true, '<code>\"Bastian\", \"n\"</code> should return true.');",
"assert(end(\"Connor\", \"n\") === false, '<code>\"Connor\", \"n\"</code> should return false.');",
"assert(end(\"Walking on water and developing software from a specification are easy if both are frozen.\", \"specification\") === false, '<code>\"Walking on water and developing software from a specification are easy if both are frozen.\", \"specification\"&#41;</code> should return false.');",
"assert(end(\"He has to give me a new name\", \"name\") === true, '<code>\"He has to give me a new name\", \"name\"</code> 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, '<code>\"If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing\", \"mountain\"</code> should return false.');"
"assert(end(\"Bastian\", \"n\") === true, 'message: <code>\"Bastian\", \"n\"</code> should return true.');",
"assert(end(\"Connor\", \"n\") === false, 'message: <code>\"Connor\", \"n\"</code> should return false.');",
"assert(end(\"Walking on water and developing software from a specification are easy if both are frozen.\", \"specification\") === false, 'message: <code>\"Walking on water and developing software from a specification are easy if both are frozen.\", \"specification\"&#41;</code> should return false.');",
"assert(end(\"He has to give me a new name\", \"name\") === true, 'message: <code>\"He has to give me a new name\", \"name\"</code> 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: <code>\"If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing\", \"mountain\"</code> should return false.');"
],
"MDNlinks": [
"String.substr()"
@ -350,9 +350,9 @@
"repeat(\"abc\", 3, \"\");"
],
"tests": [
"assert(repeat(\"*\", 3) === \"***\", '<code>\"*\", 3</code> should return <code>\"***\"</code>.');",
"assert(repeat(\"abc\", 3) === \"abcabcabc\", '<code>\"abc\", 3</code> should return <code>\"abcabcabc\"</code>.');",
"assert(repeat(\"abc\", -2) === \"\", '<code>\"abc\", -2</code> should return <code>\"\"</code>.');"
"assert(repeat(\"*\", 3) === \"***\", 'message: <code>\"*\", 3</code> should return <code>\"***\"</code>.');",
"assert(repeat(\"abc\", 3) === \"abcabcabc\", 'message: <code>\"abc\", 3</code> should return <code>\"abcabcabc\"</code>.');",
"assert(repeat(\"abc\", -2) === \"\", 'message: <code>\"abc\", -2</code> should return <code>\"\"</code>.');"
],
"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...\", '<code>\"A-tisket a-tasket A green and yellow basket\", 1</code> should return <code>\"A-tisket...\"</code>.');",
"assert(truncate(\"Peter Piper picked a peck of pickled peppers\", 14) === \"Peter Piper...\", '<code>\"Peter Piper picked a peck of pickled peppers\", 14</code> should return <code>\"Peter Piper...\"</code>.');",
"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\", '<code>\"A-tisket a-tasket A green and yellow basket\", \"A-tisket a-tasket A green and yellow basket\".length&#41;</code> should return <code>\"A-tisket a-tasket A green and yellow basket\"</code>.');",
"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', '<code>\"A-tisket a-tasket A green and yellow basket\", \"A-tisket a-tasket A green and yellow basket\".length + 2</code> should return <code>\"A-tisket a-tasket A green and yellow basket\"</code>.');"
"assert(truncate(\"A-tisket a-tasket A green and yellow basket\", 11) === \"A-tisket...\", 'message: <code>\"A-tisket a-tasket A green and yellow basket\", 1</code> should return <code>\"A-tisket...\"</code>.');",
"assert(truncate(\"Peter Piper picked a peck of pickled peppers\", 14) === \"Peter Piper...\", 'message: <code>\"Peter Piper picked a peck of pickled peppers\", 14</code> should return <code>\"Peter Piper...\"</code>.');",
"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: <code>\"A-tisket a-tasket A green and yellow basket\", \"A-tisket a-tasket A green and yellow basket\".length&#41;</code> should return <code>\"A-tisket a-tasket A green and yellow basket\"</code>.');",
"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: <code>\"A-tisket a-tasket A green and yellow basket\", \"A-tisket a-tasket A green and yellow basket\".length + 2</code> should return <code>\"A-tisket a-tasket A green and yellow basket\"</code>.');"
],
"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\"]], '<code>[\"a\", \"b\", \"c\", \"d\"], 2</code> should return <code>[[\"a\", \"b\"], [\"c\", \"d\"]]</code>.');",
"assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 3), [[0, 1, 2], [3, 4, 5]], '<code>[0, 1, 2, 3, 4, 5]</code> should return <code>[[0, 1, 2], [3, 4, 5]]</code>.');",
"assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 2), [[0, 1], [2, 3], [4, 5]], '<code>[0, 1, 2, 3, 4, 5], 2</code> should return <code>[[0, 1], [2, 3], [4, 5]]</code>.');",
"assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 4), [[0, 1, 2, 3], [4, 5]], '<code>[0, 1, 2, 3, 4, 5], 4</code> should return <code>[[0, 1, 2, 3], [4, 5]]</code>.');"
"assert.deepEqual(chunk([\"a\", \"b\", \"c\", \"d\"], 2), [[\"a\", \"b\"], [\"c\", \"d\"]], 'message: <code>[\"a\", \"b\", \"c\", \"d\"], 2</code> should return <code>[[\"a\", \"b\"], [\"c\", \"d\"]]</code>.');",
"assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 3), [[0, 1, 2], [3, 4, 5]], 'message: <code>[0, 1, 2, 3, 4, 5]</code> should return <code>[[0, 1, 2], [3, 4, 5]]</code>.');",
"assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 2), [[0, 1], [2, 3], [4, 5]], 'message: <code>[0, 1, 2, 3, 4, 5], 2</code> should return <code>[[0, 1], [2, 3], [4, 5]]</code>.');",
"assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 4), [[0, 1, 2, 3], [4, 5]], 'message: <code>[0, 1, 2, 3, 4, 5], 4</code> should return <code>[[0, 1, 2, 3], [4, 5]]</code>.');"
],
"MDNlinks": [
"Array.push()"
@ -464,9 +464,9 @@
"slasher([1, 2, 3], 2, \"\");"
],
"tests": [
"assert.deepEqual(slasher([1, 2, 3], 2), [3], '<code>[1, 2, 3], 2, [3]</code> should return <code>[3]</code>.');",
"assert.deepEqual(slasher([1, 2, 3], 0), [1, 2, 3], '<code>[1, 2, 3], 0</code> should return <code>[1, 2, 3]</code>.');",
"assert.deepEqual(slasher([1, 2, 3], 9), [], '<code>[1, 2, 3], 9</code> should return <code>[]</code>.');"
"assert.deepEqual(slasher([1, 2, 3], 2), [3], 'message: <code>[1, 2, 3], 2, [3]</code> should return <code>[3]</code>.');",
"assert.deepEqual(slasher([1, 2, 3], 0), [1, 2, 3], 'message: <code>[1, 2, 3], 0</code> should return <code>[1, 2, 3]</code>.');",
"assert.deepEqual(slasher([1, 2, 3], 9), [], 'message: <code>[1, 2, 3], 9</code> should return <code>[]</code>.');"
],
"MDNlinks": [
"Array.slice()",
@ -504,14 +504,14 @@
"mutation([\"hello\", \"hey\"], \"\");"
],
"tests": [
"assert(mutation([\"hello\", \"hey\"]) === false, '<code>[\"hello\", \"hey\"]</code> should return false.');",
"assert(mutation([\"hello\", \"Hello\"]) === true, '<code>[\"hello\", \"Hello\"]</code> should return true.');",
"assert(mutation([\"zyxwvutsrqponmlkjihgfedcba\", \"qrstu\"]) === true, '<code>[\"zyxwvutsrqponmlkjihgfedcba\", \"qrstu\"]</code> should return true.');",
"assert(mutation([\"Mary\", \"Army\"]) === true, '<code>[\"Mary\", \"Army\"]</code> should return true.');",
"assert(mutation([\"Mary\", \"Aarmy\"]) === true, '<code>[\"Mary\", \"Aarmy\"]</code> should return true.');",
"assert(mutation([\"Alien\", \"line\"]) === true, '<code>[\"Alien\", \"line\"]</code> should return true.');",
"assert(mutation([\"floor\", \"for\"]) === true, '<code>[\"floor\", \"for\"]</code> should return true.');",
"assert(mutation([\"hello\", \"neo\"]) === false, '<code>[\"hello\", \"neo\"]</code> should return false.');"
"assert(mutation([\"hello\", \"hey\"]) === false, 'message: <code>[\"hello\", \"hey\"]</code> should return false.');",
"assert(mutation([\"hello\", \"Hello\"]) === true, 'message: <code>[\"hello\", \"Hello\"]</code> should return true.');",
"assert(mutation([\"zyxwvutsrqponmlkjihgfedcba\", \"qrstu\"]) === true, 'message: <code>[\"zyxwvutsrqponmlkjihgfedcba\", \"qrstu\"]</code> should return true.');",
"assert(mutation([\"Mary\", \"Army\"]) === true, 'message: <code>[\"Mary\", \"Army\"]</code> should return true.');",
"assert(mutation([\"Mary\", \"Aarmy\"]) === true, 'message: <code>[\"Mary\", \"Aarmy\"]</code> should return true.');",
"assert(mutation([\"Alien\", \"line\"]) === true, 'message: <code>[\"Alien\", \"line\"]</code> should return true.');",
"assert(mutation([\"floor\", \"for\"]) === true, 'message: <code>[\"floor\", \"for\"]</code> should return true.');",
"assert(mutation([\"hello\", \"neo\"]) === false, 'message: <code>[\"hello\", \"neo\"]</code> 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], '<code>[7, \"ate\", \"\", false, 9]</code> should return <code>[7, \"ate\", 9]</code>.');",
"assert.deepEqual(bouncer([\"a\", \"b\", \"c\"]), [\"a\", \"b\", \"c\"], '<code>[\"a\", \"b\", \"c\"]</code> should return <code>[\"a\", \"b\", \"c\"]</code>.');",
"assert.deepEqual(bouncer([false, null, 0, NaN, undefined, '']), [], '<code>[false, null, 0]</code> should return <code>[]</code>.');"
"assert.deepEqual(bouncer([7, \"ate\", \"\", false, 9]), [7, \"ate\", 9], 'message: <code>[7, \"ate\", \"\", false, 9]</code> should return <code>[7, \"ate\", 9]</code>.');",
"assert.deepEqual(bouncer([\"a\", \"b\", \"c\"]), [\"a\", \"b\", \"c\"], 'message: <code>[\"a\", \"b\", \"c\"]</code> should return <code>[\"a\", \"b\", \"c\"]</code>.');",
"assert.deepEqual(bouncer([false, null, 0, NaN, undefined, '']), [], 'message: <code>[false, null, 0]</code> should return <code>[]</code>.');"
],
"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], '<code>[1, 2, 3, 1, 2, 3], 2, 3</code> should return <code>[1, 1]</code>.');",
"assert.deepEqual(destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3), [1, 5, 1], '<code>[1, 2, 3, 5, 1, 2, 3], 2, 3</code> should return <code>[1, 5, 1]</code>.');",
"assert.deepEqual(destroyer([3, 5, 1, 2, 2], 2, 3, 5), [1], '<code>[3, 5, 1, 2, 2], 2, 3, 5</code> should return <code>[1]</code>.');",
"assert.deepEqual(destroyer([2, 3, 2, 3], 2, 3), [], '<code>[2, 3, 2, 3], 2, 3</code> should return <code>[]</code>.');",
"assert.deepEqual(destroyer([\"tree\", \"hamburger\", 53], \"tree\", 53), [\"hamburger\"], '<code>[\"tree\", \"hamburger\", 53], \"tree\", 53)</code> should return <code>[\"hamburger\"]</code>.');"
"assert.deepEqual(destroyer([1, 2, 3, 1, 2, 3], 2, 3), [1, 1], 'message: <code>[1, 2, 3, 1, 2, 3], 2, 3</code> should return <code>[1, 1]</code>.');",
"assert.deepEqual(destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3), [1, 5, 1], 'message: <code>[1, 2, 3, 5, 1, 2, 3], 2, 3</code> should return <code>[1, 5, 1]</code>.');",
"assert.deepEqual(destroyer([3, 5, 1, 2, 2], 2, 3, 5), [1], 'message: <code>[3, 5, 1, 2, 2], 2, 3, 5</code> should return <code>[1]</code>.');",
"assert.deepEqual(destroyer([2, 3, 2, 3], 2, 3), [], 'message: <code>[2, 3, 2, 3], 2, 3</code> should return <code>[]</code>.');",
"assert.deepEqual(destroyer([\"tree\", \"hamburger\", 53], \"tree\", 53), [\"hamburger\"], 'message: <code>[\"tree\", \"hamburger\", 53], \"tree\", 53)</code> should return <code>[\"hamburger\"]</code>.');"
],
"MDNlinks": [
"Arguments object",
@ -629,12 +629,12 @@
"Array.sort()"
],
"tests": [
"assert(where([10, 20, 30, 40, 50], 35) === 3, '<code>[10, 20, 30, 40, 50], 35</code> should return <code>3</code>.');",
"assert(where([10, 20, 30, 40, 50], 30) === 2, '<code>[10, 20, 30, 40, 50], 30)</code> should return <code>2</code>.');",
"assert(where([40, 60], 50) === 1, '<code>[40, 60,], 50</code> should return <code>1</code>.');",
"assert(where([5, 3, 20, 3], 3) === 0, '<code>[5, 3, 20, 3], 3</code> should return <code>0</code>.');",
"assert(where([2, 20, 10], 1) === 0, '<code>[2, 20, 10], 1</code> should return <code>0</code>.');",
"assert(where([2, 5, 10], 15) === 3, '<code>[2, 5, 10], 15</code> should return <code>3</code>.');"
"assert(where([10, 20, 30, 40, 50], 35) === 3, 'message: <code>[10, 20, 30, 40, 50], 35</code> should return <code>3</code>.');",
"assert(where([10, 20, 30, 40, 50], 30) === 2, 'message: <code>[10, 20, 30, 40, 50], 30)</code> should return <code>2</code>.');",
"assert(where([40, 60], 50) === 1, 'message: <code>[40, 60,], 50</code> should return <code>1</code>.');",
"assert(where([5, 3, 20, 3], 3) === 0, 'message: <code>[5, 3, 20, 3], 3</code> should return <code>0</code>.');",
"assert(where([2, 20, 10], 1) === 0, 'message: <code>[2, 20, 10], 1</code> should return <code>0</code>.');",
"assert(where([2, 5, 10], 15) === 3, 'message: <code>[2, 5, 10], 15</code> should return <code>3</code>.');"
],
"type": "bonfire",
"challengeType": 5,