Package: Validate challenges on test (#17216)

This PR allows us to validate the schema during test.

It also removes some cruft from the seed files and ensures only the required data is packaged and consumable, reducing the package weight somewhat.
This commit is contained in:
Stuart Taylor
2018-05-22 13:43:14 +01:00
committed by mrugesh mohapatra
parent afc948890c
commit 4e645a5ff6
51 changed files with 49 additions and 1377 deletions

View File

@ -23,7 +23,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -65,7 +64,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -120,7 +118,6 @@
"hints": [
"All the h5 tags are siblings, and should be changed to the same new heading level."
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -173,7 +170,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -220,7 +216,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -287,7 +282,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -357,7 +351,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -432,7 +425,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -527,7 +519,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -593,7 +584,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -674,7 +664,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -758,7 +747,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -849,7 +837,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -918,7 +905,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1001,7 +987,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1122,7 +1107,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1179,7 +1163,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1231,7 +1214,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1284,7 +1266,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1340,7 +1321,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1401,7 +1381,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1497,7 +1476,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},

View File

@ -29,7 +29,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -95,7 +94,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -162,7 +160,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -237,7 +234,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -316,7 +312,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -390,7 +385,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -468,7 +462,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -543,7 +536,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -626,7 +618,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -699,7 +690,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -779,7 +769,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -857,7 +846,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -940,7 +928,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1038,7 +1025,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1105,7 +1091,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1169,7 +1154,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1209,7 +1193,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1256,7 +1239,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1305,7 +1287,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1353,7 +1334,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1408,7 +1388,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1469,7 +1448,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1537,7 +1515,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1598,7 +1575,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1654,7 +1630,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1704,7 +1679,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1766,7 +1740,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1837,7 +1810,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1932,7 +1904,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1991,7 +1962,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -2069,7 +2039,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -2139,7 +2108,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -2192,7 +2160,6 @@
"hints": [
"Remember to wrap the address in quotes within the url() function."
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -2230,7 +2197,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -2292,7 +2258,6 @@
"hints": [
"Make sure to apply the CSS rule to the hover state of the div, using div:hover"
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -2345,7 +2310,6 @@
"hints": [
"Notice that there is no space between the number and \"deg\" (-32deg) when declaring the degrees value."
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -2394,7 +2358,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -2455,7 +2418,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -2523,7 +2485,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -2617,7 +2578,6 @@
"hints": [
"Make sure the @keyframes rule links to the animation-name."
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -2675,7 +2635,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -2726,7 +2685,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"challengeType": 0,
"translations": {},
"files": {
@ -2788,7 +2746,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -2856,7 +2813,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -2918,7 +2874,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -2988,7 +2943,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -3092,7 +3046,6 @@
"hints": [
"Check the animation-name declared in the star-1 class to find the right @keyframes rule to change."
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -3185,7 +3138,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -3275,7 +3227,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -3354,7 +3305,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -3436,7 +3386,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -3504,7 +3453,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},

View File

@ -27,7 +27,6 @@
"testString": "assert(code.match(/<h2\\s+style\\s*=\\s*(\\'|\")\\s*color\\s*:\\s*(?:rgb\\(\\s*255\\s*,\\s*0\\s*,\\s*0\\s*\\)|rgb\\(\\s*100%\\s*,\\s*0%\\s*,\\s*0%\\s*\\)|red|#ff0000|#f00|hsl\\(\\s*0\\s*,\\s*100%\\s*,\\s*50%\\s*\\))\\s*\\;(\\'|\")>\\s*CatPhotoApp\\s*<\\/h2>/),' Your <code>style</code> declaration should end with a <code>;</code> .');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -158,7 +157,6 @@
"testString": "assert(code.match(/<\\/style>/g) && code.match(/<\\/style>/g).length === (code.match(/<style((\\s)*((type|media|scoped|title|disabled)=\"[^\"]*\")?(\\s)*)*>/g) || []).length, 'Make sure all your <code>style</code> elements are valid and have a closing tag.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -298,7 +296,6 @@
"testString": "assert($(\"h2\").attr(\"style\") === undefined, 'Do not use inline style declarations like <code>style=\"color&#58; red\"</code> in your <code>h2</code> element.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -442,7 +439,6 @@
"testString": "assert($(\"p:eq(0)\").hasClass(\"red-text\"), 'Your first <code>p</code> element should have the class <code>red-text</code>.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -559,7 +555,6 @@
"testString": "assert(code.match(/p\\s*{\\s*font-size\\s*:\\s*16\\s*px\\s*;\\s*}/i), 'Between the <code>style</code> tags, give the <code>p</code> elements <code>font-size</code> of <code>16px</code>. Browser and Text zoom should be at 100%.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -665,7 +660,6 @@
"testString": "assert($(\"p\").not(\".red-text\").css(\"font-family\").match(/monospace/i), 'Your <code>p</code> elements should use the font <code>monospace</code>.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -796,7 +790,6 @@
"testString": "assert($(\"p\").css(\"font-family\").match(/monospace/i), 'Your <code>p</code> element should still use the font <code>monospace</code>.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -931,7 +924,6 @@
"testString": "assert(new RegExp(\"[^fc]-->\", \"gi\").test(code), 'Be sure to close your comment by adding <code>--&#62;</code>.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -1060,7 +1052,6 @@
"testString": "assert($(\"img\").width() === 100, 'Your image should be 100 pixels wide. Browser zoom should be at 100%.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -1203,7 +1194,6 @@
"testString": "assert($(\"img\").css(\"border-left-color\") === \"rgb(0, 128, 0)\", 'The border around your <code>img</code> element should be green.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -1343,7 +1333,6 @@
"testString": "assert(parseInt($(\"img\").css(\"border-top-left-radius\")) > 8, 'Your image should have a border radius of <code>10px</code>');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -1471,7 +1460,6 @@
"testString": "assert(code.match(/50%/g), 'Be sure to use a percentage value of <code>50%</code>.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -1597,7 +1585,6 @@
"testString": "assert($(\"div\").css(\"background-color\") === \"rgb(192, 192, 192)\", 'Your <code>div</code> element should have a silver background.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -1731,7 +1718,6 @@
"testString": "assert($(\"form\").attr(\"id\") === \"cat-photo-form\", 'Give your <code>form</code> element the id of <code>cat-photo-form</code>.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -1887,7 +1873,6 @@
"testString": "assert(!code.match(/<form.*style.*>/gi) && !code.match(/<form.*class.*>/gi), 'Do not give your <code>form</code> any <code>class</code> or <code>style</code> attributes.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -2030,7 +2015,6 @@
"testString": "assert($(\".blue-box\").css(\"padding-top\") === \"20px\", 'Your <code>blue-box</code> class should give elements <code>20px</code> of <code>padding</code>.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -2150,7 +2134,6 @@
"testString": "assert($(\".blue-box\").css(\"margin-top\") === \"20px\", 'Your <code>blue-box</code> class should give elements <code>20px</code> of <code>margin</code>.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -2261,7 +2244,6 @@
"testString": "assert($(\".blue-box\").css(\"margin-top\") === \"-15px\", 'Your <code>blue-box</code> class should give elements <code>-15px</code> of <code>margin</code>.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -2382,7 +2364,6 @@
"testString": "assert($(\".blue-box\").css(\"padding-left\") === \"40px\", 'Your <code>blue-box</code> class should give the left of the elements <code>40px</code> of <code>padding</code>.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -2500,7 +2481,6 @@
"testString": "assert($(\".blue-box\").css(\"margin-left\") === \"40px\", 'Your <code>blue-box</code> class should give the left of elements <code>40px</code> of <code>margin</code>.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -2622,7 +2602,6 @@
"testString": "assert(!/padding-top|padding-right|padding-bottom|padding-left/.test(code), 'You should use the clockwise notation to set the padding of <code>blue-box</code> class.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -2742,7 +2721,6 @@
"testString": "assert($(\".blue-box\").css(\"margin-left\") === \"40px\", 'Your <code>blue-box</code> class should give the left of elements <code>40px</code> of <code>margin</code>.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -2864,7 +2842,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -2963,7 +2940,6 @@
"testString": "assert(code.match(/\\.red-box\\s*?{\\s*?.*?\\s*?.*?\\s*?padding:\\s*?1\\.5em/gi), 'Your <code>red-box</code> class should give elements 1.5em of <code>padding</code>.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {},
"files": {
@ -3038,7 +3014,6 @@
"testString": "assert(code.match(/<style>\\s*body\\s*\\{\\s*background.*\\s*:\\s*.*;\\s*\\}\\s*<\\/style>/i), 'Make sure your CSS rule ends with a semi-colon.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -3144,7 +3119,6 @@
"testString": "assert(($(\"h1\").length > 0 && $(\"h1\").css(\"color\") === \"rgb(0, 128, 0)\"), 'Your <code>h1</code> element should inherit the color green from your <code>body</code> element.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -3235,7 +3209,6 @@
"testString": "assert($(\"h1\").css(\"color\") === \"rgb(255, 192, 203)\", 'Your <code>h1</code> element should be pink.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -3333,7 +3306,6 @@
"testString": "assert($(\"h1\").css(\"color\") === \"rgb(0, 0, 255)\", 'Your <code>h1</code> element should be blue.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -3461,7 +3433,6 @@
"testString": "assert($(\"h1\").css(\"color\") === \"rgb(255, 165, 0)\", 'Your <code>h1</code> element should be orange.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -3582,7 +3553,6 @@
"testString": "assert($(\"h1\").css(\"color\") === \"rgb(255, 255, 255)\", 'Your <code>h1</code> element should be white.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -3698,7 +3668,6 @@
"testString": "assert($(\"h1\").css(\"color\") === \"rgb(255, 192, 203)\", 'Your <code>h1</code> element should be pink.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -3804,7 +3773,6 @@
"testString": "assert(code.match(/body\\s*{(([\\s\\S]*;\\s*?)|\\s*?)background.*\\s*:\\s*?#000(000)?((\\s*})|(;[\\s\\S]*?}))/gi), 'Use the <code>hex code</code> for the color black instead of the word <code>black</code>.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -3912,7 +3880,6 @@
"testString": "assert(code.match(/\\.orange-text\\s*?{\\s*?color:\\s*?#FFA500\\s*?;\\s*?}/gi), 'Use the <code>hex code</code> for the color orange instead of the word <code>orange</code>.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -4031,7 +3998,6 @@
"testString": "assert(code.match(/\\.fuchsia-text\\s*?{\\s*?color:\\s*?#F0F\\s*?;\\s*?}/gi), 'Use the abbreviated <code>hex code</code> for the color fuchsia instead of the hex code <code>#FF00FF</code>.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -4135,7 +4101,6 @@
"testString": "assert(code.match(/rgb\\s*\\(\\s*0\\s*,\\s*0\\s*,\\s*0\\s*\\)/ig), 'Use <code>rgb</code> to give your <code>body</code> element a color of black.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -4255,7 +4220,6 @@
"testString": "assert(code.match(/\\.sienna-text\\s*?{\\s*?color:\\s*?rgb\\(\\s*?160\\s*?,\\s*?82\\s*?,\\s*?45\\s*?\\)\\s*?;\\s*?}/gi), 'Use <code>rgb</code> for the color sienna.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -4350,7 +4314,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Mar 15, 2018",
"challengeType": 0,
"translations": {},
@ -4585,7 +4548,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Mar 15, 2018",
"challengeType": 0,
"translations": {},
@ -4829,7 +4791,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Mar 15, 2018",
"challengeType": 0,
"translations": {},
@ -5079,7 +5040,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Mar 15, 2018",
"challengeType": 0,
"translations": {},
@ -5318,7 +5278,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Mar 15, 2018",
"challengeType": 0,
"translations": {},
@ -5553,7 +5512,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Mar 15, 2018",
"challengeType": 0,
"translations": {},
@ -5794,7 +5752,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Mar 15, 2018",
"challengeType": 0,
"translations": {},

View File

@ -27,7 +27,6 @@
"testString": "assert.isTrue((/hello(\\s)+world/gi).test($('h1').text()), 'Your <code>h1</code> element should have the text \"Hello World\".');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -141,7 +140,6 @@
"testString": "assert.isTrue((/hello(\\s)+world/gi).test($(\"h1\").text()), 'Your <code>h1</code> element should have the text \"Hello World\".');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -225,7 +223,6 @@
"testString": "assert(code.match(/<\\/p>/g) && code.match(/<\\/p>/g).length === code.match(/<p/g).length, 'Make sure your <code>p</code> element has a closing tag.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -298,7 +295,6 @@
"testString": "assert.isTrue((/Kitty(\\s)+ipsum/gi).test($(\"p\").text()), 'Your <code>p</code> element should contain the first few words of the provided <code>kitty ipsum text</code>.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -386,7 +382,6 @@
"testString": "assert(!/[^fc]-->/gi.test(code.replace(/ *<!--[^fc]*\\n/g,'')), 'Be sure to delete all trailing comment tags&#44; i.e. <code>--&#62;</code>.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -479,7 +474,6 @@
"testString": "assert((code.match(/<([a-z0-9]){1,2}>/g)[0]===\"<h1>\" && code.match(/<([a-z0-9]){1,2}>/g)[1]===\"<h2>\" && code.match(/<([a-z0-9]){1,2}>/g)[2]===\"<p>\") , 'Do not change the order of the <code>h1</code> <code>h2</code> or <code>p</code> in the code.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -560,7 +554,6 @@
"testString": "assert(($(\"p\").length > 0), 'Leave your <code>p</code> element on the page.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -658,7 +651,6 @@
"testString": "assert(code.match(/<\\/p>\\s*?<\\/main>/g), 'The closing <code>main</code> tag should come after the second closing paragraph tag.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"pt-br": {
@ -723,7 +715,6 @@
"testString": "assert(code.match(/alt\\s*?=\\s*?(\\\"|\\').*(\\\"|\\')/), 'Your image element <strong>must</strong> have an <code>alt</code> attribute.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -826,7 +817,6 @@
"testString": "assert(code.match(/<\\/a>/g) && code.match(/<\\/a>/g).length === code.match(/<a/g).length, 'Make sure your <code>a</code> element has a closing tag.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -940,7 +930,6 @@
"testString": "assert($('footer').eq(0).attr('id') == \"footer\", 'The <code>footer</code> tag should have an <code>id</code> attribute set to \"footer\".');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"pt-br": {
@ -1036,7 +1025,6 @@
"testString": "assert(code.match(/<\\/a>/g) && code.match(/<a/g) && code.match(/<\\/a>/g).length === code.match(/<a/g).length, 'Make sure each of your <code>a</code> elements has a closing tag.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -1126,7 +1114,6 @@
"testString": "assert($(\"a\").attr(\"href\") === \"#\", 'Your <code>a</code> element should be a dead link with the value of the <code>href</code> attribute set to \"#\".');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -1213,7 +1200,6 @@
"testString": "assert(code.match(/<\\/a>/g) && code.match(/<a/g) && code.match(/<\\/a>/g).length === code.match(/<a/g).length, 'Make sure each of your <code>a</code> elements has a closing tag.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -1313,7 +1299,6 @@
"testString": "assert(code.match(/<\\/li>/gi) && code.match(/<li[\\s>]/gi) && code.match(/<\\/li>/gi).length === code.match(/<li[\\s>]/gi).length, 'Make sure your <code>li</code> elements have closing tags.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -1436,7 +1421,6 @@
"testString": "assert(code.match(/<\\/li>/g) && code.match(/<li>/g) && code.match(/<\\/li>/g).length === code.match(/<li>/g).length, 'Make sure your <code>li</code> element has a closing tag.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -1533,7 +1517,6 @@
"testString": "assert($(\"input[type=text]\").length > 0, 'Your app should have an <code>input</code> element of type <code>text</code>.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -1642,7 +1625,6 @@
"testString": "assert($(\"input[type=text]\").length > 0 && code.match(/<input((\\s+\\w+(\\s*=\\s*(?:\".*?\"|'.*?'|[\\^'\">\\s]+))?)+\\s*|\\s*)\\/?>/gi), 'The finished <code>input</code> element should have valid syntax.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -1743,7 +1725,6 @@
"testString": "assert(code.match(/<\\/form>/g) && code.match(/<form [^<]*>/g) && code.match(/<\\/form>/g).length === code.match(/<form [^<]*>/g).length, 'Make sure your <code>form</code> element has well-formed open and close tags.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -1847,7 +1828,6 @@
"testString": "assert(code.match(/<\\/button>/g) && code.match(/<button/g) && code.match(/<\\/button>/g).length === code.match(/<button/g).length, 'Make sure your <code>button</code> element has a closing tag.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -1942,7 +1922,6 @@
"testString": "assert($(\"input\").prop(\"required\"), 'Your text <code>input</code> element should have the <code>required</code> attribute.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -2070,7 +2049,6 @@
"testString": "assert($(\"label\").parent().get(0).tagName.match('FORM'), 'Each of your radio button elements should be added within the <code>form</code> tag.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -2192,7 +2170,6 @@
"testString": "assert($('label > input[type=\"checkbox\"]').filter(\"[name='personality']\").length > 2, 'Give your checkboxes the <code>name</code> attribute of <code>personality</code>.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -2305,7 +2282,6 @@
"testString": "assert($('input[type=\"checkbox\"]').prop(\"checked\"), 'Your first checkbox on your form should be checked by default.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -2418,7 +2394,6 @@
"testString": "assert(code.match(/<\\/div>/g) && code.match(/<\\/div>/g).length === code.match(/<div>/g).length, 'Make sure your <code>div</code> element has a closing tag.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -2535,7 +2510,6 @@
"testString": "assert(code.match(/<html>\\s*?<h1>\\s*?.*?\\s*?<\\/h1>\\s*?<\\/html>/gi), 'The <code>html</code> tags should wrap around one <code>h1</code> element.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"pt-br": {
@ -2601,7 +2575,6 @@
"testString": "assert($('body').children('h1').length == 1 && $('body').children('p').length == 1, 'The <code>body</code> element should wrap around both the <code>h1</code> and <code>p</code> elements.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"pt-br": {

View File

@ -21,7 +21,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -102,7 +101,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -225,7 +223,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -284,7 +281,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -407,7 +403,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -462,7 +457,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -587,7 +581,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -643,7 +636,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -769,7 +761,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -833,7 +824,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -959,7 +949,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1045,7 +1034,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1106,7 +1094,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1174,7 +1161,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1240,7 +1226,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1298,7 +1283,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1359,7 +1343,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},

View File

@ -21,7 +21,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 15, 2018",
"challengeType": 0,
"translations": {},
@ -81,7 +80,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 15, 2018",
"challengeType": 0,
"translations": {},
@ -139,7 +137,6 @@
],
"solutions": [],
"hints": [],
"type": "",
"releasedOn": "",
"challengeType": 0,
"translations": {},
@ -204,7 +201,6 @@
],
"solutions": [],
"hints": [],
"type": "",
"releasedOn": "",
"challengeType": 0,
"translations": {},
@ -266,7 +262,6 @@
],
"solutions": [],
"hints": [],
"type": "",
"releasedOn": "",
"challengeType": 0,
"translations": {},
@ -327,7 +322,6 @@
],
"solutions": [],
"hints": [],
"type": "",
"releasedOn": "",
"challengeType": 0,
"translations": {},
@ -388,7 +382,6 @@
],
"solutions": [],
"hints": [],
"type": "",
"releasedOn": "",
"challengeType": 0,
"translations": {},
@ -455,7 +448,6 @@
],
"solutions": [],
"hints": [],
"type": "",
"releasedOn": "",
"challengeType": 0,
"translations": {},
@ -520,7 +512,6 @@
],
"solutions": [],
"hints": [],
"type": "",
"releasedOn": "",
"challengeType": 0,
"translations": {},
@ -589,7 +580,6 @@
],
"solutions": [],
"hints": [],
"type": "",
"releasedOn": "",
"challengeType": 0,
"translations": {},
@ -655,7 +645,6 @@
],
"solutions": [],
"hints": [],
"type": "",
"releasedOn": "",
"challengeType": 0,
"translations": {},
@ -721,7 +710,6 @@
],
"solutions": [],
"hints": [],
"type": "",
"releasedOn": "",
"challengeType": 0,
"translations": {},
@ -783,7 +771,6 @@
],
"solutions": [],
"hints": [],
"type": "",
"releasedOn": "",
"challengeType": 0,
"translations": {},
@ -849,7 +836,6 @@
],
"solutions": [],
"hints": [],
"type": "",
"releasedOn": "",
"challengeType": 0,
"translations": {},
@ -916,7 +902,6 @@
],
"solutions": [],
"hints": [],
"type": "",
"releasedOn": "",
"challengeType": 0,
"translations": {},
@ -989,7 +974,6 @@
],
"solutions": [],
"hints": [],
"type": "",
"releasedOn": "",
"challengeType": 0,
"translations": {},
@ -1062,7 +1046,6 @@
],
"solutions": [],
"hints": [],
"type": "",
"releasedOn": "",
"challengeType": 0,
"translations": {},
@ -1126,7 +1109,6 @@
],
"solutions": [],
"hints": [],
"type": "",
"releasedOn": "",
"challengeType": 0,
"translations": {},
@ -1192,7 +1174,6 @@
],
"solutions": [],
"hints": [],
"type": "",
"releasedOn": "",
"challengeType": 0,
"translations": {},
@ -1272,7 +1253,6 @@
],
"solutions": [],
"hints": [],
"type": "",
"releasedOn": "",
"challengeType": 0,
"translations": {},
@ -1353,7 +1333,6 @@
],
"solutions": [],
"hints": [],
"type": "",
"releasedOn": "",
"challengeType": 0,
"translations": {},
@ -1458,7 +1437,6 @@
],
"solutions": [],
"hints": [],
"type": "",
"releasedOn": "",
"challengeType": 0,
"translations": {},

View File

@ -24,9 +24,7 @@
"Remember to use the <a href='https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck/19514' target='_blank'>Read-Search-Ask</a> method if you get stuck."
],
"releasedOn": "January 1, 2016",
"challengeSeed": [],
"tests": [],
"type": "zipline",
"isRequired": true,
"challengeType": 3,
"translations": {
@ -69,9 +67,7 @@
"Remember to use the <a href='https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck/19514' target='_blank'>Read-Search-Ask</a> method if you get stuck."
],
"releasedOn": "January 15, 2017",
"challengeSeed": [],
"tests": [],
"type": "zipline",
"isRequired": true,
"challengeType": 3,
"translations": {}
@ -103,9 +99,7 @@
"Remember to use the <a href='https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck/19514' target='_blank'>Read-Search-Ask</a> method if you get stuck."
],
"releasedOn": "January 15, 2017",
"challengeSeed": [],
"tests": [],
"type": "zipline",
"isRequired": true,
"challengeType": 3,
"translations": {}
@ -137,9 +131,7 @@
"Remember to use the <a href='https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck/19514' target='_blank'>Read-Search-Ask</a> method if you get stuck."
],
"releasedOn": "January 15, 2017",
"challengeSeed": [],
"tests": [],
"type": "zipline",
"isRequired": true,
"challengeType": 3,
"translations": {}
@ -166,9 +158,7 @@
"Once you're done, submit the URL to your working project with all its tests passing.",
"Remember to use the <a href='https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck/19514' target='_blank'>Read-Search-Ask</a> method if you get stuck."
],
"challengeSeed": [],
"tests": [],
"type": "zipline",
"isRequired": true,
"challengeType": 3,
"translations": {

View File

@ -28,7 +28,6 @@
"testString": "assert(code.match(/@media\\s?\\(max-height:\\s*?800px\\)/g), 'Declare a <code>@media</code> query for devices with a <code>height</code> less than or equal to 800px.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"hints": [],
@ -95,7 +94,6 @@
"testString": "assert(code.match(/height:\\s*?auto;/g), 'Your <code>img</code> tag should have a <code>height</code> set to auto.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"solutions": [],
@ -151,7 +149,6 @@
"testString": "assert($('img').css('height') == '100px', 'Your <code>img</code> tag should have a <code>height</code> of 100 pixels.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"solutions": [],
@ -205,7 +202,6 @@
"testString": "assert(code.match(/p\\s*?{\\s*?width:\\s*?75vmin;\\s*?}/g), 'Your <code>p</code> tag should have a <code>width</code> of 75vmin.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"hints": [],

View File

@ -42,7 +42,6 @@
"testString": "assert(convertToF(30) === 86, '<code>convertToF(30)</code> should return a value of <code>86</code>');"
}
],
"type": "checkpoint",
"challengeType": 1,
"isRequired": true,
"translations": {
@ -107,7 +106,6 @@
"testString": "assert(reverseString(\"Greetings from Earth\") === \"htraE morf sgniteerG\", '<code>reverseString(\"Greetings from Earth\")</code> should return <code>\"htraE morf sgniteerG\"</code>.');"
}
],
"type": "bonfire",
"isRequired": true,
"solutions": [
"function reverseString(str) {\n return str.split('').reverse().join('');\n}\n\nreverseString(\"hello\");\n"
@ -189,7 +187,6 @@
"testString": "assert(factorialize(0) === 1, '<code>factorialize(0)</code> should return 1.');"
}
],
"type": "bonfire",
"isRequired": true,
"solutions": [
"function factorialize(num) {\n return num < 1 ? 1 : num * factorialize(num - 1);\n}\n\nfactorialize(5);\n"
@ -271,7 +268,6 @@
"testString": "assert(findLongestWordLength(\"What if we try a super-long word such as otorhinolaryngology\") === 19, '<code>findLongestWordLength(\"What if we try a super-long word such as otorhinolaryngology\")</code> should return 19.');"
}
],
"type": "bonfire",
"isRequired": true,
"solutions": [
"function findLongestWordLength(str) {\n return str.split(' ').sort((a, b) => b.length - a.length)[0].length;\n}\n\nfindLongestWordLength(\"The quick brown fox jumped over the lazy dog\");\n"
@ -342,7 +338,6 @@
"testString": "assert.deepEqual(largestOfFour([[17, 23, 25, 12], [25, 7, 34, 48], [4, -10, 18, 21], [-72, -3, -17, -10]]), [25, 48, 21, -3], '<code>largestOfFour([[17, 23, 25, 12], [25, 7, 34, 48], [4, -10, 18, 21], [-72, -3, -17, -10]])</code> should return <code>[25, 48, 21, -3]</code>.');"
}
],
"type": "bonfire",
"isRequired": true,
"solutions": [
"function largestOfFour(arr) {\n return arr.map(subArr => Math.max.apply(null, subArr));\n}\n\nlargestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);\n"
@ -442,7 +437,6 @@
"testString": "assert(!(/\\.endsWith\\(.*?\\)\\s*?;?/.test(code)) && !(/\\['endsWith'\\]/.test(code)), 'Do not use the built-in method <code>.endsWith()</code> to solve the challenge.');"
}
],
"type": "bonfire",
"isRequired": true,
"solutions": [
"function confirmEnding(str, target) {\n return str.substring(str.length - target.length) === target;\n}\n\nconfirmEnding(\"Bastian\", \"n\");\n"
@ -525,7 +519,6 @@
"testString": "assert(!/\\.repeat/g.test(code), 'The built-in <code>repeat()</code>-method should not be used');"
}
],
"type": "bonfire",
"isRequired": true,
"solutions": [
"function repeatStringNumTimes(str, num) {\n if (num < 0) return '';\n return num === 1 ? str : str + repeatStringNumTimes(str, num-1);\n}\n\nrepeatStringNumTimes(\"abc\", 3);\n"
@ -601,7 +594,6 @@
"testString": "assert(truncateString(\"Absolutely Longer\", 2) === \"Ab...\", '<code>truncateString(\"Absolutely Longer\", 2)</code> should return \"Ab...\".');"
}
],
"type": "bonfire",
"isRequired": true,
"solutions": [
"function truncateString(str, num) {\n if (num >= str.length) {\n return str;\n }\n\n return str.slice(0, num) + '...';\n}\n\ntruncateString(\"A-tisket a-tasket A green and yellow basket\", 8);\n"
@ -664,7 +656,6 @@
"testString": "assert.strictEqual(findElement([1, 3, 5, 9], function(num) { return num % 2 === 0; }), undefined, '<code>findElement([1, 3, 5, 9], function(num) { return num % 2 === 0; })</code> should return undefined.');"
}
],
"type": "bonfire",
"MDNlinks": [
"Array.prototype.filter()"
],
@ -764,7 +755,6 @@
"testString": "assert.strictEqual(booWho(\"false\"), false, '<code>booWho(\"false\")</code> should return false.');"
}
],
"type": "bonfire",
"MDNlinks": [
"Boolean Objects"
],
@ -840,7 +830,6 @@
"testString": "assert(titleCase(\"HERE IS MY HANDLE HERE IS MY SPOUT\") === \"Here Is My Handle Here Is My Spout\", '<code>titleCase(\"HERE IS MY HANDLE HERE IS MY SPOUT\")</code> should return <code>Here Is My Handle Here Is My Spout</code>.');"
}
],
"type": "bonfire",
"isRequired": true,
"solutions": [
"function titleCase(str) {\n return str.split(' ').map(word => word.charAt(0).toUpperCase() + word.substring(1).toLowerCase()).join(' ');\n}\n\ntitleCase(\"I'm a little tea pot\");\n"
@ -920,7 +909,6 @@
"testString": "assert(testArr2[0] === \"a\" && testArr2[1] === \"b\", 'The second array should remain the same after the function runs.');"
}
],
"type": "bonfire",
"isRequired": true,
"isBeta": true,
"solutions": [
@ -990,7 +978,6 @@
"testString": "assert.deepEqual(bouncer([1, null, NaN, 2, undefined]), [1, 2], '<code>bouncer([1, null, NaN, 2, undefined])</code> should return <code>[1, 2]</code>.');"
}
],
"type": "bonfire",
"isRequired": true,
"solutions": [
"function bouncer(arr) {\n return arr.filter(e => e);\n}\n\nbouncer([7, \"ate\", \"\", false, 9]);\n"
@ -1112,7 +1099,6 @@
"testString": "assert(typeof(getIndexToIns([], 1)) === \"number\", '<code>getIndexToIns([], 1)</code> should return a number.');"
}
],
"type": "bonfire",
"isRequired": true,
"solutions": [
"function getIndexToIns(arr, num) {\n arr = arr.sort((a, b) => a - b);\n\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] >= num) {\n return i;\n }\n }\n\n return arr.length;\n}\n\ngetIndexToIns([40, 60], 50);\n"
@ -1207,7 +1193,6 @@
"testString": "assert(mutation([\"voodoo\", \"no\"]) === false, '<code>mutation([\"voodoo\", \"no\"])</code> should return false.');"
}
],
"type": "bonfire",
"isRequired": true,
"solutions": [
"function mutation(arr) {\n let hash = Object.create(null);\n\n arr[0].toLowerCase().split('').forEach(c => hash[c] = true);\n\n return !arr[1].toLowerCase().split('').filter(c => !hash[c]).length;\n}\n\nmutation([\"hello\", \"hey\"]);\n"
@ -1292,7 +1277,6 @@
"testString": "assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 2), [[0, 1], [2, 3], [4, 5], [6, 7], [8]], '<code>chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 2)</code> should return <code>[[0, 1], [2, 3], [4, 5], [6, 7], [8]]</code>.');"
}
],
"type": "bonfire",
"isRequired": true,
"solutions": [
"function chunkArrayInGroups(arr, size) {\n let out = [];\n\n for (let i = 0; i < arr.length; i += size) {\n out.push(arr.slice(i, i + size));\n }\n\n return out;\n}\n\nchunkArrayInGroups([\"a\", \"b\", \"c\", \"d\"], 2);\n"

View File

@ -38,7 +38,6 @@
"testString": "assert(yourArray.filter( el => typeof el === 'string').length >= 1, '<code>yourArray</code> contains at least one <code>string</code>');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -91,7 +90,6 @@
"testString": "assert.strictEqual(myArray[3], \"d\", '<code>myArray[3]</code> is equal to <code>\"d\"</code>');"
}
],
"type": "waypoint",
"solutions": [],
"challengeType": 1,
"translations": {},
@ -137,7 +135,6 @@
"testString": "assert.notStrictEqual(mixedNumbers.toString().search(/\\.unshift\\(/), -1, 'The <code>mixedNumbers</code> function should utilize the <code>unshift()</code> method');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -189,7 +186,6 @@
"testString": "assert.notStrictEqual(popShift.toString().search(/\\.shift\\(/), -1, 'The <code>popShift</code> function should utilize the <code>shift()</code> method');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -236,7 +232,6 @@
"testString": "assert.notStrictEqual(sumOfTen.toString().search(/\\.splice\\(/), -1, 'The <code>sumOfTen</code> function should utilize the <code>splice()</code> method');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -290,7 +285,6 @@
"testString": "assert(!/\\[\\d\\]\\s*=/.test(code), 'You should not use array bracket notation.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -336,7 +330,6 @@
"testString": "assert(/\\.slice\\(/.test(code), 'The <code>forecast</code> function should utilize the <code>slice()</code> method');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -393,7 +386,6 @@
"testString": "assert.notStrictEqual(copyMachine.toString().indexOf('.concat(_toConsumableArray(arr))'), -1, 'The <code>copyMachine</code> function should utilize the <code>spread operator</code> with array <code>arr</code>');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -443,7 +435,6 @@
"testString": "assert.notStrictEqual(spreadOut.toString().search(/[...]/), -1, 'The <code>spreadOut</code> function should utilize spread syntax');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -500,7 +491,6 @@
"testString": "assert.notStrictEqual(quickCheck.toString().search(/\\.indexOf\\(/), -1, 'The <code>quickCheck</code> function should utilize the <code>indexOf()</code> method');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -558,7 +548,6 @@
"testString": "assert.notStrictEqual(filteredArray.toString().search(/for/), -1, 'The <code>filteredArray</code> function should utilize a <code>for</code> loop');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -622,7 +611,6 @@
"testString": "assert((function howDeep(array, target, depth = 0) {return array.reduce((combined, current) => {if (Array.isArray(current)) { return combined.concat(howDeep(current, target, depth + 1));} else if (current === target) { return combined.concat(depth);} else { return combined;}}, []);})(myNestedArray, 'deepest').length === 1 && (function howDeep(array, target, depth = 0) {return array.reduce((combined, current) => {if (Array.isArray(current)) { return combined.concat(howDeep(current, target, depth + 1));} else if (current === target) { return combined.concat(depth);} else { return combined;}}, []);})(myNestedArray, 'deepest')[0] === 4, '<code>myNestedArray</code> should contain exactly one occurrence of the string <code>\"deepest\"</code> on an array nested 5 levels deep');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -684,7 +672,6 @@
"testString": "assert(code.search(/bananas:/) === -1 && code.search(/grapes:/) === -1 && code.search(/strawberries:/) === -1, 'The key-value pairs should be set using dot or bracket notation');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -740,7 +727,6 @@
"testString": "assert.strictEqual(code.search(/online: 45/), -1, 'The <code>online</code> property is set using dot or bracket notation');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -803,7 +789,6 @@
"testString": "assert.strictEqual(checkInventory('strawberries'), 27, '<code>checkInventory(\"strawberries\")</code> should return <code>27</code>');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -858,7 +843,6 @@
"testString": "assert(code.search(/oranges:/) !== -1 && code.search(/plums:/) !== -1 && code.search(/strawberries:/) !== -1, 'The <code>oranges</code>, <code>plums</code>, and <code>strawberries</code> keys are removed using <code>delete</code>');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -912,7 +896,6 @@
"testString": "assert((function() { delete users.Alan; delete users.Jeff; delete users.Sarah; delete users.Ryan; return isEveryoneHere(users) })() === false, 'The function <code>isEveryoneHere</code> returns <code>false</code> if <code>Alan</code>, <code>Jeff</code>, <code>Sarah</code>, and <code>Ryan</code> are not properties on the <code>users</code> object');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -976,7 +959,6 @@
"testString": "assert((function() { users.Harry = {online: true}; users.Sam = {online: true}; users.Carl = {online: true}; return countOnline(users) })() === 5, 'The function <code>countOnline</code> returns the number of users with the <code>online</code> property set to <code>true</code>');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -1037,7 +1019,6 @@
"testString": "assert((function() { users.Sam = {}; users.Lewis = {}; let R = getArrayOfUsers(users); return (R.indexOf('Alan') !== -1 && R.indexOf('Jeff') !== -1 && R.indexOf('Sarah') !== -1 && R.indexOf('Ryan') !== -1 && R.indexOf('Sam') !== -1 && R.indexOf('Lewis') !== -1); })() === true, 'The <code>getArrayOfUsers</code> function returns an array which contains all the keys in the <code>users</code> object');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -1102,7 +1083,6 @@
"testString": "assert.deepEqual((function() { delete user.data.friends; user.data.friends = ['Sam', 'Kira', 'Tomo']; return addFriend(user, 'Pete') })(), ['Sam', 'Kira', 'Tomo', 'Pete'], '<code>addFriend(user, \"Pete\")</code> should return <code>[\"Sam\", \"Kira\", \"Tomo\", \"Pete\"]</code>');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,

View File

@ -31,7 +31,6 @@
"testString": "assert(code.match(/(\\/\\*)([^\\*\\/]{5,})(?=\\*\\/)/gm), 'Create a <code>/* */</code> style comment that contains at least five letters.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -98,7 +97,6 @@
"testString": "assert(/var\\s+myName\\s*;/.test(code), 'You should declare <code>myName</code> with the <code>var</code> keyword, ending with a semicolon');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -183,7 +181,6 @@
"testString": "assert(/b\\s*=\\s*a\\s*;/g.test(code), '<code>a</code> should be assigned to <code>b</code> with <code>=</code>');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -248,7 +245,6 @@
"testString": "assert(/var\\s+a\\s*=\\s*9\\s*/.test(code), 'Initialize <code>a</code> to a value of <code>9</code>');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -311,7 +307,6 @@
"testString": "assert(/a = a \\+ 1;/.test(code) && /b = b \\+ 5;/.test(code) && /c = c \\+ \" String!\";/.test(code), 'Do not change code below the line');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -391,7 +386,6 @@
"testString": "assert(code.match(/titleCaseOver/g).length === 2, '<code>titleCaseOver</code> should use camelCase in both declaration and assignment sections.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -454,7 +448,6 @@
"testString": "assert(/\\+/.test(code), 'Use the <code>+</code> operator');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -508,7 +501,6 @@
"testString": "assert(/var\\s*difference\\s*=\\s*45\\s*-\\s*[0-9]*;(?!\\s*[a-zA-Z0-9]+)/.test(code),'Only subtract one number from 45.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -563,7 +555,6 @@
"testString": "assert(/\\*/.test(code), 'Use the <code>*</code> operator');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -618,7 +609,6 @@
"testString": "assert(/\\d+\\s*\\/\\s*\\d+/.test(code), 'Use the <code>/</code> operator');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -682,7 +672,6 @@
"testString": "assert(/var myVar = 87;/.test(code), 'Do not change code above the line');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -751,7 +740,6 @@
"testString": "assert(/var myVar = 11;/.test(code), 'Do not change code above the line');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -808,7 +796,6 @@
"testString": "assert(myDecimal % 1 != 0, '<code>myDecimal</code> should have a decimal point'); "
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -862,7 +849,6 @@
"testString": "assert(/\\*/.test(code), 'You should use the <code>*</code> operator');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -915,7 +901,6 @@
"testString": "assert(code.match(/quotient/g).length === 1, 'The quotient variable should only be assigned once');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -975,7 +960,6 @@
"testString": "assert(/\\s+?remainder\\s*?=\\s*?.*%.*;/.test(code), 'You should use the <code>%</code> operator');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -1048,7 +1032,6 @@
"testString": "assert(/var a = 3;/.test(code) && /var b = 17;/.test(code) && /var c = 12;/.test(code), 'Do not modify the code above the line');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -1125,7 +1108,6 @@
"testString": "assert(/var a = 11;/.test(code) && /var b = 9;/.test(code) && /var c = 3;/.test(code), 'Do not modify the code above the line');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -1202,7 +1184,6 @@
"testString": "assert(/var a = 5;/.test(code) && /var b = 12;/.test(code) && /var c = 4\\.6;/.test(code), 'Do not modify the code above the line');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -1279,7 +1260,6 @@
"testString": "assert(/var a = 48;/.test(code) && /var b = 108;/.test(code) && /var c = 33;/.test(code), 'Do not modify the code above the line');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -1341,7 +1321,6 @@
"testString": "assert((function(){if(typeof myLastName !== \"undefined\" && typeof myLastName === \"string\" && myLastName.length > 0){return true;}else{return false;}})(), '<code>myLastName</code> should be a string with at least one character in it.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -1400,7 +1379,6 @@
"testString": "assert(myStr === \"I am a \\\"double quoted\\\" string inside \\\"double quotes\\\".\", 'Variable myStr should contain the string: <code>I am a \"double quoted\" string inside \"double quotes\".</code>');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -1470,7 +1448,6 @@
"testString": "assert(code.match(/\"/g).length === 4 && code.match(/'/g).length === 2, 'You should have two single quotes <code>&#39;</code> and four double quotes <code>&quot;</code>');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -1546,7 +1523,6 @@
"testString": "assert(/SecondLine\\nThirdLine/.test(myStr), 'There should be a newline character between <code>SecondLine</code> and <code>ThirdLine</code>');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -1612,7 +1588,6 @@
"testString": "assert(/myStr\\s*=/.test(code), 'Make sure to assign the result to the <code>myStr</code> variable.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -1678,7 +1653,6 @@
"testString": "assert(code.match(/\\w\\s*\\+=\\s*[\"']/g).length > 1 && code.match(/\\w\\s*\\=\\s*[\"']/g).length > 1, 'Use the <code>+=</code> operator to build <code>myStr</code>');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -1742,7 +1716,6 @@
"testString": "assert(code.match(/[\"']\\s*\\+\\s*myName\\s*\\+\\s*[\"']/g).length > 0, 'Use two <code>+</code> operators to build <code>myStr</code> with <code>myName</code> inside it');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -1812,7 +1785,6 @@
"testString": "assert(code.match(/myStr\\s*\\+=\\s*someAdjective\\s*/).length > 0, 'Append <code>someAdjective</code> to <code>myStr</code> using the <code>+=</code> operator');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -1885,7 +1857,6 @@
"testString": "assert((function(){if(code.match(/\\.length/gi) && code.match(/\\.length/gi).length >= 2 && code.match(/var lastNameLength \\= 0;/gi) && code.match(/var lastNameLength \\= 0;/gi).length >= 1){return true;}else{return false;}})(), 'You should be getting the length of <code>lastName</code> by using <code>.length</code> like this: <code>lastName.length</code>.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -1950,7 +1921,6 @@
"testString": "assert(code.match(/firstLetterOfLastName\\s*?=\\s*?lastName\\[.*?\\]/), 'You should use bracket notation.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -2018,7 +1988,6 @@
"testString": "assert(/myStr = \"Jello World\"/.test(code), 'Do not change the code above the line');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -2079,7 +2048,6 @@
"testString": "assert(code.match(/thirdLetterOfLastName\\s*?=\\s*?lastName\\[.*?\\]/), 'You should use bracket notation.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -2141,7 +2109,6 @@
"testString": "assert(code.match(/\\.length/g).length === 2, 'You have to use <code>.length</code> to get the last letter.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -2203,7 +2170,6 @@
"testString": "assert(code.match(/\\.length/g).length === 2, 'You have to use <code>.length</code> to get the second last letter.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -2273,7 +2239,6 @@
"testString": "assert(/\\bcat\\b/.test(test2) && /\\blittle\\b/.test(test2) && /\\bhit\\b/.test(test2) && /\\bslowly\\b/.test(test2),'<code>wordBlanks(\"cat\", \"little\", \"hit\", \"slowly\")</code> should contain all of the passed in words separated by non-word characters (and any additional words in your madlib).');"
}
],
"type": "checkpoint",
"challengeType": 1,
"translations": {
"es": {
@ -2339,7 +2304,6 @@
"testString": "assert(typeof myArray[1] !== 'undefined' && typeof myArray[1] == 'number', 'The second item in <code>myArray</code> should be a <code>number</code>.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -2390,7 +2354,6 @@
"testString": "assert(Array.isArray(myArray) && myArray.some(Array.isArray), '<code>myArray</code> should have at least one array nested within another array.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -2447,7 +2410,6 @@
"testString": "assert((function(){if(code.match(/\\s*=\\s*myArray\\[0\\]/g)){return true;}else{return false;}})(), 'The data in variable <code>myArray</code> should be accessed using bracket notation.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -2512,7 +2474,6 @@
"testString": "assert((function(){if(code.match(/myArray\\[0\\]\\s*=\\s*/g)){return true;}else{return false;}})(), 'You should be using correct index to modify the value in <code>myArray</code>.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -2576,7 +2537,6 @@
"testString": "assert(/myArray\\[2\\]\\[1\\]/g.test(code) && !/myData\\s*=\\s*(?:.*[-+*/%]|\\d)/g.test(code), 'You should be using bracket notation to read the correct value from <code>myArray</code>.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -2630,7 +2590,6 @@
"testString": "assert((function(d){if(d[2] != undefined && d[0][0] == 'John' && d[0][1] === 23 && d[2][0] == 'dog' && d[2][1] === 3 && d[2].length == 2){return true;}else{return false;}})(myArray), '<code>myArray</code> should now equal <code>[[\"John\", 23], [\"cat\", 2], [\"dog\", 3]]</code>.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -2695,7 +2654,6 @@
"testString": "assert((function(d){if(d[0] == 'cat' && d[1] === 2 && d[2] == undefined){return true;}else{return false;}})(removedFromMyArray), '<code>removedFromMyArray</code> should only contain <code>[\"cat\", 2]</code>.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -2757,7 +2715,6 @@
"testString": "assert((function(d){if(d[0] == 'John' && d[1] === 23 && typeof removedFromMyArray === 'object'){return true;}else{return false;}})(removedFromMyArray), '<code>removedFromMyArray</code> should contain <code>[\"John\", 23]</code>.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -2814,7 +2771,6 @@
"testString": "assert((function(d){if(typeof d[0] === \"object\" && d[0][0] == 'Paul' && d[0][1] === 35 && d[1][0] != undefined && d[1][0] == 'dog' && d[1][1] != undefined && d[1][1] == 3){return true;}else{return false;}})(myArray), '<code>myArray</code> should now have [[\"Paul\", 35], [\"dog\", 3]].');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -2885,7 +2841,6 @@
"testString": "assert(count > 4, 'You must have at least 5 items in your list');"
}
],
"type": "checkpoint",
"challengeType": 1,
"translations": {
"es": {
@ -2970,7 +2925,6 @@
"testString": "assert(/^\\s*reusableFunction\\(\\)\\s*;/m.test(code), 'Call <code>reusableFunction</code> after you define it');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -3073,7 +3027,6 @@
"testString": "assert(/^\\s*functionWithArgs\\s*\\(\\s*\\d+\\s*,\\s*\\d+\\s*\\)\\s*;/m.test(code), 'Call <code>functionWithArgs</code> with two numbers after you define it.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -3172,7 +3125,6 @@
"testString": "assert(typeof oopsGlobal != \"undefined\" && oopsGlobal === 5, '<code>oopsGlobal</code> should be a global variable and have a value of <code>5</code>');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -3269,7 +3221,6 @@
"testString": "assert(/var\\s+myVar/.test(code), 'Add a local <code>myVar</code> variable');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -3361,7 +3312,6 @@
"testString": "assert(/return outerWear/.test(code), 'Do not change the return statement');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -3438,7 +3388,6 @@
"testString": "assert(timesFive(0) === 0, '<code>timesFive(0)</code> should return <code>0</code>');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -3508,7 +3457,6 @@
"testString": "assert(code.match(/(sum\\s*\\=\\s*sum\\s*\\+\\s*5)|(sum\\s*\\+\\=\\s*5)/g).length === 1, 'Inside of your functions, add 5 to the <code>sum</code> variable');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {},
"files": {
@ -3565,7 +3513,6 @@
"testString": "assert(/processed\\s*=\\s*processArg\\(\\s*7\\s*\\)\\s*;/.test(code), 'You should assign <code>processArg</code> to <code>processed</code>');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -3649,7 +3596,6 @@
"testString": "nextInLine(testArr, 10); assert(testArr[4] === 10, 'After <code>nextInLine(testArr, 10)</code>, <code>testArr[4]</code> should be <code>10</code>');"
}
],
"type": "checkpoint",
"challengeType": 1,
"translations": {
"es": {
@ -3732,7 +3678,6 @@
"testString": "assert(welcomeToBooleans() === true, '<code>welcomeToBooleans()</code> should return true.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -3806,7 +3751,6 @@
"testString": "assert(trueOrFalse(false) === \"No, that was false\", '<code>trueOrFalse(false)</code> should return \"No, that was false\"');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -3894,7 +3838,6 @@
"testString": "assert(code.match(/==/g) && !code.match(/===/g), 'You should use the <code>==</code> operator');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -3967,7 +3910,6 @@
"testString": "assert(code.match(/(val\\s*===\\s*\\d+)|(\\d+\\s*===\\s*val)/g).length > 0, 'You should use the <code>===</code> operator');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -4035,7 +3977,6 @@
"testString": "assert(code.match(/===/g), 'You should use the <code>===</code> operator');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {},
"files": {
@ -4100,7 +4041,6 @@
"testString": "assert(code.match(/(?!!==)!=/), 'You should use the <code>!=</code> operator');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -4175,7 +4115,6 @@
"testString": "assert(code.match(/(val\\s*!==\\s*\\d+)|(\\d+\\s*!==\\s*val)/g).length > 0, 'You should use the <code>!==</code> operator');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -4265,7 +4204,6 @@
"testString": "assert(code.match(/val\\s*>\\s*('|\")*\\d+('|\")*/g).length > 1, 'You should use the <code>&gt;</code> operator at least twice');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -4355,7 +4293,6 @@
"testString": "assert(code.match(/val\\s*>=\\s*('|\")*\\d+('|\")*/g).length > 1, 'You should use the <code>&gt;=</code> operator at least twice');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -4440,7 +4377,6 @@
"testString": "assert(code.match(/val\\s*<\\s*('|\")*\\d+('|\")*/g).length > 1, 'You should use the <code>&lt;</code> operator at least twice');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -4528,7 +4464,6 @@
"testString": "assert(code.match(/val\\s*<=\\s*('|\")*\\d+('|\")*/g).length > 1, 'You should use the <code>&lt;=</code> operator at least twice');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -4627,7 +4562,6 @@
"testString": "assert(testLogicalAnd(80) === \"No\", '<code>testLogicalAnd(80)</code> should return \"No\"');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -4729,7 +4663,6 @@
"testString": "assert(testLogicalOr(25) === \"Outside\", '<code>testLogicalOr(25)</code> should return \"Outside\"');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -4817,7 +4750,6 @@
"testString": "assert(/var result = \"\";/.test(code) && /return result;/.test(code), 'Do not change the code above or below the lines.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -4904,7 +4836,6 @@
"testString": "assert(testElseIf(12) === \"Greater than 10\", '<code>testElseIf(12)</code> should return \"Greater than 10\"');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -4977,7 +4908,6 @@
"testString": "assert(orderMyLogic(11) === \"Greater than or equal to 10\", '<code>orderMyLogic(11)</code> should return \"Greater than or equal to 10\"');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -5089,7 +5019,6 @@
"testString": "assert(testSize(25) === \"Huge\", '<code>testSize(25)</code> should return \"Huge\"');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -5184,7 +5113,6 @@
"testString": "assert(golfScore(5, 9) === \"Go Home!\", '<code>golfScore(5, 9)</code> should return \"Go Home!\"');"
}
],
"type": "checkpoint",
"challengeType": 1,
"translations": {
"es": {
@ -5261,7 +5189,6 @@
"testString": "assert(code.match(/break/g).length > 2, 'You should have at least 3 <code>break</code> statements');"
}
],
"type": "waypoint",
"MDNlinks": [
"Switch Statement"
],
@ -5352,7 +5279,6 @@
"testString": "assert(code.match(/break/g).length > 2, 'You should have at least 3 <code>break</code> statements');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -5453,7 +5379,6 @@
"testString": "assert(code.match(/case/g).length === 9, 'You should have nine <code>case</code> statements');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -5550,7 +5475,6 @@
"testString": "assert(chainToSwitch(156) === \"\", '<code>chainToSwitch(156)</code> should be \"\" (empty string)');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -5630,7 +5554,6 @@
"testString": "assert(!/if|else/g.test(code), 'You should not use any <code>if</code> or <code>else</code> statements');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -5711,7 +5634,6 @@
"testString": "assert(abTest(3,3) === 12 , '<code>abTest(3,3)</code> should return <code>12</code>');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -5797,7 +5719,6 @@
"testString": "assert((function(){ count = 0; cc(3);cc(2);cc('A');cc(10);var out = cc('K'); if(out === \"-1 Hold\") {return true;} return false; })(), 'Cards Sequence 3, 2, A, 10, K should return <code>-1 Hold</code>');"
}
],
"type": "checkpoint",
"challengeType": 1,
"translations": {
"es": {
@ -5877,7 +5798,6 @@
"testString": "assert((function(z){return Object.keys(z).length === 4;})(myDog), '<code>myDog</code> should only contain all the given properties.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -5965,7 +5885,6 @@
"testString": "assert(code.match(/testObj\\.\\w+/g).length > 1, 'You should use dot notation twice');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -6043,7 +5962,6 @@
"testString": "assert(code.match(/testObj\\s*?\\[('|\")[^'\"]+\\1\\]/g).length > 1, 'You should use bracket notation twice');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -6127,7 +6045,6 @@
"testString": "assert(/testObj\\s*?\\[\\s*playerNumber\\s*\\]/.test(code),'You should be using the variable <code>playerNumber</code> in your bracket notation');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -6197,7 +6114,6 @@
"testString": "assert(/\"name\": \"Coder\"/.test(code), 'Do not edit the <code>myDog</code> definition');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -6280,7 +6196,6 @@
"testString": "assert(!/bark[^\\n]:/.test(code), 'Do not add <code>\"bark\"</code> to the setup section');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -6351,7 +6266,6 @@
"testString": "assert(code.match(/\"tails\": 1/g).length > 1, 'Do not modify the <code>myDog</code> setup');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -6453,7 +6367,6 @@
"testString": "assert(!/case|switch|if/g.test(code), 'You should not use <code>case</code>, <code>switch</code>, or <code>if</code> statements'); "
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -6538,7 +6451,6 @@
"testString": "assert(checkObj(\"house\") === \"Not Found\", '<code>checkObj(\"house\")</code> should return <code>\"Not Found\"</code>.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -6636,7 +6548,6 @@
"testString": "assert(myMusic[1].formats.every(function(item) { return (typeof item === \"string\")}) && myMusic[1].formats.length > 1, '<code>formats</code> should be an array of strings with at least two elements');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -6705,7 +6616,6 @@
"testString": "assert(/=\\s*myStorage\\.car\\.inside\\[\\s*(\"|')glove box\\1\\s*\\]/g.test(code), 'Use dot and bracket notation to access <code>myStorage</code>');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -6778,7 +6688,6 @@
"testString": "assert(/=\\s*myPlants\\[1\\].list\\[1\\]/.test(code), 'Use dot and bracket notation to access <code>myPlants</code>');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -6886,7 +6795,6 @@
"testString": "assert(updateRecords(1245, \"album\", \"Riptide\")[1245][\"album\"] === \"Riptide\", 'After <code>updateRecords(1245, \"album\", \"Riptide\")</code>, <code>album</code> should be <code>\"Riptide\"</code>');"
}
],
"type": "checkpoint",
"challengeType": 1,
"translations": {
"es": {
@ -6980,7 +6888,6 @@
"testString": "assert.deepEqual(myArray, [0,1,2,3,4], '<code>myArray</code> should equal <code>[0,1,2,3,4]</code>.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -7050,7 +6957,6 @@
"testString": "assert.deepEqual(myArray, [1,2,3,4,5], '<code>myArray</code> should equal <code>[1,2,3,4,5]</code>.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -7126,7 +7032,6 @@
"testString": "assert.deepEqual(myArray, [1,3,5,7,9], '<code>myArray</code> should equal <code>[1,3,5,7,9]</code>.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -7202,7 +7107,6 @@
"testString": "assert.deepEqual(myArray, [9,7,5,3,1], '<code>myArray</code> should equal <code>[9,7,5,3,1]</code>.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -7281,7 +7185,6 @@
"testString": "assert(!code.match(/total[\\s\\+\\-]*=\\s*(\\d(?!\\s*[;,])|[1-9])/g), 'Do not set <code>total</code> to 20 directly');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -7351,7 +7254,6 @@
"testString": "assert(multiplyAll([[5,1],[0.2, 4, 0.5],[3, 9]]) === 54, '<code>multiplyAll([[5,1],[0.2, 4, 0.5],[3, 9]])</code> should return <code>54</code>');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -7424,7 +7326,6 @@
"testString": "assert.deepEqual(i, 11, '<code>i</code> should equal <code>11</code>');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {},
"files": {
@ -7493,7 +7394,6 @@
"testString": "assert(lookUpProfile(\"Akira\", \"address\") === \"No such property\", '<code>\"Akira\", \"address\"</code> should return \"No such property\"');"
}
],
"type": "checkpoint",
"challengeType": 1,
"translations": {
"es": {
@ -7585,7 +7485,6 @@
"testString": "assert(code.match(/Math\\.random/g).length >= 0, 'You should be using <code>Math.random</code> to generate the random decimal number.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -7655,7 +7554,6 @@
"testString": "assert(code.match(/Math.floor/g).length > 1, 'You should use <code>Math.floor</code> to remove the decimal part of the number.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -7729,7 +7627,6 @@
"testString": "assert((function(){if(code.match(/myMax/g).length > 1 && code.match(/myMin/g).length > 2 && code.match(/Math.floor/g) && code.match(/Math.random/g)){return true;}else{return false;}})(), '<code>randomRange</code> should use both <code>myMax</code> and <code>myMin</code>, and return a random number in your range.');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {
"es": {
@ -7823,7 +7720,6 @@
"testString": "assert.isNaN(convertToInteger(\"JamesBond\"), '<code>convertToInteger(\"JamesBond\")</code> should return NaN');"
}
],
"type": "waypoint",
"challengeType": 1,
"translations": {},
"releasedOn": "February 17, 2017",
@ -7880,7 +7776,6 @@
"testString": "assert.isNaN(convertToInteger(\"JamesBond\"), '<code>convertToInteger(\"JamesBond\")</code> should return NaN');"
}
],
"type": "waypoint",
"challengeType": 1,
"releasedOn": "February 17, 2017",
"translations": {},
@ -7934,7 +7829,6 @@
"testString": "assert(checkEqual(1, -1) === false, '<code>checkEqual(1, -1)</code> should return false');"
}
],
"type": "waypoint",
"challengeType": 1,
"releasedOn": "February 17, 2017",
"translations": {},
@ -7986,7 +7880,6 @@
"testString": "assert(checkSign(0) === 'zero', '<code>checkSign(0)</code> should return \"zero\". Note that capitalization matters');"
}
],
"type": "waypoint",
"challengeType": 1,
"releasedOn": "February 17, 2017",
"translations": {},

View File

@ -24,7 +24,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -78,7 +77,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -133,7 +131,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -187,7 +184,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -228,7 +224,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -272,7 +267,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -314,7 +308,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -363,7 +356,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -407,7 +399,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -461,7 +452,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -513,7 +503,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -571,7 +560,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},

View File

@ -37,7 +37,6 @@
"testString": "assert(quote === \"Oliver says Meow!\", '<code>quote</code> should be <code>\"Oliver says Meow!\"</code>');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -96,7 +95,6 @@
"testString": "assert(checkScope() === \"function scope\", '<code>checkScope()</code> should return \"function scope\"');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -147,7 +145,6 @@
"testString": "getUserInput => assert(getUserInput('index').match(/(let i)/g), '<code>i</code> should be a variable only defined within the for loop scope (by using<code>let</code>).');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -207,7 +204,6 @@
"testString": "assert.deepEqual(s, [2, 5, 7], '<code>s</code> should be equal to <code>[2, 5, 7]</code>.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -261,7 +257,6 @@
"testString": "assert(PI === 3.14, '<code>PI</code> equals <code>3.14</code>.');"
}
],
"type": "waypoint",
"releasedOn": "Aug 12, 2017",
"challengeType": 1,
"translations": {},
@ -331,7 +326,6 @@
"testString": "getUserInput => assert(!getUserInput('index').match(/function/g), '<code>function</code> keyword was not used.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -383,7 +377,6 @@
"testString": "getUserInput => assert(!getUserInput('index').match(/function/g), '<code>function</code> keyword was not used.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -449,7 +442,6 @@
"testString": "getUserInput => assert(getUserInput('index').match(/map|filter|reduce/g), '<code>map</code>, <code>filter</code>, or <code>reduce</code> should be used');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -501,7 +493,6 @@
"testString": "getUserInput => assert(getUserInput('index').match(/value\\s*=\\s*1/g), 'default parameter <code>1</code> was used for <code>value</code>.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -558,7 +549,6 @@
"testString": "getUserInput => assert(getUserInput('index').match(/function\\s+sum\\s*\\(\\s*...args\\s*\\)\\s*{/g), 'The <code>sum</code> function uses the <code>...</code> spread operator on the <code>args</code> parameter.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -612,7 +602,6 @@
"testString": "assert((arr1, arr2) => {arr1.push('JUN'); return arr2.length < arr1.length},'<code>arr2</code> remains unchanged when <code>arr1</code> is changed.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -665,7 +654,6 @@
"testString": "getUserInput => assert(getUserInput('index').match(/\\{\\s*length\\s*:\\s*len\\s*}\\s*=\\s*str/g),'destructuring with reassignment was used');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -714,7 +702,6 @@
"testString": "getUserInput => assert(getUserInput('index').match(/\\{\\s*tomorrow\\s*:\\s*\\{\\s*max\\s*:\\s*maxOfTomorrow\\s*\\}\\s*\\}\\s*=\\s*forecast/g),'nested destructuring was used');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -772,7 +759,6 @@
"testString": "// assert(/\\[\\s*(\\w)\\s*,\\s*(\\w)\\s*\\]\\s*=\\s*\\[\\s*\\2\\s*,\\s*\\1\\s*\\]/g.test(code), 'Use array destructuring to swap a and b.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -823,7 +809,6 @@
"testString": "getUserInput => assert(!getUserInput('index').match(/Array.slice/g), '<code>Array.slice()</code> was not used.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -878,7 +863,6 @@
"testString": "getUserInput => assert(getUserInput('index').match(/\\(\\s*\\{\\s*\\w+\\s*,\\s*\\w+\\s*\\}\\s*\\)/g), 'Destructuring was used.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -943,7 +927,6 @@
"testString": "getUserInput => assert(getUserInput('index').match(/\\`<li class=\"text-warning\">\\$\\{\\w+\\}<\\/li>\\`/g), 'Template strings were used');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1004,7 +987,6 @@
"testString": "getUserInput => assert(!getUserInput('index').match(/:/g), 'No <code>:</code> were used.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1052,7 +1034,6 @@
"testString": "getUserInput => assert(!getUserInput('index').match(/:\\s*function\\s*\\(\\)/g), 'Declarative function was used.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1108,7 +1089,6 @@
"testString": "assert(() => {const a = new Vegetable(\"apple\"); return typeof a === 'object';},'<code>Vegetable</code> can be instantiated.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1168,7 +1148,6 @@
"testString": "assert(() => {const t = new Thermostat(32); return typeof t === 'object' && t.temperature === 0;}, '<code>Thermostat</code> can be instantiated.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1219,7 +1198,6 @@
"testString": "getUserInput => assert(getUserInput('index').match(/import\\s+\\{\\s?capitalizeString\\s?\\}\\s+from\\s+\"string_functions\"/g), 'valid <code>import</code> statement');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1266,7 +1244,6 @@
"testString": "getUserInput => assert(getUserInput('index').match(/export\\s+const\\s+boo\\s+=+\\s\"far\"/g), '<code>bar</code> is exported.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1306,7 +1283,6 @@
"testString": "assert(code.match(/import\\s+\\*\\s+as\\s+[a-zA-Z0-9_$]+\\s+from\\s*\"\\s*capitalize_strings\\s*\"\\s*;/gi), 'Properly uses <code>import * as</code> syntax.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1348,7 +1324,6 @@
"testString": "getUserInput => assert(getUserInput('index').match(/export\\s+default\\s+function\\s+subtract\\(x,y\\)\\s+{return\\s+x\\s-\\s+y;}/g), 'Proper used of <code>export</code> fallback.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1385,7 +1360,6 @@
"testString": "getUserInput => assert(getUserInput('index').match(/import\\s+subtract\\s+from\\s+\"math_functions\"/g), 'Properly imports <code>export default</code> method.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},

View File

@ -30,7 +30,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"challengeType": 1,
"translations": {},
"files": {
@ -109,7 +108,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"challengeType": 1,
"translations": {},
"files": {
@ -188,7 +186,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"challengeType": 1,
"translations": {},
"files": {
@ -266,7 +263,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"challengeType": 1,
"translations": {},
"files": {
@ -323,7 +319,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"challengeType": 1,
"translations": {},
"files": {
@ -385,7 +380,6 @@
"Consider using the concat method instead of push.",
"The slice method returns a new array without modifying the original."
],
"type": "waypoint",
"challengeType": 1,
"translations": {},
"files": {
@ -464,7 +458,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"challengeType": 1,
"translations": {},
"files": {
@ -626,7 +619,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"challengeType": 1,
"translations": {},
"files": {
@ -685,7 +677,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"challengeType": 1,
"translations": {},
"files": {
@ -842,7 +833,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"challengeType": 1,
"translations": {},
"files": {
@ -906,7 +896,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"challengeType": 1,
"translations": {},
"files": {
@ -960,7 +949,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"challengeType": 1,
"translations": {},
"files": {
@ -1012,7 +1000,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"challengeType": 1,
"translations": {},
"files": {
@ -1071,7 +1058,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"challengeType": 1,
"translations": {},
"files": {
@ -1130,7 +1116,6 @@
"Try using .map() to return an array of ratings.",
"You can use Number() to convert a string into a number."
],
"type": "waypoint",
"challengeType": 1,
"translations": {},
"files": {
@ -1297,7 +1282,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"challengeType": 1,
"translations": {},
"files": {
@ -1347,7 +1331,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"challengeType": 1,
"translations": {},
"files": {
@ -1403,7 +1386,6 @@
"hints": [
"The regex pre-defined character class for non-alphanumerics is \\W."
],
"type": "waypoint",
"challengeType": 1,
"translations": {},
"files": {
@ -1465,7 +1447,6 @@
"hints": [
"First try to split the given string before applying the join method."
],
"type": "waypoint",
"challengeType": 1,
"translations": {},
"files": {
@ -1532,7 +1513,6 @@
"When several spaces in a row are split by space, it puts an empty string in the array.",
"You can use the .toLowerCase() method to make the title all lower case."
],
"type": "waypoint",
"challengeType": 1,
"translations": {},
"files": {
@ -1588,7 +1568,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"challengeType": 1,
"translations": {},
"files": {
@ -1640,7 +1619,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"challengeType": 1,
"translations": {},
"files": {
@ -1698,7 +1676,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"challengeType": 1,
"translations": {},
"files": {

View File

@ -42,7 +42,6 @@
"testString": "assert.deepEqual(sumAll([10, 5]), 45, '<code>sumAll([10, 5])</code> should return 45.');"
}
],
"type": "bonfire",
"MDNlinks": [
"Math.max()",
"Math.min()",
@ -158,7 +157,6 @@
"testString": "assert(diffArray([1, \"calf\", 3, \"piglet\"], [7, \"filly\"]).length === 6, '<code>[1, \"calf\", 3, \"piglet\"], [7, \"filly\"]</code> should return an array with six items.');"
}
],
"type": "bonfire",
"MDNlinks": [
"Comparison Operators",
"Array.prototype.slice()",
@ -237,7 +235,6 @@
"testString": "assert.deepEqual(destroyer([\"possum\", \"trollo\", 12, \"safari\", \"hotdog\", 92, 65, \"grandma\", \"bugati\", \"trojan\", \"yacht\"], \"yacht\", \"possum\", \"trollo\", \"safari\", \"hotdog\", \"grandma\", \"bugati\", \"trojan\"), [12,92,65], '<code>destroyer([\"possum\", \"trollo\", 12, \"safari\", \"hotdog\", 92, 65, \"grandma\", \"bugati\", \"trojan\", \"yacht\"], \"yacht\", \"possum\", \"trollo\", \"safari\", \"hotdog\", \"grandma\", \"bugati\", \"trojan\")</code> should return <code>[12,92,65]</code>.');"
}
],
"type": "bonfire",
"isRequired": true,
"solutions": [
"function destroyer(arr) {\n var hash = Object.create(null);\n [].slice.call(arguments, 1).forEach(function(e) {\n hash[e] = true;\n });\n // Remove all the values\n return arr.filter(function(e) { return !(e in hash);});\n}\n\ndestroyer([1, 2, 3, 1, 2, 3], 2, 3);\n"
@ -319,7 +316,6 @@
"testString": "assert.deepEqual(whatIsInAName([{ \"a\": 1, \"b\": 2, \"c\": 3 }], { \"a\": 1, \"b\": 9999, \"c\": 3 }), [], '<code>whatIsInAName([{\"a\": 1, \"b\": 2, \"c\": 3}], {\"a\": 1, \"b\": 9999, \"c\": 3})</code> should return <code>[]</code>');"
}
],
"type": "bonfire",
"MDNlinks": [
"Global Object",
"Object.prototype.hasOwnProperty()",
@ -400,7 +396,6 @@
"testString": "assert.strictEqual(spinalCase(\"AllThe-small Things\"), \"all-the-small-things\", '<code>spinalCase(\"AllThe-small Things\")</code> should return <code>\"all-the-small-things\"</code>.');"
}
],
"type": "bonfire",
"MDNlinks": [
"RegExp",
"String.prototype.replace()"
@ -485,7 +480,6 @@
"testString": "assert.deepEqual(translatePigLatin(\"rhythm\"), \"rhythmay\", 'Should handle words without vowels.');"
}
],
"type": "bonfire",
"MDNlinks": [
"Array.prototype.indexOf()",
"Array.prototype.push()",
@ -570,7 +564,6 @@
"testString": "assert.deepEqual(myReplace(\"Let us get back to more Coding\", \"Coding\", \"algorithms\"), \"Let us get back to more Algorithms\", '<code>myReplace(\"Let us get back to more Coding\", \"Coding\", \"algorithms\")</code> should return \"Let us get back to more Algorithms\".');"
}
],
"type": "bonfire",
"MDNlinks": [
"Array.prototype.splice()",
"String.prototype.replace()",
@ -647,7 +640,6 @@
"testString": "assert.deepEqual(pairElement(\"CTCTA\"),[[\"C\",\"G\"],[\"T\",\"A\"],[\"C\",\"G\"],[\"T\",\"A\"],[\"A\",\"T\"]], '<code>pairElement(\"CTCTA\")</code> should return <code>[[\"C\",\"G\"],[\"T\",\"A\"],[\"C\",\"G\"],[\"T\",\"A\"],[\"A\",\"T\"]]</code>.');"
}
],
"type": "bonfire",
"MDNlinks": [
"Array.prototype.push()",
"String.prototype.split()"
@ -728,7 +720,6 @@
"testString": "assert.isUndefined(fearNotLetter('abcdefghijklmnopqrstuvwxyz'), '<code>fearNotLetter(\"abcdefghijklmnopqrstuvwxyz\")</code> should return undefined.');"
}
],
"type": "bonfire",
"MDNlinks": [
"String.prototype.charCodeAt()",
"String.fromCharCode()"
@ -801,7 +792,6 @@
"testString": "assert.deepEqual(uniteUnique([1, 2, 3], [5, 2, 1, 4], [2, 1], [6, 7, 8]), [1, 2, 3, 5, 4, 6, 7, 8], '<code>uniteUnique([1, 2, 3], [5, 2, 1, 4], [2, 1], [6, 7, 8])</code> should return <code>[1, 2, 3, 5, 4, 6, 7, 8]</code>.');"
}
],
"type": "bonfire",
"MDNlinks": [
"Arguments object",
"Array.prototype.reduce()"
@ -887,7 +877,6 @@
"testString": "assert.strictEqual(convertHTML('abc'), 'abc', '<code>convertHTML(\"abc\")</code> should return <code>abc</code>.');"
}
],
"type": "bonfire",
"MDNlinks": [
"RegExp",
"HTML Entities",
@ -967,7 +956,6 @@
"testString": "assert(sumFibs(75025) === 135721, '<code>sumFibs(75025)</code> should return 135721.');"
}
],
"type": "bonfire",
"MDNlinks": [
"Remainder"
],
@ -1036,7 +1024,6 @@
"testString": "assert.deepEqual(sumPrimes(977), 73156, '<code>sumPrimes(977)</code> should return 73156.');"
}
],
"type": "bonfire",
"MDNlinks": [
"For Loops",
"Array.prototype.push()"
@ -1118,7 +1105,6 @@
"testString": "assert.deepEqual(smallestCommons([23, 18]), 6056820, '<code>smallestCommons([23, 18])</code> should return 6056820.');"
}
],
"type": "bonfire",
"MDNlinks": [
"Smallest Common Multiple"
],
@ -1199,7 +1185,6 @@
"testString": "assert.deepEqual(dropElements([1, 2, 3, 9, 2], function(n) {return n > 2;}), [3, 9, 2], '<code>dropElements([1, 2, 3, 9, 2], function(n) {return n > 2;})</code> should return <code>[3, 9, 2]</code>.');"
}
],
"type": "bonfire",
"MDNlinks": [
"Arguments object",
"Array.prototype.shift()",
@ -1271,7 +1256,6 @@
"testString": "assert.deepEqual(steamrollArray([1, {}, [3, [[4]]]]), [1, {}, 3, 4], '<code>steamrollArray([1, {}, [3, [[4]]]])</code> should return <code>[1, {}, 3, 4]</code>.');"
}
],
"type": "bonfire",
"MDNlinks": [
"Array.isArray()"
],
@ -1332,7 +1316,6 @@
"testString": "assert.deepEqual(binaryAgent('01001001 00100000 01101100 01101111 01110110 01100101 00100000 01000110 01110010 01100101 01100101 01000011 01101111 01100100 01100101 01000011 01100001 01101101 01110000 00100001'), \"I love FreeCodeCamp!\", '<code>binaryAgent(\"01001001 00100000 01101100 01101111 01110110 01100101 00100000 01000110 01110010 01100101 01100101 01000011 01101111 01100100 01100101 01000011 01100001 01101101 01110000 00100001\")</code> should return \"I love FreeCodeCamp!\"');"
}
],
"type": "bonfire",
"MDNlinks": [
"String.prototype.charCodeAt()",
"String.fromCharCode()"
@ -1426,7 +1409,6 @@
}
],
"isRequired": true,
"type": "bonfire",
"MDNlinks": [
"Truthy",
"Falsy"
@ -1505,7 +1487,6 @@
"testString": "assert.isUndefined(addTogether(2)([3]), '<code>addTogether(2)([3])</code> should return undefined.');"
}
],
"type": "bonfire",
"MDNlinks": [
"Closures",
"Arguments object"
@ -1620,7 +1601,6 @@
"testString": "assert.strictEqual((function () { bob.setFullName(\"Haskell Curry\"); return bob.getLastName(); })(), 'Curry', '<code>bob.getLastName()</code> should return \"Curry\" after <code>bob.setFullName(\"Haskell Curry\")</code>.');"
}
],
"type": "bonfire",
"MDNlinks": [
"Closures",
"Details of the Object Model"
@ -1707,7 +1687,6 @@
"testString": "assert.deepEqual(orbitalPeriod([{name: \"iss\", avgAlt: 413.6}, {name: \"hubble\", avgAlt: 556.7}, {name: \"moon\", avgAlt: 378632.553}]), [{name : \"iss\", orbitalPeriod: 5557}, {name: \"hubble\", orbitalPeriod: 5734}, {name: \"moon\", orbitalPeriod: 2377399}], '<code>orbitalPeriod([{name: \"iss\", avgAlt: 413.6}, {name: \"hubble\", avgAlt: 556.7}, {name: \"moon\", avgAlt: 378632.553}])</code> should return <code>[{name : \"iss\", orbitalPeriod: 5557}, {name: \"hubble\", orbitalPeriod: 5734}, {name: \"moon\", orbitalPeriod: 2377399}]</code>.');"
}
],
"type": "bonfire",
"MDNlinks": [
"Math.pow()"
],

View File

@ -69,7 +69,6 @@
"testString": "assert(palindrome(\"five|\\_/|four\") === false, '<code>palindrome(\"five|\\_/|four\")</code> should return false.');"
}
],
"type": "bonfire",
"isRequired": true,
"solutions": [
"function palindrome(str) {\n var string = str.toLowerCase().split(/[^A-Za-z0-9]/gi).join('');\n var aux = string.split('');\n if (aux.join('') === aux.reverse().join('')){\n return true;\n }\n\n return false;\n}"
@ -240,7 +239,6 @@
"testString": "assert.deepEqual(convertToRoman(3999), \"MMMCMXCIX\", '<code>convertToRoman(3999)</code> should return \"MMMCMXCIX\"');"
}
],
"type": "bonfire",
"MDNlinks": [
"Roman Numerals",
"Array.prototype.splice()",
@ -315,7 +313,6 @@
"testString": "assert(rot13(\"GUR DHVPX OEBJA SBK WHZCF BIRE GUR YNML QBT.\") === \"THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.\", '<code>rot13(\"GUR DHVPX OEBJA SBK WHZCF BIRE GUR YNML QBT.\")</code> should decode to <code>THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.</code>');"
}
],
"type": "bonfire",
"MDNlinks": [
"String.prototype.charCodeAt()",
"String.fromCharCode()"
@ -487,7 +484,6 @@
"testString": "assert(telephoneCheck(\"(555)5(55?)-5555\") === false, '<code>telephoneCheck(\"(555)5(55?)-5555\")</code> should return false.');"
}
],
"type": "bonfire",
"MDNlinks": [
"RegExp"
],
@ -585,7 +581,6 @@
"testString": "assert.deepEqual(checkCashRegister(19.5, 20, [[\"PENNY\", 0.5], [\"NICKEL\", 0], [\"DIME\", 0], [\"QUARTER\", 0], [\"ONE\", 0], [\"FIVE\", 0], [\"TEN\", 0], [\"TWENTY\", 0], [\"ONE HUNDRED\", 0]]), {status: \"CLOSED\", change: [[\"PENNY\", 0.5], [\"NICKEL\", 0], [\"DIME\", 0], [\"QUARTER\", 0], [\"ONE\", 0], [\"FIVE\", 0], [\"TEN\", 0], [\"TWENTY\", 0], [\"ONE HUNDRED\", 0]]}, '<code>checkCashRegister(19.5, 20, [[\"PENNY\", 0.5], [\"NICKEL\", 0], [\"DIME\", 0], [\"QUARTER\", 0], [\"ONE\", 0], [\"FIVE\", 0], [\"TEN\", 0], [\"TWENTY\", 0], [\"ONE HUNDRED\", 0]])</code> should return <code>{status: \"CLOSED\", change: [[\"PENNY\", 0.5], [\"NICKEL\", 0], [\"DIME\", 0], [\"QUARTER\", 0], [\"ONE\", 0], [\"FIVE\", 0], [\"TEN\", 0], [\"TWENTY\", 0], [\"ONE HUNDRED\", 0]]}</code>.');"
}
],
"type": "bonfire",
"isRequired": true,
"MDNlinks": [
"Global Object",

View File

@ -35,7 +35,6 @@
"let dog = {\n name: '',\n numLegs: 4\n};"
],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -78,7 +77,6 @@
"let dog = {\n name: \"Spot\",\n numLegs: 4\n};\nconsole.log(dog.name);\nconsole.log(dog.numLegs);"
],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -127,7 +125,6 @@
"let dog = {\n name: \"Spot\",\n numLegs: 4,\n sayLegs () {\n return 'This dog has ' + this.numLegs + ' legs.';\n }\n};\n\ndog.sayLegs();"
],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -178,7 +175,6 @@
"let dog = {\n name: \"Spot\",\n numLegs: 4,\n sayLegs () {\n return 'This dog has ' + this.numLegs + ' legs.';\n }\n};\n\ndog.sayLegs();"
],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -232,7 +228,6 @@
"function Dog (name, color, numLegs) {\n this.name = 'name';\n this.color = 'color';\n this.numLegs = 4;\n}"
],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -275,7 +270,6 @@
"function Dog() {\n this.name = \"Rupert\";\n this.color = \"brown\";\n this.numLegs = 4;\n}\nconst hound = new Dog();"
],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -339,7 +333,6 @@
"function Dog (name, color) {\n this.numLegs = 4;\n this.name = name;\n this.color = color;\n}\n\nconst terrier = new Dog();"
],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -385,7 +378,6 @@
"function House(numBedrooms) {\n this.numBedrooms = numBedrooms;\n}\nconst myHouse = new House(4);\nconsole.log(myHouse instanceof House);"
],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -438,7 +430,6 @@
"function Bird(name) {\n this.name = name;\n this.numLegs = 2;\n}\n\nlet canary = new Bird(\"Tweety\");\nfunction getOwnProps (obj) {\n const props = [];\n \n for (let prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n props.push(prop);\n }\n }\n \n return props;\n}\n\nconst ownProps = getOwnProps(canary);"
],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -498,7 +489,6 @@
"function Dog (name) {\n this.name = name;\n}\nDog.prototype.numLegs = 4;\nlet beagle = new Dog(\"Snoopy\");"
],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -551,7 +541,6 @@
"function Dog(name) {\n this.name = name;\n}\n\nDog.prototype.numLegs = 4;\n\nlet beagle = new Dog(\"Snoopy\");\n\nlet ownProps = [];\nlet prototypeProps = [];\nfor (let prop in beagle) {\n if (beagle.hasOwnProperty(prop)) {\n ownProps.push(prop);\n } else {\n prototypeProps.push(prop);\n }\n}"
],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -613,7 +602,6 @@
"function Dog(name) {\n this.name = name;\n}\nfunction joinDogFraternity(candidate) {\n return candidate.constructor === Dog;\n}"
],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -673,7 +661,6 @@
"function Dog(name) {\n this.name = name; \n}\nDog.prototype = {\nnumLegs: 4,\n eat () {\n console.log('nom nom nom');\n },\n describe () {\n console.log('My name is ' + this.name);\n }\n};"
],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -718,7 +705,6 @@
"function Dog(name) {\n this.name = name; \n}\nDog.prototype = {\n constructor: Dog,\n numLegs: 2, \n eat: function() {\n console.log(\"nom nom nom\"); \n }, \n describe: function() {\n console.log(\"My name is \" + this.name); \n }\n};"
],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -770,7 +756,6 @@
"function Dog(name) {\n this.name = name;\n}\nlet beagle = new Dog(\"Snoopy\");\nDog.prototype.isPrototypeOf(beagle);"
],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -821,7 +806,6 @@
"function Dog(name) {\n this.name = name;\n}\nlet beagle = new Dog(\"Snoopy\");\nDog.prototype.isPrototypeOf(beagle);\nObject.prototype.isPrototypeOf(Dog.prototype);"
],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -880,7 +864,6 @@
"function Cat(name) {\n this.name = name; \n}\n\nCat.prototype = {\n constructor: Cat\n};\n\nfunction Bear(name) {\n this.name = name; \n}\n\nBear.prototype = {\n constructor: Bear\n};\n\nfunction Animal() { }\n\nAnimal.prototype = {\n constructor: Animal,\n eat: function() {\n console.log(\"nom nom nom\");\n }\n};"
],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -963,7 +946,6 @@
"function Animal() { }\n\nAnimal.prototype = {\n constructor: Animal, \n eat: function() {\n console.log(\"nom nom nom\");\n }\n};\nlet duck = Object.create(Animal.prototype);\nlet beagle = Object.create(Animal.prototype);\n\nduck.eat();\nbeagle.eat();"
],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1018,7 +1000,6 @@
"function Animal() { }\n\nAnimal.prototype = {\n constructor: Animal,\n eat: function() {\n console.log(\"nom nom nom\");\n }\n};\n\nfunction Dog() { }\nDog.prototype = Object.create(Animal.prototype);\n\nlet beagle = new Dog();\nbeagle.eat();"
],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1084,7 +1065,6 @@
"function Animal() { }\nfunction Bird() { }\nfunction Dog() { }\nBird.prototype = Object.create(Animal.prototype);\nDog.prototype = Object.create(Animal.prototype);\nDog.prototype.constructor = Dog;\nBird.prototype.constructor = Bird;\nlet duck = new Bird();\nlet beagle = new Dog();"
],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1155,7 +1135,6 @@
"hints": [
"Objects inherit methods from other objects by cloning their prototype. The Object.create method will come in handy, and don't forget to reset the constructor property afterward!"
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1220,7 +1199,6 @@
"function Bird() { }\n\nBird.prototype.fly = function() { return \"I am flying!\"; };\n\nfunction Penguin() { }\nPenguin.prototype = Object.create(Bird.prototype);\nPenguin.prototype.constructor = Penguin;\nPenguin.prototype.fly = () => 'Alas, this is a flightless bird.';\nlet penguin = new Penguin();\nconsole.log(penguin.fly());"
],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1285,7 +1263,6 @@
"let bird = {\n name: \"Donald\",\n numLegs: 2\n};\n\nlet boat = {\n name: \"Warrior\",\n type: \"race-boat\"\n};\nfunction glideMixin (obj) {\n obj.glide = () => 'Gliding!';\n}\n\nglideMixin(bird);\nglideMixin(boat);"
],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1345,7 +1322,6 @@
"function Bird() {\n let weight = 15;\n \n this.getWeight = () => weight;\n}"
],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1391,7 +1367,6 @@
"(function () {\n console.log(\"A cozy nest is ready\");\n})();"
],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1444,7 +1419,6 @@
"const funModule = (function () {\n return {\n isCuteMixin: obj => {\n obj.isCute = () => true;\n },\n singMixin: obj => {\n obj.sing = () => console.log(\"Singing to an awesome tune\");\n }\n };\n})();"
],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},

View File

@ -27,7 +27,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -74,7 +73,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -136,7 +134,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -209,7 +206,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -254,7 +250,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -305,7 +300,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -378,7 +372,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -433,7 +426,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -480,7 +472,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -526,7 +517,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -571,7 +561,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -617,7 +606,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -670,7 +658,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -708,7 +695,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -772,7 +758,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -825,7 +810,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -870,7 +854,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -924,7 +907,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -977,7 +959,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1041,7 +1022,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1105,7 +1085,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1164,7 +1143,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1213,7 +1191,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1262,7 +1239,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1324,7 +1300,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1386,7 +1361,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1444,7 +1418,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1494,7 +1467,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1560,7 +1532,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1636,7 +1607,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1683,7 +1653,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1730,7 +1699,6 @@
"hints": [
"You can use .replace() to remove the matched items by replacing them with an empty string."
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},

View File

@ -35,7 +35,6 @@
"testString": "assert($(\".container-fluid\").children().length >= 8, 'Make sure you have nested all HTML elements after the closing <code>style</code> tag in <code>.container-fluid</code>.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -159,7 +158,6 @@
"testString": "assert(code.match(/<img/g) && code.match(/<img[^<]*>/g).length === 2 && code.match(/<img/g).length === 2, 'Make sure your new <code>img</code> element has a closing angle bracket.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -267,7 +265,6 @@
"testString": "assert($(\"h2\").hasClass(\"red-text\"), 'Your <code>h2</code> element should still have the class <code>red-text</code>');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -377,7 +374,6 @@
"testString": "assert(code.match(/<\\/button>/g) && code.match(/<button/g) && code.match(/<\\/button>/g).length === code.match(/<button/g).length, 'Make sure all your <code>button</code> elements have a closing tag.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -494,7 +490,6 @@
"testString": "assert(code.match(/<\\/button>/g) && code.match(/<button/g) && code.match(/<\\/button>/g).length === code.match(/<button/g).length, 'Make sure all your <code>button</code> elements have a closing tag.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -620,7 +615,6 @@
"testString": "assert(code.match(/<\\/button>/g) && code.match(/<button/g) && code.match(/<\\/button>/g).length === code.match(/<button/g).length, 'Make sure all your <code>button</code> elements have a closing tag.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -736,7 +730,6 @@
"testString": "assert(code.match(/<\\/button>/g) && code.match(/<button/g) && code.match(/<\\/button>/g).length === code.match(/<button/g).length, 'Make sure all your <code>button</code> elements have a closing tag.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -852,7 +845,6 @@
"testString": "assert(code.match(/<\\/button>/g) && code.match(/<button/g) && code.match(/<\\/button>/g).length === code.match(/<button/g).length, 'Make sure all your <code>button</code> elements have a closing tag.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -972,7 +964,6 @@
"testString": "assert(code.match(/<\\/div>/g) && code.match(/<div/g) && code.match(/<\\/div>/g).length === code.match(/<div/g).length, 'Make sure each of your <code>div</code> elements has a closing tag.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -1104,7 +1095,6 @@
"testString": "assert($(\".img-responsive\").length > 1, 'Add the <code>img-responsive</code> class to your top image.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -1239,7 +1229,6 @@
"testString": "assert(code.match(/<\\/span>/g) && code.match(/<span/g) && code.match(/<\\/span>/g).length === code.match(/<span/g).length, 'Make sure your <code>span</code> element has a closing tag.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -1365,7 +1354,6 @@
"testString": "assert(code.match(/<\\/div>/g) && code.match(/<div/g) && code.match(/<\\/div>/g).length === code.match(/<div/g).length, 'Make sure each of your <code>div</code> elements has a closing tag.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -1498,7 +1486,6 @@
"testString": "assert(code.match(/<\\/i>|<\\/span>/g), 'Make sure your icon element has a closing tag.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -1623,7 +1610,6 @@
"testString": "assert(code.match(/<\\/i>|<\\/span/g) && code.match(/<\\/i|<\\/span>/g).length > 2 && ($(\".btn-primary > i\").is(\".fa.fa-thumbs-up\") || $(\".btn-primary > span\").is(\".fa.fa-thumbs-up\")), 'Make sure each of your <code>i</code> elements has a closing tag and <code>&#60;i class=\"fa fa-thumbs-up\"&#62;&#60;/i&#62;</code> is in your like button element.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -1738,7 +1724,6 @@
"testString": "assert(code.match(/<\\/div>/g) && code.match(/<div/g) && code.match(/<\\/div>/g).length === code.match(/<div/g).length, 'Make sure each of your <code>div</code> elements has a closing tag.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -1852,7 +1837,6 @@
"testString": "assert(code.match(/<\\/div>/g) && code.match(/<div/g) && code.match(/<\\/div>/g).length === code.match(/<div/g).length, 'Make sure each of your <code>div</code> elements has a closing tag.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -1979,7 +1963,6 @@
"testString": "assert(code.match(/<\\/i>/g) && code.match(/<\\/i/g).length > 3, 'Make sure each of your <code>i</code> elements has a closing tag.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -2113,7 +2096,6 @@
"testString": "assert(code.match(/<\\/div>/g) && code.match(/<div/g) && code.match(/<\\/div>/g).length === code.match(/<div/g).length, 'Make sure each of your <code>div</code> elements has a closing tag.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -2248,7 +2230,6 @@
"testString": "assert.isTrue((/jquery(\\s)+playground/gi).test($(\"h3\").text()), 'Your <code>h3</code> element should have the text <code>jQuery Playground</code>.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -2302,7 +2283,6 @@
"testString": "assert($(\"div\").children(\"h3\").length >0, 'Nest your <code>h3</code> element inside a <code>div</code> element.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -2360,7 +2340,6 @@
"testString": "assert(code.match(/<\\/div>/g) && code.match(/<div/g) && code.match(/<\\/div>/g).length === code.match(/<div/g).length, 'Make sure your <code>div</code> element has a closing tag.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -2412,7 +2391,6 @@
"testString": "assert(code.match(/<\\/div>/g) && code.match(/<div/g) && code.match(/<\\/div>/g).length === code.match(/<div/g).length, 'Make sure all your <code>div</code> elements have closing tags.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -2470,7 +2448,6 @@
"testString": "assert(code.match(/<\\/div>/g) && code.match(/<div/g) && code.match(/<\\/div>/g).length === code.match(/<div/g).length, 'Make sure all your <code>div</code> elements have closing tags.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -2532,7 +2509,6 @@
"testString": "assert(code.match(/<\\/button>/g) && code.match(/<button/g) && code.match(/<\\/button>/g).length === code.match(/<button/g).length, 'Make sure all your <code>button</code> elements have closing tags.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -2598,7 +2574,6 @@
"testString": "assert($(\".btn-default\").length > 5, 'Apply the <code>btn-default</code> class to each of your <code>button</code> elements.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -2661,7 +2636,6 @@
"testString": "assert($(\".target\").length > 5, 'Apply the <code>target</code> class to each of your <code>button</code> elements.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -2731,7 +2705,6 @@
"testString": "assert($(\".col-xs-6\").children(\"#right-well\") && $(\".col-xs-6\").children(\"#right-well\").length > 0, 'Give your right <code>well</code> the id of <code>right-well</code>.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -2814,7 +2787,6 @@
"testString": "assert(code.match(/<\\/h4>/g) && code.match(/<h4/g) && code.match(/<\\/h4>/g).length === code.match(/<h4/g).length, 'Make sure all your <code>h4</code> elements have closing tags.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -2901,7 +2873,6 @@
"testString": "assert($(\"#right-well\").children(\"#target6\") && $(\"#right-well\").children(\"#target6\").length > 0, 'One <code>button</code> element should have the id <code>target6</code>.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -2987,7 +2958,6 @@
"testString": "assert(new RegExp(\"#target6\",\"gi\").test($(\"#target6\").text()), 'Give your <code>button</code> element with the id <code>target6</code> the text <code>#target6</code>.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {
@ -3065,7 +3035,6 @@
"testString": "assert(code.match(/<!--/g).length === code.match(/-->/g).length, 'You should have the same number of comment openers and closers.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"es": {

View File

@ -27,7 +27,6 @@
"Remember to use the <a href='https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck/19514' target='_blank'>Read-Search-Ask</a> method if you get stuck."
],
"tests": [],
"type": "zipline",
"isRequired": true,
"challengeType": 3,
"translations": {
@ -60,7 +59,6 @@
],
"releasedOn": "January 10, 2017",
"tests": [],
"type": "zipline",
"isRequired": true,
"challengeType": 3,
"translations": {
@ -92,7 +90,6 @@
],
"releasedOn": "February 17, 2017",
"tests": [],
"type": "zipline",
"isRequired": true,
"challengeType": 3,
"translations": {
@ -133,7 +130,6 @@
"Remember to use the <a href='https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck/19514' target='_blank'>Read-Search-Ask</a> method if you get stuck."
],
"tests": [],
"type": "zipline",
"challengeType": 3,
"isRequired": true,
"translations": {
@ -182,7 +178,6 @@
"Remember to use the <a href='https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck/19514' target='_blank'>Read-Search-Ask</a> method if you get stuck."
],
"tests": [],
"type": "zipline",
"isRequired": true,
"challengeType": 3,
"translations": {

View File

@ -35,7 +35,6 @@
"testString": "assert(code.match(/\\n*?\\s*?\\}\\s*?\\);/g), 'Close your <code>$&#40;document&#41;.ready<wbr>&#40;function&#40;&#41; {</code> function with <code>}&#41;;</code>');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -140,7 +139,6 @@
"testString": "assert(code.match(/\\$\\(document\\)\\.ready\\(function.*(\\s|\\n)*.*button.*.addClass.*\\);/g), 'Your jQuery code should be within the <code>$(document).ready();</code> function.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -246,7 +244,6 @@
"testString": "assert(!code.match(/class\\.\\*animated/g), 'Only use jQuery to add these classes to the element.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -357,7 +354,6 @@
"testString": "assert(!code.match(/class.*animated/g), 'Only use jQuery to add these classes to the element.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -471,7 +467,6 @@
"testString": "assert(code.match(/<\\/script>/g) && code.match(/<script/g) && code.match(/<\\/script>/g).length === code.match(/<script/g).length, 'Leave your <code>script</code> element closing tag intact.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -583,7 +578,6 @@
"testString": "assert(!code.match(/class.*animated/g), 'Only use jQuery to add these classes to the element.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -688,7 +682,6 @@
"testString": "assert(code.match(/\\.[\\v\\s]*removeClass[\\s\\v]*\\([\\s\\v]*('|\")\\s*btn-default\\s*('|\")[\\s\\v]*\\)/gm), 'Only remove the <code>btn-default</code> class.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -790,7 +783,6 @@
"testString": "assert(!code.match(/class.*animated/g), 'Only use jQuery to add these classes to the element.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -900,7 +892,6 @@
"testString": "assert(!code.match(/disabled[^<]*>/g), 'Only use jQuery to add these classes to the element.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -1015,7 +1006,6 @@
"testString": "assert(code.match(/\\$\\(\\s*?(\\\"|\\')#target4(\\\"|\\')\\s*?\\)\\.html\\(/), 'Make sure to select <code>button id=\"target4\"</code> with jQuery.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -1101,7 +1091,6 @@
"testString": "assert(code.match(/id=\"target4/g) && !code.match(/<!--.*id=\"target4\".*-->/g) && $(\"#right-well\").length > 0, 'Only use jQuery to remove this element.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -1188,7 +1177,6 @@
"testString": "assert(!code.match(/class.*animated/g), 'Only use jQuery to move these elements.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -1281,7 +1269,6 @@
"testString": "assert(!code.match(/class.*animated/g), 'Only use jQuery to move these elements.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -1381,7 +1368,6 @@
"testString": "assert(code.match(/<div class=\"well\" id=\"left-well\">/g), 'Only use jQuery to add these classes to the element.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -1480,7 +1466,6 @@
"testString": "assert(code.match(/<div class=\"well\" id=\"right-well\">/g), 'Only use jQuery to add these classes to the element.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -1587,7 +1572,6 @@
"testString": "assert(code.match(/\\$\\(\".target:nth-child\\(2\\)\"\\)/g) || code.match(/\\$\\('.target:nth-child\\(2\\)'\\)/g) || code.match(/\\$\\(\".target\"\\).filter\\(\":nth-child\\(2\\)\"\\)/g) || code.match(/\\$\\('.target'\\).filter\\(':nth-child\\(2\\)'\\)/g), 'Only use jQuery to add these classes to the element.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -1690,7 +1674,6 @@
"testString": "assert(code.match(/\\$\\(\".target:even\"\\)/g) || code.match(/\\$\\('.target:even'\\)/g) || code.match(/\\$\\(\".target\"\\).filter\\(\":even\"\\)/g) || code.match(/\\$\\('.target'\\).filter\\(':even'\\)/g), 'Only use jQuery to add these classes to the element.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {
@ -1783,7 +1766,6 @@
"testString": "assert($('body').hasClass('animated') && $('body').hasClass('hinge'), 'Add the classes <code>animated</code> and <code>hinge</code> to your <code>body</code> element.');"
}
],
"type": "waypoint",
"challengeType": 0,
"translations": {
"de": {

View File

@ -42,7 +42,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -108,7 +107,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -191,7 +189,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -263,7 +260,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -341,7 +337,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -410,7 +405,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -514,7 +508,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -572,7 +565,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -626,7 +618,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},

View File

@ -29,11 +29,9 @@
"Once you're done, submit the URL to your working project with all its tests passing.",
"Remember to use the <a href='https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck/19514' target='_blank'>Read-Search-Ask</a> method if you get stuck."
],
"challengeSeed": [],
"tests": [],
"isRequired": true,
"releasedOn": "January 1, 2016",
"type": "zipline",
"challengeType": 3,
"translations": {
"es": {
@ -68,11 +66,9 @@
"Once you're done, submit the URL to your working project with all its tests passing.",
"Remember to use the <a href='https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck/19514' target='_blank'>Read-Search-Ask</a> method if you get stuck."
],
"challengeSeed": [],
"tests": [],
"isRequired": true,
"releasedOn": "January 1, 2016",
"type": "zipline",
"challengeType": 3,
"translations": {
"es": {
@ -109,11 +105,9 @@
"Once you're done, submit the URL to your working project with all its tests passing.",
"Remember to use the <a href='https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck/19514' target='_blank'>Read-Search-Ask</a> method if you get stuck."
],
"challengeSeed": [],
"tests": [],
"isRequired": true,
"releasedOn": "January 1, 2016",
"type": "zipline",
"challengeType": 3,
"translations": {
"es": {
@ -144,11 +138,9 @@
"Once you're done, submit the URL to your working project with all its tests passing.",
"Remember to use the <a href='https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck/19514' target='_blank'>Read-Search-Ask</a> method if you get stuck."
],
"challengeSeed": [],
"tests": [],
"isRequired": true,
"releasedOn": "February 17, 2017",
"type": "zipline",
"challengeType": 3,
"translations": {}
},
@ -175,11 +167,9 @@
"Once you're done, submit the URL to your working project with all its tests passing.",
"Remember to use the <a href='https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck/19514' target='_blank'>Read-Search-Ask</a> method if you get stuck."
],
"challengeSeed": [],
"tests": [],
"isRequired": true,
"releasedOn": "February 17, 2017",
"type": "zipline",
"challengeType": 3,
"translations": {}
}

View File

@ -54,7 +54,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -110,7 +109,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -179,7 +177,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -264,7 +261,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -322,7 +318,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -411,7 +406,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -470,7 +464,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -566,7 +559,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -662,7 +654,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -737,7 +728,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -814,7 +804,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -884,7 +873,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -983,7 +971,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1082,7 +1069,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1184,7 +1170,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1250,7 +1235,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1349,7 +1333,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1423,7 +1406,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1497,7 +1479,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1613,7 +1594,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1694,7 +1674,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1809,7 +1788,6 @@
"hints": [
"The cy attribute should be the second number of the data point array subtracted from the height of the SVG."
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -1924,7 +1902,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -2018,7 +1995,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -2092,7 +2068,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -2155,7 +2130,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -2220,7 +2194,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -2385,7 +2358,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -2494,7 +2466,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},

View File

@ -32,7 +32,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -110,7 +109,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -217,7 +215,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -303,7 +300,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -402,7 +398,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -491,7 +486,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -583,7 +577,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -693,7 +686,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},
@ -761,7 +753,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 0,
"translations": {},

View File

@ -12,7 +12,6 @@
"Working on this project will involve you writing your code on Glitch on our starter project. After completing this project you can copy your public glitch url (to the homepage of your app) into this screen to test it! Optionally you may choose to write your project on another platform but it must be publicly visible for our testing.",
"Start this project on Glitch using <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-project-timestamp/'>this link</a> or clone <a href='https://github.com/freeCodeCamp/boilerplate-project-timestamp/'>this repository</a> on GitHub! If you use Glitch, remember to save the link to your project somewhere safe!"
],
"challengeSeed": [],
"tests": [
{
"text": "I can pass a string as a parameter, and it will check to see whether that string contains either a unix timestamp or a natural language date (example: January 1, 2016).",
@ -46,7 +45,6 @@
"Working on this project will involve you writing your code on Glitch on our starter project. After completing this project you can copy your public glitch url (to the homepage of your app) into this screen to test it! Optionally you may choose to write your project on another platform but it must be publicly visible for our testing.",
"Start this project on Glitch using <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-project-headerparser/'>this link</a> or clone <a href='https://github.com/freeCodeCamp/boilerplate-project-headerparser/'>this repository</a> on GitHub! If you use Glitch, remember to save the link to your project somewhere safe!"
],
"challengeSeed": [],
"tests": [
{
"text": "I can get the IP address, language and operating system for my browser.",
@ -72,7 +70,6 @@
"Working on this project will involve you writing your code on Glitch on our starter project. After completing this project you can copy your public glitch url (to the homepage of your app) into this screen to test it! Optionally you may choose to write your project on another platform but it must be publicly visible for our testing.",
"Start this project on Glitch using <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-project-urlshortener/'>this link</a> or clone <a href='https://github.com/freeCodeCamp/boilerplate-project-urlshortener/'>this repository</a> on GitHub! If you use Glitch, remember to save the link to your project somewhere safe!"
],
"challengeSeed": [],
"tests": [
{
"text": "I can pass a URL as a parameter and I will receive a shortened URL in the JSON response.",
@ -106,7 +103,6 @@
"Working on this project will involve you writing your code on Glitch on our starter project. After completing this project you can copy your public glitch url (to the homepage of your app) into this screen to test it! Optionally you may choose to write your project on another platform but it must be publicly visible for our testing.",
"Start this project on Glitch using <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-project-exercisetracker/'>this link</a> or clone <a href='https://github.com/freeCodeCamp/boilerplate-project-exercisetracker/'>this repository</a> on GitHub! If you use Glitch, remember to save the link to your project somewhere safe!"
],
"challengeSeed": [],
"tests": [
{
"text": "I can create a user by posting form data username to /api/exercise/new-user and returned will be an object with username and <code>_id</code>.",
@ -148,7 +144,6 @@
"Working on this project will involve you writing your code on Glitch on our starter project. After completing this project you can copy your public glitch url (to the homepage of your app) into this screen to test it! Optionally you may choose to write your project on another platform but it must be publicly visible for our testing.",
"Start this project on Glitch using <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-project-filemetadata/'>this link</a> or clone <a href='https://github.com/freeCodeCamp/boilerplate-project-filemetadata/'>this repository</a> on GitHub! If you use Glitch, remember to save the link to your project somewhere safe!"
],
"challengeSeed": [],
"tests": [
{
"text": "I can submit a FormData object that includes a file upload.",

View File

@ -11,7 +11,6 @@
"During the development process, it is important to be able to check whats going on in your code. Node is just a JavaScript environment. Like client side JavaScript, you can use the console to display useful debug information. On your local machine, you would see the console output in a terminal. On Glitch you can open the logs in the lower part of the screen. You can toggle the log panel with the button Logs (top-left, under the app name).",
"To get started, just print the classic \"Hello World\" in the console. We recommend to keep the log panel open while working at these challenges. Reading the logs you can be aware of the nature of the errors that may occur."
],
"challengeSeed": [],
"tests": [
{
"text": "<code>\"Hello World\"</code> should be in the console",
@ -34,7 +33,6 @@
"will serve the string 'Response String'.",
"Use the <code>app.get()</code> method to serve the string Hello Express, to GET requests matching the / root path. Be sure that your code works by looking at the logs, then see the results in your browser, clicking the button Show Live in the Glitch UI."
],
"challengeSeed": [],
"tests": [
{
"text": "Your app should serve the string 'Hello Express'",
@ -56,7 +54,6 @@
"The file to send is <code>/views/index.html</code>. Try to Show Live your app, you should see a big HTML heading (and a form that we will use later…), with no style applied.",
"Note: You can edit the solution of the previous challenge, or create a new one. If you create a new solution, keep in mind that Express evaluates the routes from top to bottom. It executes the handler for the first match. You have to comment out the preceding solution, or the server will keep responding with a string."
],
"challengeSeed": [],
"tests": [
{
"text": "Your app should serve the file views/index.html",
@ -76,7 +73,6 @@
"Mount the <code>express.static()</code> middleware for all the requests with <code>app.use()</code>. The absolute path to the assets folder is <code>__dirname + /public</code>.",
"Now your app should be able to serve a CSS stylesheet. From outside the public folder will appear mounted to the root directory. Your front-page should look a little better now!"
],
"challengeSeed": [],
"tests": [
{
"text": "Your app should serve asset files from the <code>/public</code> directory",
@ -96,7 +92,6 @@
"Let's create a simple API by creating a route that responds with JSON at the path <code>/json</code>. You can do it as usual, with the <code>app.get()</code> method. Inside the route handler use the method <code>res.json()</code>, passing in an object as an argument. This method closes the request-response loop, returning the data. Behind the scenes it converts a valid JavaScript object into a string, then sets the appropriate headers to tell your browser that you are serving JSON, and sends the data back. A valid object has the usual structure <code>{key: data}</code>. Data can ba a number, a string, a nested object or an array. Data can also be a variable or the result of a function call; in which case it will be evaluated before being converted into a string.",
"Serve the object <code>{\"message\": \"Hello json\"}</code> as a response in JSON format, to the GET requests to the route <code>/json</code>. Then point your browser to your-app-url/json, you should see the message on the screen."
],
"challengeSeed": [],
"tests": [
{
"text": "The endpoint <code>/json</code> should serve the json object <code>{\"message\": \"Hello json\"}</code>",
@ -116,7 +111,6 @@
"The environment variables are accessible from the app as <code>process.env.VAR_NAME</code>. The <code>process.env</code> object is a global Node object, and variables are passed as strings. By convention, the variable names are all uppercase, with words separated by an underscore. The <code>.env</code> is a shell file, so you dont need to wrap names or values in quotes. It is also important to note that there cannot be space around the equals sign when you are assigning values to your variables, e.g. <code>VAR_NAME=value</code>. Usually, you will put each variable definition on a separate line.",
"Let's add an environment variable as a configuration option. Store the variable <code>MESSAGE_STYLE=uppercase</code> in the <code>.env</code> file. Then tell the GET <code>/json</code> route handler that you created in the last challenge to transform the response objects message to uppercase if <code>process.env.MESSAGE_STYLE</code> equals <code>uppercase</code>. The response object should become <code>{\"message\": \"HELLO JSON\"}</code>."
],
"challengeSeed": [],
"tests": [
{
"text": "The response of the endpoint <code>/json</code> should change according to the environment variable <code>MESSAGE_STYLE</code>",
@ -140,7 +134,6 @@
"Build a simple logger. For every request, it should log in the console a string taking the following format: <code>method path - ip</code>. An example would look like: <code>GET /json - ::ffff:127.0.0.1</code>. Note that there is a space between <code>method</code> and <code>path</code> and that the dash separating <code>path</code> and <code>ip</code> is surrounded by a space on either side. You can get the request method (http verb), the relative route path, and the callers ip from the request object, using <code>req.method</code>, <code>req.path</code> and <code>req.ip</code>. Remember to call <code>next()</code> when you are done, or your server will be stuck forever. Be sure to have the Logs opened, and see what happens when some request arrives…",
"Hint: Express evaluates functions in the order they appear in the code. This is true for middleware too. If you want it to work for all the routes, it should be mounted before them."
],
"challengeSeed": [],
"tests": [
{
"text": "Root level logger middleware should be active",
@ -163,7 +156,6 @@
"In the route <code>app.get('/now', ...)</code> chain a middleware function and the final handler. In the middleware function you should add the current time to the request object in the <code>req.time</code> key. You can use <code>new Date().toString()</code>. In the handler, respond with a JSON object, taking the structure <code>{time: req.time}</code>.",
"Hint: The test will not pass if you dont chain the middleware. If you mount the function somewhere else, the test will fail, even if the output result is correct."
],
"challengeSeed": [],
"tests": [
{
"text": "The /now endpoint should have mounted middleware",
@ -187,7 +179,6 @@
"<blockquote>route_path: '/user/:userId/book/:bookId'<br>actual_request_URL: '/user/546/book/6754' <br>req.params: {userId: '546', bookId: '6754'}</blockquote>",
"Build an echo server, mounted at the route <code>GET /:word/echo</code>. Respond with a JSON object, taking the structure <code>{echo: word}</code>. You can find the word to be repeated at <code>req.params.word</code>. You can test your route from your browser's address bar, visiting some matching routes, e.g. your-app-rootpath/freecodecamp/echo"
],
"challengeSeed": [],
"tests": [
{
"text": "Test 1 : Your echo server should repeat words correctly",
@ -212,7 +203,6 @@
"Build an API endpoint, mounted at <code>GET /name</code>. Respond with a JSON document, taking the structure <code>{ name: 'firstname lastname'}</code>. The first and last name parameters should be encoded in a query string e.g. <code>?first=firstname&last=lastname</code>.",
"TIP: In the following exercise we are going to receive data from a POST request, at the same <code>/name</code> route path. If you want you can use the method <code>app.route(path).get(handler).post(handler)</code>. This syntax allows you to chain different verb handlers on the same path route. You can save a bit of typing, and have cleaner code."
],
"challengeSeed": [],
"tests": [
{
"text": "Test 1 : Your API endpoint should respond with the correct name",
@ -241,7 +231,6 @@
"Install the body-parser module in your package.json. Then require it at the top of the file. Store it in a variable named bodyParser.",
"The middleware to handle url encoded data is returned by <code>bodyParser.urlencoded({extended: false})</code>. <code>extended=false</code> is a configuration option that tells the parser to use the classic encoding. When using it, values can be only strings or arrays. The extended version allows more data flexibility, but it is outmatched by JSON. Pass to <code>app.use()</code> the function returned by the previous method call. As usual, the middleware must be mounted before all the routes which need it."
],
"challengeSeed": [],
"tests": [
{
"text": "The 'body-parser' middleware should be mounted",
@ -267,7 +256,6 @@
"DELETE => Delete a resource.",
"There are also a couple of other methods which are used to negotiate a connection with the server. Except from GET, all the other methods listed above can have a payload (i.e. the data into the request body). The body-parser middleware works with these methods as well."
],
"challengeSeed": [],
"tests": [
{
"text": "Test 1 : Your API endpoint should respond with the correct name",

View File

@ -19,7 +19,6 @@
"All field-names must use double-quotes (\"), e.g. \"author\"",
"All fields must be separated with a comma (,)"
],
"challengeSeed": [],
"tests": [
{
"text": "package.json should have a valid \"author\" key",
@ -43,7 +42,6 @@
"Add a description to the package.json in your Glitch project.",
"Remember to use double-quotes for field-names (\") and commas (,) to separate fields."
],
"challengeSeed": [],
"tests": [
{
"text": "package.json should have a valid \"description\" key",
@ -67,7 +65,6 @@
"Add an array of suitable strings to the keywords-field in the package.json of your Glitch project.",
"One of the keywords should be freecodecamp."
],
"challengeSeed": [],
"tests": [
{
"text": "package.json should have a valid \"keywords\" key",
@ -100,7 +97,6 @@
"Instructions",
"Fill the license-field in the package.json of your Glitch project as you find suitable."
],
"challengeSeed": [],
"tests": [
{
"text": "package.json should have a valid \"license\" key",
@ -122,7 +118,6 @@
"Instructions",
"Add a version to the package.json in your Glitch project."
],
"challengeSeed": [],
"tests": [
{
"text": "package.json should have a valid \"version\" key",
@ -148,7 +143,6 @@
"Add version 2.14.0 of the package moment to the dependencies-field of your package.json",
"Moment is a handy library for working with time and dates."
],
"challengeSeed": [],
"tests": [
{
"text": "\"dependencies\" should include \"moment\"",
@ -183,7 +177,6 @@
"Instructions",
"In the dependencies-section of your package.json, change the version of moment to match MAJOR version 2, MINOR version 10 and PATCH version 2"
],
"challengeSeed": [],
"tests": [
{
"text": "\"dependencies\" should include \"moment\"",
@ -211,7 +204,6 @@
"Use the tilde-character (~) to prefix the version of moment in your dependencies and allow npm to update it to any new PATCH release.",
"Note that the version numbers themselves not should be changed."
],
"challengeSeed": [],
"tests": [
{
"text": "\"dependencies\" should include \"moment\"",
@ -239,7 +231,6 @@
"Use the caret-character (^) to prefix the version of moment in your dependencies and allow npm to update it to any new MINOR release.",
"Note that the version numbers themselves not should be changed."
],
"challengeSeed": [],
"tests": [
{
"text": "\"dependencies\" should include \"moment\"",
@ -266,7 +257,6 @@
"Remove the package moment from your dependencies.",
"Make sure you have the right amount of commas after removing it."
],
"challengeSeed": [],
"tests": [
{
"text": "\"dependencies\" should not include \"moment\"",

View File

@ -10,7 +10,6 @@
"description": [
"Add mongodb and mongoose to the projects package.json. Then require mongoose. Store your mLab database URI in the private .env file as MONGO_URI. Connect to the database using mongoose.connect(<Your URI>)"
],
"challengeSeed": [],
"tests": [
{
"text": "\"mongodb\" dependency should be in package.json",
@ -56,7 +55,6 @@
"<code> done(null, result);</code>",
"<code>};</code>"
],
"challengeSeed": [],
"tests": [
{
"text": "Creating an instance from a mongoose schema should succeed",
@ -79,7 +77,6 @@
"<code>// ...do your stuff here...</code>",
"<code>});</code>"
],
"challengeSeed": [],
"tests": [
{
"text": "Creating and saving a db item should succeed",
@ -97,7 +94,6 @@
"description": [
"Sometimes you need to create many instances of your models, e.g. when seeding a database with initial data. Model.create() takes an array of objects like [{name: 'John', ...}, {...}, ...] as the first argument, and saves them all in the db. Create many people with Model.create(), using the function argument arrayOfPeople."
],
"challengeSeed": [],
"tests": [
{
"text": "Creating many db items at once should succeed",
@ -116,7 +112,6 @@
"Find all the people having a given name, using Model.find() -> [Person]",
"In its simplest usage, Model.find() accepts a query document (a JSON object ) as the first argument, then a callback. It returns an array of matches. It supports an extremely wide range of search options. Check it in the docs. Use the function argument personName as search key."
],
"challengeSeed": [],
"tests": [
{
"text": "Find all items corresponding to a criteria should succeed",
@ -134,7 +129,6 @@
"description": [
"Model.findOne() behaves like .find(), but it returns only one document (not an array), even if there are items. It is especially useful when searching by properties that you have declared as unique. Find just one person which has a certain food in her favorites, using Model.findOne() -> Person. Use the function argument food as search key."
],
"challengeSeed": [],
"tests": [
{
"text": "Find one item should succeed",
@ -152,7 +146,6 @@
"description": [
"When saving a document, mongodb automatically adds the field _id, and set it to a unique alphanumeric key. Searching by _id is an extremely frequent operation, so moongose provides a dedicated method for it. Find the (only!!) person having a given _id, using Model.findById() -> Person. Use the function argument personId as search key."
],
"challengeSeed": [],
"tests": [
{
"text": "Find an item by Id should succeed",
@ -172,7 +165,6 @@
"Find a person by _id ( use any of the above methods ) with the parameter personId as search key. Add “hamburger” to the list of her favoriteFoods (you can use Array.push()). Then - inside the find callback - save() the updated Person.",
"[*] Hint: This may be tricky if in your Schema you declared favoriteFoods as an Array, without specifying the type (i.e. [String]). In that casefavoriteFoods defaults to Mixed type, and you have to manually mark it as edited using document.markModified('edited-field'). (http://mongoosejs.com/docs/schematypes.html - #Mixed )"
],
"challengeSeed": [],
"tests": [
{
"text": "Find-edit-update an item should succeed",
@ -192,7 +184,6 @@
"Find a person by Name and set her age to 20. Use the function parameter personName as search key.",
"Hint: We want you to return the updated document. o do that you need to pass the options document { new: true } as the 3rd argument to findOneAndUpdate(). By default these methods return the unmodified object."
],
"challengeSeed": [],
"tests": [
{
"text": "findOneAndUpdate an item should succeed",
@ -210,7 +201,6 @@
"description": [
"Delete one person by her _id. You should use one of the methods findByIdAndRemove() or findOneAndRemove(). They are like the previous update methods. They pass the removed document to the cb. As usual, use the function argument personId as search key."
],
"challengeSeed": [],
"tests": [
{
"text": "Deleting an item should succeed",
@ -229,7 +219,6 @@
"Model.remove() is useful to delete all the documents matching given criteria. Delete all the people whose name is “Mary”, using Model.remove(). Pass to it a query ducument with the “name” field set, and of course a callback.",
"Note: Model.remove() doesnt return the deleted document, but a JSON object containing the outcome of the operation, and the number of items affected. Dont forget to pass it to the done() callback, since we use it in tests."
],
"challengeSeed": [],
"tests": [
{
"text": "Deleting many items at once should succeed",
@ -248,7 +237,6 @@
"If you dont pass the callback as the last argument to Model.find() (or to the other search methods), the query is not executed. You can store the query in a variable for later use. This kind of object enables you to build up a query using chaining syntax. The actual db search is executed when you finally chain the method .exec(). Pass your callback to this last method. There are many query helpers, here well use the most famous ones.",
"Find people who like \"burrito\". Sort them by name, limit the results to two documents, and hide their age. Chain .find(), .sort(), .limit(), .select(), and then .exec(). Pass the done(err, data) callback to exec()."
],
"challengeSeed": [],
"tests": [
{
"text": "Chaining query helpers should succeed",

View File

@ -15,7 +15,6 @@
"Lastly, you should change your response to the request for the index route to <code>res.render</code> with the path to the view <em>views/pug/index.pug</em>.",
"If all went as planned, you should refresh your apps home page and see a small message saying you're successfully rending the Pug from our Pug file! Submit your page when you think you've got it right."
],
"challengeSeed": [],
"tests": [
{
"text": "Pug is a dependency",
@ -48,7 +47,6 @@
"It should look like: <code>res.render(process.cwd() + '/views/pug/index', {title: 'Hello', message: 'Please login'});</code>",
"Now refresh your page and you should see those values rendered in your view in the correct spot as laid out in your index.pug file! Submit your page when you think you've got it right."
],
"challengeSeed": [],
"tests": [
{
"text": "Pug render variables correct",
@ -74,7 +72,6 @@
"As well you can go ahead and tell your express app to <b>use</b> 'passport.initialize()' and 'passport.session()'. (For example, <code>app.use(passport.initialize());</code>)",
"Submit your page when you think you've got it right. If you're running into errors, you can check out the project completed up to this point <a href='https://gist.github.com/JosephLivengood/338a9c5a326923c3826a666d430e65c3'>here</a>."
],
"challengeSeed": [],
"tests": [
{
"text": "Passort and Express-session are dependencies",
@ -110,7 +107,6 @@
"NOTE: This deserializeUser will throw an error until we set up the DB in the next step so comment out the whole block and just call <code>done(null, null)</code> in the function deserializeUser.",
"Submit your page when you think you've got it right."
],
"challengeSeed": [],
"tests": [
{
"text": "Serialize user function correct",
@ -146,7 +142,6 @@
"You can now uncomment the block in deserializeUser and remove your <code>done(null, null)</code>. Be sure to set <em>DATABASE</em> in your .env file to your database's connection string (for example: <code>DATABASE=mongodb://admin:pass@mlab.com:12345/my-project</code>). You can set up a free database on <a href='https://mlab.com/welcome/'>mLab</a>. Congratulations- you've finished setting up serialization!",
"Submit your page when you think you've got it right. If you're running into errors, you can check out the project completed up to this point <a href='https://gist.github.com/JosephLivengood/e192e809a1d27cb80dc2c6d3467b7477'>here</a>."
],
"challengeSeed": [],
"tests": [
{
"text": "Database connection is present",
@ -173,7 +168,6 @@
"Many strategies are set up using different settings, general it is easy to set it up based on the README in that strategies repository though. A good example of this is the Github strategy where we don't need to worry about a username or password because the user will be sent to Github's auth page to authenticate and as long as they are logged in and agree then Github returns their profile for us to use.",
"In the next step we will set up how to actually call the authentication strategy to validate a user based on form data! Submit your page when you think you've got it right up to this point."
],
"challengeSeed": [],
"tests": [
{
"text": "Passport-local is a dependency",
@ -201,7 +195,6 @@
"Now at this point if you enter a username and password in the form, it should redirect to the home page <em>/</em> and in the console of your server should be 'User {USERNAME} attempted to log in.' since we currently cannot login a user who isn't registered.",
"Submit your page when you think you've got it right. If you're running into errors, you can check out the project completed up to this point <a href='https://gist.github.com/JosephLivengood/8a335d1a68ed9170da02bb9d8f5b71d5'>here</a>."
],
"challengeSeed": [],
"tests": [
{
"text": "All steps correctly implemented in the server.js",
@ -229,7 +222,6 @@
"<pre>app.route('/profile')\n .get(ensureAuthenticated, (req,res) => {\n res.render(process.cwd() + '/views/pug/profile');\n });</pre>",
"Submit your page when you think you've got it right."
],
"challengeSeed": [],
"tests": [
{
"text": "Middleware ensureAuthenticated should be implemented and on our /profile route",
@ -255,7 +247,6 @@
"Also in the profile, add a link to <em>/logout</em>. That route will host the logic to unauthenticate a user. <code>a(href='/logout') Logout</code>",
"Submit your page when you think you've got it right."
],
"challengeSeed": [],
"tests": [
{
"text": "Correctly added a Pug render variable to /profile",
@ -279,7 +270,6 @@
"<pre>app.use((req, res, next) => {\n res.status(404)\n .type('text')\n .send('Not Found');\n});</pre>",
"Submit your page when you think you've got it right."
],
"challengeSeed": [],
"tests": [
{
"text": "Logout route",
@ -306,7 +296,6 @@
"<pre>app.route('/register')\n .post((req, res, next) => {\n db.collection('users').findOne({ username: req.body.username }, function (err, user) {\n if(err) {\n next(err);\n } else if (user) {\n res.redirect('/');\n } else {\n db.collection('users').insertOne(\n {username: req.body.username,\n password: req.body.password},\n (err, doc) => {\n if(err) {\n res.redirect('/');\n } else {\n next(null, user);\n }\n }\n )\n }\n })},\n passport.authenticate('local', { failureRedirect: '/' }),\n (req, res, next) => {\n res.redirect('/profile');\n }\n);</pre>",
"Submit your page when you think you've got it right. If you're running into errors, you can check out the project completed up to this point <a href='https://gist.github.com/JosephLivengood/6c47bee7df34df9f11820803608071ed'>here</a>."
],
"challengeSeed": [],
"tests": [
{
"text": "Register route and display on home",
@ -345,7 +334,6 @@
"Finally on our authentication strategy we check for the following in our code before completing the process: <code>if (password !== user.password) { return done(null, false); }</code>. After making the previous changes, now <code>user.password</code> is a hash. Before making a change to the existing code, notice how the statement is checking if the password is NOT equal then return non-authenticated. With this in mind your code could look as follows to properly check the password entered against the hash: <code>if (!bcrypt.compare(password, user.password)) { return done(null, false); }</code>",
"That is all it takes to implement one of the most important security features when you have to store passwords! Submit your page when you think you've got it right."
],
"challengeSeed": [],
"tests": [
{
"text": "BCrypt is a dependency",
@ -376,7 +364,6 @@
"Now do the same thing in your auth.js file with all of the things related to authentication such as the serialization and the setting up of the local strategy and erase them from your server file. Be sure to add the dependencies in and call <code>auth(app,db)</code> in the server in the same spot. Be sure to have <code>auth(app, db)</code> before <code>routes(app, db)</code> since our registration route depends on passport being initiated!",
"Congratulations- you're at the end of this section of Advanced Node and Express and have some beautiful code to show for it! Submit your page when you think you've got it right. If you're running into errors, you can check out an example of the completed project <a href='https://glitch.com/#!/project/delicious-herring'>here</a>."
],
"challengeSeed": [],
"tests": [
{
"text": "Modules present",
@ -400,7 +387,6 @@
"An example of how '/auth/github/callback' should look is similar to how we handled a normal login in our last project: <pre>app.route('/login')\n .post(passport.authenticate('local', { failureRedirect: '/' }), (req,res) => { \n res.redirect('/profile'); \n });</pre>",
"Submit your page when you think you've got it right. If you're running into errors, you can check out the project up to this point <a href='https://gist.github.com/JosephLivengood/28ea2cae7e1dc6a53d7f0c42d987313b'>here</a>."
],
"challengeSeed": [],
"tests": [
{
"text": "Route /auth/github correct",
@ -427,7 +413,6 @@
"Your authentication won't be successful yet, and actually throw an error, without the database logic and callback, but it should log to your console your Github profile if you try it!",
"Submit your page when you think you've got it right."
],
"challengeSeed": [],
"tests": [
{
"text": "Dependency added",
@ -457,7 +442,6 @@
"With a findAndModify, it allows you to search for an object and update it, as well as upsert the object if it doesn't exist and receive the new object back each time in our callback function. In this example, we always set the last_login as now, we always increment the login_count by 1, and only when we insert a new object(new user) do we populate the majority of the fields. Something to notice also is the use of default values. Sometimes a profile returned won't have all the information filled out or it will have been chosen by the user to remain private; so in this case we have to handle it to prevent an error.",
"You should be able to login to your app now- try it! Submit your page when you think you've got it right. If you're running into errors, you can check out an example of this mini-project's finished code <a href='https://glitch.com/#!/project/guttural-birch'>here</a>."
],
"challengeSeed": [],
"tests": [
{
"text": "Github strategy setup complete",
@ -482,7 +466,6 @@
"<strong>Note</strong><br><code>io()</code> works only when connecting to a socket hosted on the same url/server. For connecting to an external socket hosted elsewhere, you would use <code>io.connect('URL');</code>.",
"Submit your page when you think you've got it right."
],
"challengeSeed": [],
"tests": [
{
"text": "Socket.IO is a dependency",
@ -519,7 +502,6 @@
"Now try loading up your app and authenticate and you should see in your client console '1' representing the current user count! Try loading more clients up and authenticating to see the number go up.",
"Submit your page when you think you've got it right."
],
"challengeSeed": [],
"tests": [
{
"text": "currentUsers is defined",
@ -550,7 +532,6 @@
"<strong>Note</strong><br>Just like 'disconnect', all other events that a socket can emit to the server should be handled within the connecting listener where we have 'socket' defined.",
"Submit your page when you think you've got it right."
],
"challengeSeed": [],
"tests": [
{
"text": "Server handles the event disconnect from a socket",
@ -577,7 +558,6 @@
"The user object is now accessible on your socket object as <code>socket.request.user</code>. For example, now you can add the following: <code>console.log('user ' + socket.request.user.name + ' connected');</code> and it will log to the server console who has connected!",
"Submit your page when you think you've got it right. If you're running into errors, you can check out the project up to this point <a href='https://gist.github.com/JosephLivengood/a9e69ff91337500d5171e29324e1ff35'>here</a>."
],
"challengeSeed": [],
"tests": [
{
"text": "passportSocketIo is a dependency",
@ -608,7 +588,6 @@
"An implementation of this could look like the following:<pre>socket.on('user', function(data){\n $('#num-users').text(data.currentUsers+' users online');\n var message = data.name;\n if(data.connected) {\n message += ' has joined the chat.';\n } else {\n message += ' has left the chat.';\n }\n $('#messages').append($('&#60;li&#62;').html('&#60;b&#62;'+ message +'&#60;\\/b&#62;'));\n});</pre>",
"Submit your page when you think you've got it right."
],
"challengeSeed": [],
"tests": [
{
"text": "Event 'user' is emitted with name, currentUsers, and connected",
@ -635,7 +614,6 @@
"On your client now again, you should now listen for event 'chat message' and when received, append a list item to <code>#messages</code> with the name a colon and the message!",
"At this point the chat should be fully functional and sending messages across all clients! Submit your page when you think you've got it right. If you're running into errors, you can check out the project up to this point <a href='https://gist.github.com/JosephLivengood/3e4b7750f6cd42feaa2768458d682136'>here for the server</a> and <a href='https://gist.github.com/JosephLivengood/41ba76348df3013b7870dc64861de744'>here for the client</a>."
],
"challengeSeed": [],
"tests": [
{
"text": "Server listens for 'chat message' then emits it properly",

View File

@ -11,7 +11,6 @@
"As a reminder, this project is being built upon the following starter project on <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-infosec/'>Glitch</a>, or cloned from <a href='https://github.com/freeCodeCamp/boilerplate-infosec/'>GitHub</a>.",
"Helmet helps you secure your Express apps by setting various HTTP headers. Install the package, then require it."
],
"challengeSeed": [],
"tests": [
{
"text": "\"helmet\" dependency should be in package.json",
@ -31,7 +30,6 @@
"As a reminder, this project is being built upon the following starter project on <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-infosec/'>Glitch</a>, or cloned from <a href='https://github.com/freeCodeCamp/boilerplate-infosec/'>GitHub</a>.",
"Hackers can exploit known vulnerabilities in Express/Node if they see that your site is powered by Express. X-Powered-By: Express is sent in every request coming from Express by default. The helmet.hidePoweredBy() middleware will remove the X-Powered-By header. You can also explicitly set the header to something else, to throw people off. e.g. app.use(helmet.hidePoweredBy({ setTo: 'PHP 4.2.0' }))"
],
"challengeSeed": [],
"tests": [
{
"text": "helmet.hidePoweredBy() middleware should be mounted correctly",
@ -52,7 +50,6 @@
"Your page could be put in a <frame> or <iframe> without your consent. This can result in clickjacking attacks, among other things. Clickjacking is a technique of tricking a user into interacting with a page different from what the user thinks it is. This can be obtained executing your page in a malicious context, by mean of iframing. In that context a hacker can put a hidden layer over your page. Hidden buttons can be used to run bad scripts. This middleware sets the X-Frame-Options header. It restricts who can put your site in a frame. It has three modes: DENY, SAMEORIGIN, and ALLOW-FROM.",
"We dont need our app to be framed. You should use helmet.frameguard() passing with the configuration object {action: 'deny'}."
],
"challengeSeed": [],
"tests": [
{
"text": "helmet.frameguard() middleware should be mounted correctly",
@ -80,7 +77,6 @@
"The X-XSS-Protection HTTP header is a basic protection. The browser detects a potential injected script using a heuristic filter. If the header is enabled, the browser changes the script code, neutralizing it.",
"It still has limited support."
],
"challengeSeed": [],
"tests": [
{
"text": "helmet.xssFilter() middleware should be mounted correctly",
@ -100,7 +96,6 @@
"As a reminder, this project is being built upon the following starter project on <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-infosec/'>Glitch</a>, or cloned from <a href='https://github.com/freeCodeCamp/boilerplate-infosec/'>GitHub</a>.",
"Browsers can use content or MIME sniffing to adapt to different datatypes coming from a response. They override the Content-Type headers to guess and process the data. While this can be convenient in some scenarios, it can also lead to some dangerous attacks. This middleware sets the X-Content-Type-Options header to nosniff. This instructs the browser to not bypass the provided Content-Type."
],
"challengeSeed": [],
"tests": [
{
"text": "helmet.noSniff() middleware should be mounted correctly",
@ -120,7 +115,6 @@
"As a reminder, this project is being built upon the following starter project on <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-infosec/'>Glitch</a>, or cloned from <a href='https://github.com/freeCodeCamp/boilerplate-infosec/'>GitHub</a>.",
"Some web applications will serve untrusted HTML for download. Some versions of Internet Explorer by default open those HTML files in the context of your site. This means that an untrusted HTML page could start doing bad things in the context of your pages. This middleware sets the X-Download-Options header to noopen. This will prevent IE users from executing downloads in the trusted sites context."
],
"challengeSeed": [],
"tests": [
{
"text": "helmet.ieNoOpen() middleware should be mounted correctly",
@ -142,7 +136,6 @@
"Configure helmet.hsts() to use HTTPS for the next 90 days. Pass the config object {maxAge: timeInMilliseconds, force: true}. Glitch already has hsts enabled. To override its settings you need to set the field \"force\" to true in the config object. We will intercept and restore the Glitch header, after inspecting it for testing.",
"Note: Configuring HTTPS on a custom website requires the acquisition of a domain, and a SSL/TSL Certificate."
],
"challengeSeed": [],
"tests": [
{
"text": "helmet.hsts() middleware should be mounted correctly",
@ -166,7 +159,6 @@
"As a reminder, this project is being built upon the following starter project on <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-infosec/'>Glitch</a>, or cloned from <a href='https://github.com/freeCodeCamp/boilerplate-infosec/'>GitHub</a>.",
"To improve performance, most browsers prefetch DNS records for the links in a page. In that way the destination ip is already known when the user clicks on a link. This may lead to over-use of the DNS service (if you own a big website, visited by millions people…), privacy issues (one eavesdropper could infer that you are on a certain page), or page statistics alteration (some links may appear visited even if they are not). If you have high security needs you can disable DNS prefetching, at the cost of a performance penalty."
],
"challengeSeed": [],
"tests": [
{
"text": "helmet.dnsPrefetchControl() middleware should be mounted correctly",
@ -186,7 +178,6 @@
"As a reminder, this project is being built upon the following starter project on <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-infosec/'>Glitch</a>, or cloned from <a href='https://github.com/freeCodeCamp/boilerplate-infosec/'>GitHub</a>.",
"If you are releasing an update for your website, and you want the users to always download the newer version, you can (try to) disable caching on clients browser. It can be useful in development too. Caching has performance benefits, which you will lose, so only use this option when there is a real need."
],
"challengeSeed": [],
"tests": [
{
"text": "helmet.noCache() middleware should be mounted correctly",
@ -208,7 +199,6 @@
"By default, directives are wide open, so its important to set the defaultSrc directive as a fallback. Helmet supports both defaultSrc and default-src naming styles. The fallback applies for most of the unspecified directives. In this exercise, use helmet.contentSecurityPolicy(), and configure it setting the defaultSrc directive to [\"self\"] (the list of allowed sources must be in an array), in order to trust only your website address by default. Set also the scriptSrc directive so that you will allow scripts to be downloaded from your website, and from the domain 'trusted-cdn.com'.",
"Hint: in the \"'self'\" keyword, the single quotes are part of the keyword itself, so it needs to be enclosed in double quotes to be working."
],
"challengeSeed": [],
"tests": [
{
"text": "helmet.csp() middleware should be mounted correctly",
@ -246,7 +236,6 @@
"<code>}))</code>",
"We introduced each middleware separately for teaching purpose, and for ease of testing. Using the parent helmet() middleware is easiest, and cleaner, for a real project."
],
"challengeSeed": [],
"tests": [
{
"text": "no tests - it's a descriptive challenge",
@ -269,7 +258,6 @@
"<hr>To begin using BCrypt, add it as a dependency in your project and require it as 'bcrypt' in your server.",
"Submit your page when you think you've got it right."
],
"challengeSeed": [],
"tests": [
{
"text": "BCyrpt is a dependency",
@ -297,7 +285,6 @@
"<pre>bcrypt.hash('passw0rd!', 13, (err, hash) => {\n console.log(hash); //$2a$12$Y.PHPE15wR25qrrtgGkiYe2sXo98cjuMCG1YwSI5rJW1DSJp0gEYS\n bcrypt.compare('passw0rd!', hash, (err, res) => {\n console.log(res); //true\n });\n});</pre>",
"Submit your page when you think you've got it right."
],
"challengeSeed": [],
"tests": [
{
"text": "Async hash generated and correctly compared",
@ -320,7 +307,6 @@
"Now to compare a password input with the new sync hash, you would use the compareSync method: <code>var result = bcrypt.compareSync(myPlaintextPassword, hash);</code> with the result being a boolean true or false. Add this function in and log to the console the result to see it working.",
"Submit your page when you think you've got it right. If you ran into errors during these challenges you can take a look at the example completed code <a href='https://gist.github.com/JosephLivengood/9a2698fb63e42d9d8b4b84235c08b4c4'>here</a>."
],
"challengeSeed": [],
"tests": [
{
"text": "Sync hash generated and correctly compared",

View File

@ -12,7 +12,6 @@
"Working on this project will involve you writing your code on Glitch on our starter project. After completing this project you can copy your public glitch url (to the homepage of your app) into this screen to test it! Optionally you may choose to write your project on another platform but it must be publicly visible for our testing.",
"Start this project on Glitch using <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-project-metricimpconverter/'>this link</a> or clone <a href='https://github.com/freeCodeCamp/boilerplate-project-metricimpconverter/'>this repository</a> on GitHub! If you use Glitch, remember to save the link to your project somewhere safe!"
],
"challengeSeed": [],
"tests": [
{
"text": "I will prevent the client from trying to guess(sniff) the MIME type.",
@ -82,7 +81,6 @@
"Working on this project will involve you writing your code on Glitch on our starter project. After completing this project you can copy your public glitch url (to the homepage of your app) into this screen to test it! Optionally you may choose to write your project on another platform but it must be publicly visible for our testing.",
"Start this project on Glitch using <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-project-issuetracker/'>this link</a> or clone <a href='https://github.com/freeCodeCamp/boilerplate-project-issuetracker/'>this repository</a> on GitHub! If you use Glitch, remember to save the link to your project somewhere safe!"
],
"challengeSeed": [],
"tests": [
{
"text": "Prevent cross site scripting (XSS) attacks.",
@ -132,7 +130,6 @@
"Working on this project will involve you writing your code on Glitch on our starter project. After completing this project you can copy your public glitch url (to the homepage of your app) into this screen to test it! Optionally you may choose to write your project on another platform but must be publicly visible for our testing.",
"Start this project on Glitch using <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-project-library/'>this link</a> or clone <a href='https://github.com/freeCodeCamp/boilerplate-project-library/'>this repository</a> on GitHub! If you use Glitch, remember to save the link to your project somewhere safe!"
],
"challengeSeed": [],
"tests": [
{
"text": "Nothing from my website will be cached in my client.",
@ -190,7 +187,6 @@
"Working on this project will involve you writing your code on Glitch on our starter project. After completing this project you can copy your public glitch url (to the homepage of your app) into this screen to test it! Optionally you may choose to write your project on another platform but must be publicly visible for our testing.",
"Start this project on Glitch using <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-project-stockchecker/'>this link</a> or clone <a href='https://github.com/freeCodeCamp/boilerplate-project-stockchecker/'>this repository</a> on GitHub! If you use Glitch, remember to save the link to your project somewhere safe!"
],
"challengeSeed": [],
"tests": [
{
"text": "Set the content security policies to only allow loading of scripts and css from your server.",
@ -236,7 +232,6 @@
"Working on this project will involve you writing your code on Glitch on our starter project. After completing this project you can copy your public glitch url (to the homepage of your app) into this screen to test it! Optionally you may choose to write your project on another platform but it must be publicly visible for our testing.",
"Start this project on Glitch using <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-project-messageboard/'>this link</a> or clone <a href='https://github.com/freeCodeCamp/boilerplate-project-messageboard/'>this repository</a> on GitHub! If you use Glitch, remember to save the link to your project somewhere safe!"
],
"challengeSeed": [],
"tests": [
{
"text": "Only allow your site to be loading in an iFrame on your own pages.",

View File

@ -11,7 +11,6 @@
"As a reminder, this project is being built upon the following starter project on <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-mochachai/'>Glitch</a>, or cloned from <a href='https://github.com/freeCodeCamp/boilerplate-mochachai/'>GitHub</a>.",
"Use assert.isNull() or assert.isNotNull() to make the tests pass."
],
"challengeSeed": [],
"tests": [
{
"text": "All tests should pass",
@ -39,7 +38,6 @@
"As a reminder, this project is being built upon the following starter project on <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-mochachai/'>Glitch</a>, or cloned from <a href='https://github.com/freeCodeCamp/boilerplate-mochachai/'>GitHub</a>.",
"Use assert.isDefined() or assert.isUndefined() to make the tests pass"
],
"challengeSeed": [],
"tests": [
{
"text": "All tests should pass",
@ -72,7 +70,6 @@
"Use assert.isOk() or assert.isNotOk() to make the tests pass.",
".isOk(truthy) and .isNotOk(falsey) will pass."
],
"challengeSeed": [],
"tests": [
{
"text": "All tests should pass",
@ -106,7 +103,6 @@
".isTrue(true) and .isNotTrue(everything else) will pass.",
".isFalse() and .isNotFalse() also exist."
],
"challengeSeed": [],
"tests": [
{
"text": "All tests should pass",
@ -139,7 +135,6 @@
".equal(), .notEqual()",
".equal() compares objects using '=='"
],
"challengeSeed": [],
"tests": [
{
"text": "All tests should pass",
@ -176,7 +171,6 @@
".strictEqual(), .notStrictEqual()",
".strictEqual() compares objects using '==='"
],
"challengeSeed": [],
"tests": [
{
"text": "All tests should pass",
@ -213,7 +207,6 @@
".deepEqual(), .notDeepEqual()",
".deepEqual() asserts that two object are deep equal"
],
"challengeSeed": [],
"tests": [
{
"text": "All tests should pass",
@ -241,7 +234,6 @@
"As a reminder, this project is being built upon the following starter project on <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-mochachai/'>Glitch</a>, or cloned from <a href='https://github.com/freeCodeCamp/boilerplate-mochachai/'>GitHub</a>.",
".isAbove() => a > b , .isAtMost() => a <= b"
],
"challengeSeed": [],
"tests": [
{
"text": "All tests should pass",
@ -277,7 +269,6 @@
"As a reminder, this project is being built upon the following starter project on <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-mochachai/'>Glitch</a>, or cloned from <a href='https://github.com/freeCodeCamp/boilerplate-mochachai/'>GitHub</a>.",
".isBelow() => a < b , .isAtLeast => a >= b"
],
"challengeSeed": [],
"tests": [
{
"text": "All tests should pass",
@ -317,7 +308,6 @@
"Choose the minimum range (3rd parameter) to make the test always pass",
"it should be less than 1"
],
"challengeSeed": [],
"tests": [
{
"text": "All tests should pass",
@ -344,7 +334,6 @@
"description": [
"As a reminder, this project is being built upon the following starter project on <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-mochachai/'>Glitch</a>, or cloned from <a href='https://github.com/freeCodeCamp/boilerplate-mochachai/'>GitHub</a>."
],
"challengeSeed": [],
"tests": [
{
"text": "All tests should pass",
@ -371,7 +360,6 @@
"description": [
"As a reminder, this project is being built upon the following starter project on <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-mochachai/'>Glitch</a>, or cloned from <a href='https://github.com/freeCodeCamp/boilerplate-mochachai/'>GitHub</a>."
],
"challengeSeed": [],
"tests": [
{
"text": "All tests should pass",
@ -399,7 +387,6 @@
"As a reminder, this project is being built upon the following starter project on <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-mochachai/'>Glitch</a>, or cloned from <a href='https://github.com/freeCodeCamp/boilerplate-mochachai/'>GitHub</a>.",
"#isString asserts that the actual value is a string."
],
"challengeSeed": [],
"tests": [
{
"text": "All tests should pass",
@ -432,7 +419,6 @@
"#include (on #notInclude ) works for strings too !!",
"It asserts that the actual string contains the expected substring"
],
"challengeSeed": [],
"tests": [
{
"text": "All tests should pass",
@ -461,7 +447,6 @@
"#match Asserts that the actual value",
"matches the second argument regular expression."
],
"challengeSeed": [],
"tests": [
{
"text": "All tests should pass",
@ -490,7 +475,6 @@
"#property asserts that the actual object has a given property.",
"Use #property or #notProperty where appropriate"
],
"challengeSeed": [],
"tests": [
{
"text": "All tests should pass",
@ -523,7 +507,6 @@
"#typeOf asserts that values type is the given string, as determined by Object.prototype.toString.",
"Use #typeOf or #notTypeOf where appropriate"
],
"challengeSeed": [],
"tests": [
{
"text": "All tests should pass",
@ -564,7 +547,6 @@
"#instanceOf asserts that an object is an instance of a constructor.",
"Use #instanceOf or #notInstanceOf where appropriate"
],
"challengeSeed": [],
"tests": [
{
"text": "All tests should pass",
@ -601,7 +583,6 @@
"Replace assert.fail(). Test the status and the text.response. Make the test pass.",
"Don't send a name in the query, the endpoint with responds with 'hello Guest'."
],
"challengeSeed": [],
"tests": [
{
"text": "All tests should pass",
@ -630,7 +611,6 @@
"Replace assert.fail(). Test the status and the text.response. Make the test pass.",
"Send you name in the query appending ?name=<your_name>, the endpoint with responds with 'hello <your_name>'."
],
"challengeSeed": [],
"tests": [
{
"text": "All tests should pass",
@ -667,7 +647,6 @@
"Check for 1) status, 2) type, 3) body.name, 4) body.surname",
"Follow the assertion order above, We rely on it."
],
"challengeSeed": [],
"tests": [
{
"text": "All tests should pass",
@ -706,7 +685,6 @@
"Check for 1) status, 2) type, 3) body.name, 4) body.surname",
"Follow the assertion order above, We rely on it."
],
"challengeSeed": [],
"tests": [
{
"text": "All tests should pass",
@ -745,7 +723,6 @@
"For these challenges we are using Zombie.JS. It's a lightweight browser which is totally based on JS, without relying on additional binaries to be installed. This feature makes it usable in an environment such as Glitch. There are many other (more powerful) options.<br>",
"Look at the examples in the code for the exercise directions Follow the assertions order, We rely on it."
],
"challengeSeed": [],
"tests": [
{
"text": "All tests should pass",
@ -782,7 +759,6 @@
"This exercise is similar to the preceding.",
"Look at the code for directions. Follow the assertions order, We rely on it."
],
"challengeSeed": [],
"tests": [
{
"text": "All tests should pass",

View File

@ -73,7 +73,6 @@
"testString": "assert.equal(sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3], [5, 3, 9, 8], [1]).length, 8, '<code>sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3], [5, 3, 9, 8], [1])</code> should contain only eight elements.');"
}
],
"type": "bonfire",
"MDNlinks": [
"Array.prototype.reduce()",
"Symmetric Difference"
@ -158,7 +157,6 @@
"testString": "assert.deepEqual(updateInventory([[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\"]], '<code>updateInventory([[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>.');"
}
],
"type": "bonfire",
"MDNlinks": [
"Global Array Object"
],
@ -272,7 +270,6 @@
"testString": "assert.strictEqual(permAlone('aaabb'), 12, '<code>permAlone(\"aaabb\")</code> should return 12.');"
}
],
"type": "bonfire",
"MDNlinks": [
"Permutations",
"RegExp"
@ -358,7 +355,6 @@
"testString": "assert.deepEqual(pairwise([], 100), 0, '<code>pairwise([], 100)</code> should return 0.');"
}
],
"type": "bonfire",
"MDNlinks": [
"Array.prototype.reduce()"
],
@ -443,7 +439,6 @@
"testString": "assert.strictEqual(code.search(/\\.sort\\(/), -1, '<code>bubbleSort</code> should not use the built-in <code>.sort()</code> method.');"
}
],
"type": "waypoint",
"solutions": [],
"challengeType": 1,
"translations": {},
@ -500,7 +495,6 @@
"testString": "assert.strictEqual(code.search(/\\.sort\\(/), -1, '<code>selectionSort</code> should not use the built-in <code>.sort()</code> method.');"
}
],
"type": "waypoint",
"solutions": [],
"challengeType": 1,
"translations": {},
@ -557,7 +551,6 @@
"testString": "assert.strictEqual(code.search(/\\.sort\\(/), -1, '<code>insertionSort</code> should not use the built-in <code>.sort()</code> method.');"
}
],
"type": "waypoint",
"solutions": [],
"challengeType": 1,
"translations": {},
@ -615,7 +608,6 @@
"testString": "assert.strictEqual(code.search(/\\.sort\\(/), -1, '<code>quickSort</code> should not use the built-in <code>.sort()</code> method.');"
}
],
"type": "waypoint",
"solutions": [],
"challengeType": 1,
"translations": {},
@ -676,7 +668,6 @@
"testString": "assert.strictEqual(code.search(/\\.sort\\(/), -1, '<code>mergeSort</code> should not use the built-in <code>.sort()</code> method.');"
}
],
"type": "waypoint",
"solutions": [],
"challengeType": 1,
"translations": {},

View File

@ -39,7 +39,6 @@
"testString": "assert(i32View.length === 16, 'Your <code>i32View</code> view of your buffer should be 16 elements long.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [
"var buffer = new ArrayBuffer(64);\nvar i32View = new Int32Array(buffer);"
@ -93,7 +92,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -163,7 +161,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -238,7 +235,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -305,7 +301,6 @@
"testString": "assert((function(){var test = new PriorityQueue(); test.enqueue(['A', 5]); test.enqueue(['B', 5]); test.enqueue(['C', 5]); test.enqueue(['D', 3]); test.enqueue(['E', 1]); test.enqueue(['F', 7]); var result = []; result.push(test.dequeue()); result.push(test.dequeue()); result.push(test.dequeue()); result.push(test.dequeue()); result.push(test.dequeue()); result.push(test.dequeue()); return result.join('') === 'EDABCF';}()), 'The priority queue should return items with a higher priority before items with a lower priority and return items in first-in-first-out order otherwise.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [
"function PriorityQueue () { \n this.collection = []; \n this.printCollection = function(){ \n console.log(this.collection); \n }; \n this.size = function() { \n return this.collection.length; \n }; \n this.isEmpty = function() { \n return this.size() > 0 ? false : true; \n }; \n this.enqueue = function (newitem) {\n if (this.isEmpty()) {\n return this.collection.push(newitem);\n }\n\n this.collection = this.collection.reverse();\n var found_index = this.collection.findIndex(function (item) {\n return newitem[1] >= item[1];\n });\n if (found_index === -1) {\n this.collection.push(newitem);\n } else {\n this.collection.splice(found_index, 0, newitem);\n }\n this.collection = this.collection.reverse();\n}; \n this.dequeue = function() { \n if (!this.isEmpty()) { \n return this.collection.shift()[0]; \n } else { \n return 'The queue is empty.' \n } \n }; \n }"
@ -373,7 +368,6 @@
"testString": "assert((function(){ var test = new CircularQueue(3); test.enqueue(17); test.enqueue(32); test.enqueue(591); return test.dequeue() === 17 && test.dequeue() === 32 && test.dequeue() === 591 && test.dequeue() === null && test.dequeue() === null && test.dequeue() === null && test.dequeue() === null && test.enqueue(100) === 100 && test.dequeue() === 100; })(), 'Trying to dequeue past the write pointer returns <code>null</code> and does not advance the write pointer.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [
"class CircularQueue { \n constructor(size) { \n this.queue = []; \n this.read = 0; \n this.write = 0; \n this.max = size - 1; \n while (size > 0) { \n this.queue.push(null); \n size--; \n } \n } \n print() { \n return this.queue; \n } \n enqueue(item) { \n if (this.queue[this.write] === null) { \n this.queue[this.write] = item; \n if (this.write === this.max) { \n this.write = 0; \n } else { \n this.write++; \n } \n return item; \n } \n return null; \n } \n dequeue() { \n if (this.queue[this.read] !== null) { \n var item = this.queue[this.read]; \n this.queue[this.read] = null; \n if (this.read === this.max) { \n this.read = 0; \n } else { \n this.read++; \n } \n return item; \n } else { \n return null; \n } \n } \n }"
@ -453,7 +447,6 @@
"testString": "assert((function(){var test = new Set(); test.add('a'); var result = test.add('a'); return (result != undefined) && (result === false);}()), 'Your <code>add</code> method should return <code>false</code> when a duplicate value is added.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [
"function Set() {var collection = []; this.has = function(e){return(collection.indexOf(e) !== -1);};this.values = function() {return collection;};this.add = function(element) {if (!this.has(element)) {collection.push(element);return true;} else {return false;}};}"
@ -506,7 +499,6 @@
"testString": "assert((function(){var test = new Set(); test.add('a');test.add('b');test.remove('a'); var vals = test.values(); return (vals[0] === 'b' && vals.length === 1)}()), 'Your <code>remove</code> method should remove the given item from the set.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [
"function Set() {var collection = []; this.has = function(e){return(collection.indexOf(e) !== -1);};this.values = function() {return collection;};this.add = function(element) {if (!this.has(element)) {collection.push(element);return true;} else {return false;}};this.remove = function(element) {if(this.has(element)) {var i = collection.indexOf(element);collection.splice(i, 1);return true;}return false;};}"
@ -563,7 +555,6 @@
"testString": "assert((function(){var test = new Set(); test.add('a');test.add('b');test.remove('a');return (test.size() === 1)}()), 'The <code>size</code> method should return the number of elements in the collection.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [
"function Set() {var collection = []; this.has = function(e){return(collection.indexOf(e) !== -1);};this.values = function() {return collection;};this.add = function(element) {if (!this.has(element)) {collection.push(element);return true;} else {return false;}};this.remove = function(element) {if(this.has(element)) {var i = collection.indexOf(element);collection.splice(i, 1);return true;}return false;};this.size = function() {return collection.length;};}"
@ -630,7 +621,6 @@
"testString": "assert((function(){var setA = new Set(); var setB = new Set(); setA.add('a'); setA.add('b'); setA.add('c'); setB.add('c'); setB.add('d'); var unionSetAB = setA.union(setB); var final = unionSetAB.values(); return (final.indexOf('a') !== -1 && final.indexOf('b') !== -1 && final.indexOf('c') !== -1 && final.indexOf('d') !== -1 && final.length === 4)})(), 'The proper collection was returned');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [
"function Set() {var collection = []; this.has = function(e){return(collection.indexOf(e) !== -1);};this.values = function() {return collection;};this.add = function(element) {if (!this.has(element)) {collection.push(element);return true;} else {return false;}};this.remove = function(element) {if(this.has(element)) {var i = collection.indexOf(element);collection.splice(i, 1);return true;}return false;};this.size = function() {return collection.length;};this.union = function(set) {var u = new Set();var c = this.values();var s = set.values();c.forEach(function(element){u.add(element);});s.forEach(function(element){u.add(element);});return u;};}"
@ -702,7 +692,6 @@
"testString": "assert(function(){ var setA = new Set(); var setB = new Set(); setA.add('a'); setA.add('b'); setA.add('c'); setB.add('c'); setB.add('d'); var intersectionSetAB = setA.intersection(setB); return (intersectionSetAB.size() === 1 && intersectionSetAB.values()[0] === 'c')}, 'The proper collection was returned');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [
"function Set() {var collection = []; this.has = function(e){return(collection.indexOf(e) !== -1);};this.values = function() {return collection;};this.add = function(element) {if (!this.has(element)) {collection.push(element);return true;} else {return false;}};this.remove = function(element) {if(this.has(element)) {var i = collection.indexOf(element);collection.splice(i, 1);return true;}return false;};this.size = function() {return collection.length;};this.union = function(set) {var u = new Set();var c = this.values();var s = set.values();c.forEach(function(element){u.add(element);});s.forEach(function(element){u.add(element);});return u;};this.intersection = function(set) {var i = new Set();var c = this.values();c.forEach(function(element){if(s.has(element)) i.add(element);});};}"
@ -786,7 +775,6 @@
"testString": "assert(function(){var setA = new Set(); var setB = new Set(); setA.add('a'); setA.add('b'); setA.add('c'); setB.add('c'); setB.add('d'); var differenceSetAB = setA.difference(setB); return (differenceSetAB.size() === 2) && (differenceSetAB.values() === [ 'a', 'b' ])}, 'The proper collection was returned');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [
"function Set() {var collection = []; this.has = function(e){return(collection.indexOf(e) !== -1);};this.values = function() {return collection;};this.add = function(element) {if (!this.has(element)) {collection.push(element);return true;} else {return false;}};this.remove = function(element) {if(this.has(element)) {var i = collection.indexOf(element);collection.splice(i, 1);return true;}return false;};this.size = function() {return collection.length;};this.union = function(set) {var u = new Set();var c = this.values();var s = set.values();c.forEach(function(element){u.add(element);});s.forEach(function(element){u.add(element);});return u;};this.intersection = function(set) {var i = new Set();var c = this.values();c.forEach(function(element){if(s.has(element)) i.add(element);});};this.difference = function(set) {var d = new Set();var c = this.values();c.forEach(function(e){if(!set.has(e)) d.add(e);});};}"
@ -897,7 +885,6 @@
"testString": "assert(function(){var setA = new Set(); var setB = new Set(); setA.add('a'); setA.add('b'); setB.add('c'); setB.add('d'); var subsetSetAB = setA.subset(setB); return (subsetSetAB === false)}, \"<code>['a', 'b'].subset(['c', 'd'])</code> should return <code>false</code>\");"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [
"function Set() {var collection = []; this.has = function(e){return(collection.indexOf(e) !== -1);};this.values = function() {return collection;};this.add = function(element) {if (!this.has(element)) {collection.push(element);return true;} else {return false;}};this.remove = function(element) {if(this.has(element)) {var i = collection.indexOf(element);collection.splice(i, 1);return true;}return false;};this.size = function() {return collection.length;};this.union = function(set) {var u = new Set();var c = this.values();var s = set.values();c.forEach(function(element){u.add(element);});s.forEach(function(element){u.add(element);});return u;};this.intersection = function(set) {var i = new Set();var c = this.values();c.forEach(function(element){if(s.has(element)) i.add(element);});};this.difference = function(set) {var d = new Set();var c = this.values();c.forEach(function(e){if(!set.has(e)) d.add(e);});};this.subset = function(set) {var isSubset = true;var c = this.values();c.forEach(function(e){if(!set.has(e)) isSubset = false;});return isSubset;};}"
@ -1010,7 +997,6 @@
"testString": "assert(function(){var test = checkSet(); return (test.size == 6) && test.has(1) && test.has(2) && test.has(3) && test.has('Taco') && test.has('Cat') && test.has('Awesome');}, 'Your <code>Set</code> should only contains the values <code>1, 2, 3, Taco, Cat, Awesome</code>.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [
"function checkSet(){var set = new Set([1,2,3,'Taco','Cat','Awesome']);\nreturn set;}"
@ -1057,7 +1043,6 @@
"testString": "assert(function(){var test = checkSet(); return test.has(1) && test.has(3) && test.has(4) && test.size === 3}, 'Your Set should contain the values 1, 3, & 4');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [
"function checkSet(){\nvar set = new Set([1,2,3,4,5]);\nset.delete(2);\nset.delete(5);\nreturn set;}"
@ -1103,7 +1088,6 @@
"testString": "assert(function(){var test = checkSet([4,5,6], 3); test === [ false, 3 ]}, '<code>checkSet([4, 5, 6], 3)</code> should return [ false, 3 ]');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [
"function checkSet(arrToBeSet, checkValue){\nvar set = new Set(arrToBeSet);\nvar result = [\nset.has(checkValue),\nset.size\n];\nreturn result;\n}"
@ -1149,7 +1133,6 @@
"testString": "assert(function(){var test = checkSet(new Set([1,2,3,4,5,6,7])); test === [ 1, 2, 3, 4, 5, 6, 7 ]}, 'Your Set was returned correctly!');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [
"function checkSet(set){\nreturn [...set];}"
@ -1218,7 +1201,6 @@
"testString": "assert((function() { var test = false; if (typeof Map !== 'undefined') { test = new Map() }; test.add('b','b'); test.add('c','d'); test.remove('asdfas'); var init = test.size(); test.clear(); return (init == 2 && test.size() == 0)})(), 'The clear method empties the map and the size method returns the number of items present in the map.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -1264,7 +1246,6 @@
"testString": "assert(myMap.get('freeCodeCamp') === 'Awesome!', 'myMap contains the key value pair <code>freeCodeCamp</code>, <code>Awesome!</code>.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -1326,7 +1307,6 @@
"testString": "assert((function() { var test = false; if (typeof HashTable !== 'undefined') { test = new HashTable() }; called = 0; test.add('key1','value1'); test.add('1key','value2'); test.add('ke1y','value3'); return (test.lookup('key1') === 'value1' && test.lookup('1key') == 'value2' && test.lookup('ke1y') == 'value3')})(), 'The hash table handles collisions.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -1385,7 +1365,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1446,7 +1425,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1520,7 +1498,6 @@
"class Node {\n constructor (element) {\n this.element = element;\n this.next = null;\n }\n}\n\nclass LinkedList {\n constructor () {\n this._length = 0;\n this._head = null;\n }\n\n head () {\n return this._head;\n }\n\n size () {\n return this._length;\n }\n\n add (element) {\n const node = new Node(element);\n\n if (this._head === null) {\n this._head = node;\n } else {\n let current = this._head;\n\n while (current.next !== null) {\n current = current.next;\n }\n\n current.next = node; \n }\n \n ++this._length;\n }\n \n remove (element) {\n if (this._head === null) return;\n \n let previous;\n let current = this._head;\n \n while (current.next !== null && current.element !== element) {\n previous = current;\n current = current.next;\n }\n \n if (previous) {\n previous.next = current.next;\n } else {\n this._head = current.next;\n }\n \n --this._length;\n }\n}"
],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1610,7 +1587,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1718,7 +1694,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1817,7 +1792,6 @@
],
"solutions": [],
"hints": [],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"challengeType": 1,
"translations": {},
@ -1916,7 +1890,6 @@
"testString": "assert((function() { var test = false; if (typeof DoublyLinkedList !== 'undefined') { test = new DoublyLinkedList() }; test.add(25); test.add(35); test.add(60); test.remove(60); return ( test.print().join('') == '2535' ) })(), 'The last item can be removed from the list.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -2007,7 +1980,6 @@
"testString": "assert((function() { var test = false; if (typeof DoublyLinkedList !== 'undefined') { test = new DoublyLinkedList() }; test.add(11); test.add(22); test.add(33); test.reverse(); return (test.printReverse().join('') == '112233'); })(), 'The next and previous references are correctly maintained when a list is reversed.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -2120,7 +2092,6 @@
"testString": "assert((function() { var test = false; if (typeof BinarySearchTree !== 'undefined') { test = new BinarySearchTree() } else { return false; }; if (typeof test.findMin !== 'function') { return false; }; if (typeof test.findMax !== 'function') { return false; }; return (test.findMin() == null && test.findMax() == null) })(), 'The <code>findMin</code> and <code>findMax</code> methods return <code>null</code> for an empty tree.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -2205,7 +2176,6 @@
"testString": "assert((function() { var test = false; if (typeof BinarySearchTree !== 'undefined') { test = new BinarySearchTree() } else { return false; }; if (typeof test.add !== 'function') { return false; }; test.add(4); return test.add(4) == null; })(), 'Adding an element that already exists returns <code>null</code>');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -2289,7 +2259,6 @@
"testString": "assert((function() { var test = false; if (typeof BinarySearchTree !== 'undefined') { test = new BinarySearchTree() } else { return false; }; if (typeof test.isPresent !== 'function') { return false; }; return test.isPresent(5) == false; })(), '<code>isPresent</code> handles cases where the tree is empty.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -2391,7 +2360,6 @@
"testString": "assert((function() { var test = false; if (typeof BinarySearchTree !== 'undefined') { test = new BinarySearchTree() } else { return false; }; if (typeof test.isBalanced !== 'function') { return false; }; test.add(4); test.add(1); test.add(7); test.add(87); test.add(34); test.add(45); test.add(73); test.add(8); return test.isBalanced(); })(), 'The <code>isBalanced</code> method returns true if the tree is a balanced binary search tree.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -2504,7 +2472,6 @@
"testString": "assert((function() { var test = false; if (typeof BinarySearchTree !== 'undefined') { test = new BinarySearchTree() } else { return false; }; if (typeof test.postorder !== 'function') { return false; }; return (test.postorder() == null); })(), 'The <code>postorder</code> method returns <code>null</code> for an empty tree.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -2601,7 +2568,6 @@
"testString": "assert((function() { var test = false; if (typeof BinarySearchTree !== 'undefined') { test = new BinarySearchTree() } else { return false; }; if (typeof test.reverseLevelOrder !== 'function') { return false; }; return (test.reverseLevelOrder() == null); })(), 'The <code>reverseLevelOrder</code> method returns <code>null</code> for an empty tree.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -2694,7 +2660,6 @@
"testString": "assert((function() { var test = false; if (typeof BinarySearchTree !== 'undefined') { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== 'function') { return false; }; test.add(5); test.add(3); test.add(7); test.add(6); test.add(10); test.add(12); test.remove(3); test.remove(12); test.remove(10); return (test.inorder().join('') == '567'); })(), 'The <code>remove</code> method removes leaf nodes from the tree');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -2835,7 +2800,6 @@
"testString": "assert((function() { var test = false; if (typeof BinarySearchTree !== 'undefined') { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== 'function') { return false; }; test.add(15); test.add(27); test.remove(15); return (test.inorder().join('') == '27'); })(), 'Removing the root in a tree with two nodes sets the second to be the root.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -3026,7 +2990,6 @@
"testString": "assert((function() { var test = false; if (typeof BinarySearchTree !== 'undefined') { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== 'function') { return false; }; test.add(100); test.add(50); test.add(300); test.remove(100); return (test.inorder().join('') == 50300); })(), 'The root can be removed on a tree of three nodes.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -3209,7 +3172,6 @@
"testString": "assert((function() { var test = false; if (typeof BinarySearchTree !== 'undefined') { test = new BinarySearchTree() } else { return false; }; if (typeof test.invert !== 'function') { return false; }; return (test.invert() == null); })(), 'Inverting an empty tree returns <code>null</code>.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -3318,7 +3280,6 @@
"testString": "assert((function testTrie() { var test = false; if (typeof Trie !== 'undefined') { test = new Trie() } else { return false; }; test.add('hop'); test.add('hops'); test.add('hopped'); test.add('hoppy'); test.add('hope'); return (test.isWord('hop') && !test.isWord('ho') && test.isWord('hopped') && !test.isWord('hopp') && test.isWord('hoppy') && !test.isWord('hoping')); }()), 'The isWord method returns true only for words added to the trie and false for all other words.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -3389,7 +3350,6 @@
"testString": "assert((function() { var test = false; if (typeof MaxHeap !== 'undefined') { test = new MaxHeap() } else { return false; }; test.insert(50); test.insert(100); test.insert(700); test.insert(32); test.insert(51); let result = test.print(); return ((result.length == 5) ? result[0] == 700 : result[1] == 700) })(), 'The insert method adds elements according to the max heap property.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -3442,7 +3402,6 @@
"testString": "assert((function() { var test = false; if (typeof MaxHeap !== 'undefined') { test = new MaxHeap() } else { return false; }; test.insert(30); test.insert(300); test.insert(500); test.insert(10); let result = []; result.push(test.remove()); result.push(test.remove()); result.push(test.remove()); result.push(test.remove()); return (result.join('') == '5003003010') })(), 'The remove method removes the greatest element from the max heap while maintaining the max heap property.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -3493,7 +3452,6 @@
"testString": "assert((function() { var test = false; if (typeof MinHeap !== 'undefined') { test = new MinHeap() } else { return false; }; test.insert(3); test.insert(12); test.insert(5); test.insert(10); test.insert(1); test.insert(27); test.insert(42); test.insert(57); test.insert(5); var result = test.sort(); return (isSorted(result)); })(), 'The sort method returns an array containing all items added to the min heap in sorted order.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [],
"challengeType": 1,
@ -3558,7 +3516,6 @@
"testString": "assert(undirectedAdjList.Jeff.indexOf(\"Jenny\") !== -1 && undirectedAdjList.Jenny.indexOf(\"Jeff\") !== -1, 'There should be an edge between <code>Jeff</code> and <code>Jenny</code>.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [
"var undirectedAdjList = {\n\"James\": [\"Jeff\"],\"Jill\": [\"Jenny\"],\"Jenny\": [\"Jill\", \"Jeff\"],\n\"Jeff\": [\"James\", \"Jenny\"]\n};"
@ -3618,7 +3575,6 @@
"testString": "assert((adjMatUndirected[3][4] === 1) && (adjMatUndirected[4][3] === 1), 'There should be an edge between the fourth and fifth node.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [
"var adjMatUndirected = [[0, 0, 1, 1, 0],[0, 0, 0, 0, 0],[1, 0, 0, 0, 1],[1, 0, 0, 0, 1],[0, 0, 1, 1, 0]];"
@ -3681,7 +3637,6 @@
"testString": "assert((incMatUndirected[1][3] === 1) && (incMatUndirected[3][3] === 1), 'There should be a fourth edge between the second and fourth node.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [
"var incMatUndirected = [[1, 0, 0, 0],[1, 1, 0, 1],[0, 1, 1, 0],[0, 0, 0, 1],[0, 0, 1, 0]];"
@ -3738,7 +3693,6 @@
"testString": "assert((function() { var graph = [[0, 1], [1, 0]]; var results = bfs(graph, 0); return isEquivalent(results, {0: 0, 1: 1})})(), 'The input graph <code>[[0, 1], [1, 0]]</code> with a start node of <code>0</code> should return <code>{0: 0, 1: 1}</code>');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [
"function bfs(graph, root) {\n// Distance object returned\nvar nodesLen = {};\n// Set all distances to infinity\nfor (var i = 0; i < graph.length; i++) {\nnodesLen[i] = Infinity;\n}\nnodesLen[root] = 0; // ...except root node\nvar queue = [root]; // Keep track of nodes to visit\nvar current; // Current node traversing\n// Keep on going until no more nodes to traverse\nwhile (queue.length !== 0) {\ncurrent = queue.shift();\n// Get adjacent nodes from current node\nvar curConnected = graph[current]; // Get layer of edges from current\nvar neighborIdx = []; // List of nodes with edges\nvar idx = curConnected.indexOf(1); // Get first edge connection\nwhile (idx !== -1) {\nneighborIdx.push(idx); // Add to list of neighbors\nidx = curConnected.indexOf(1, idx + 1); // Keep on searching\n}\n// Loop through neighbors and get lengths\nfor (var j = 0; j < neighborIdx.length; j++) {\n// Increment distance for nodes traversed\nif (nodesLen[neighborIdx[j]] === Infinity) {\nnodesLen[neighborIdx[j]] = nodesLen[current] + 1;\nqueue.push(neighborIdx[j]); // Add new neighbors to queue\n}\n}\n}\nreturn nodesLen;}"
@ -3842,7 +3796,6 @@
"testString": "assert((function() { var graph = [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]]; return dfs(graph, 0);})().length === 2, 'The input graph <code>[[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]]</code> with a start node of <code>0</code> should return an array with two elements.');"
}
],
"type": "waypoint",
"releasedOn": "Feb 17, 2017",
"solutions": [
"function dfs(graph, root) { var stack = []; var tempV; var visited = []; var tempVNeighbors = []; stack.push(root); while (stack.length > 0) { tempV = stack.pop(); if (visited.indexOf(tempV) == -1) { visited.push(tempV); tempVNeighbors = graph[tempV]; for (var i = 0; i < tempVNeighbors.length; i++) { if (tempVNeighbors[i] == 1) { stack.push(i); }}}} return visited;}"

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,6 @@
"challenges": [
{
"title": "100 doors",
"type": "Waypoint",
"description": [
"<p>There are 100 doors in a row that are all initially closed. You make 100 passes by the doors. The first time through, visit every door and 'toggle' the door (if the door is closed, open it; if it is open, close it). The second time, only visit every 2nd door (i.e., door #2, #4, #6, ...) and toggle it. The third time, visit every 3rd door (i.e., door #3, #6, #9, ...), etc., until you only visit the 100th door.</p>",
"<p>Implement a function to determine the state of the doors after the last pass. Return the final result in an array, with only the door number included in the array if it is open.</p>"
@ -51,7 +50,6 @@
},
{
"title": "24 game",
"type": "Waypoint",
"description": [
"<p>Implement a function that takes a string of four digits as its argument, with each digit from 1 ──► 9 (inclusive) with repetitions allowed, and returns an arithmetic expression that evaluates to the number 24. If no such solution exists, return \"no solution exists.\"</p>",
"<p>Rules:</p>",
@ -135,7 +133,6 @@
},
{
"title": "9 billion names of God the integer",
"type": "Waypoint",
"description": [
"<p>This task is a variation of the <a href=\"https://en.wikipedia.org/wiki/The Nine Billion Names of God#Plot_summary\" title=\"wp: The Nine Billion Names of God#Plot_summary\">short story by Arthur C. Clarke</a>.</p>",
"<p>(Solvers should be aware of the consequences of completing this task.)</p>",
@ -213,7 +210,6 @@
},
{
"title": "ABC Problem",
"type": "Waypoint",
"description": [
"<p>You are given a collection of ABC blocks (e.g., childhood alphabet blocks). There are 20 blocks with two letters on each block. A complete alphabet is guaranteed amongst all sides of the blocks. The sample collection of blocks:</p>",
"<p>(B O)</p>",
@ -300,7 +296,6 @@
},
{
"title": "Abundant, deficient and perfect number classifications",
"type": "Waypoint",
"description": [
"<p>These define three classifications of positive integers based on their <a href=\"http://rosettacode.org/wiki/Proper divisors\" title=\"Proper divisors\">proper divisors</a>.</p>",
"<p>Let $P(n)$ be the sum of the proper divisors of n where proper divisors are all positive integers n other than n itself.</p>",
@ -355,7 +350,6 @@
},
{
"title": "Accumulator factory",
"type": "Waypoint",
"description": [
"<p>Create a function that takes a single (numeric) argument and returns another function that is an accumulator. The returned accumulator function in turn also takes a single numeric argument, and returns the sum of all the numeric values passed in so far to that accumulator (including the initial value passed when the accumulator was created).</p>",
"<p>Rules:</p>",
@ -410,7 +404,6 @@
},
{
"title": "Ackermann function",
"type": "Waypoint",
"description": [
"<p>The Ackermann function is a classic example of a recursive function, notable especially because it is not a primitive recursive function. It grows very quickly in value, as does the size of its call tree.</p>",
"<p>The Ackermann function is usually defined as follows:</p>",
@ -467,7 +460,6 @@
},
{
"title": "Align columns",
"type": "Waypoint",
"description": [
"<p>Given a text file of many lines, where fields within a line are delineated by a single <code>$</code> character, write a program that aligns each column of fields by ensuring that words in each column are separated by at least one space. Further, allow for each word in a column to be either left justified, right justified, or center justified within its column.</p>",
"<p>Use the following text to test your programs:</p>",
@ -591,7 +583,6 @@
},
{
"title": "Amicable pairs",
"type": "Waypoint",
"description": [
"Two integers $N$ and $M$ are said to be <a href=\"https://en.wikipedia.org/wiki/Amicable numbers\" title=\"wp: Amicable numbers\">amicable pairs</a> if $N \\neq M$ and the sum of the <a href=\"http://rosettacode.org/wiki/Proper divisors\" title=\"Proper divisors\">proper divisors</a> of $N$ ($\\mathrm{sum}(\\mathrm{propDivs}(N))$) $= M$ as well as $\\mathrm{sum}(\\mathrm{propDivs}(M)) = N$.",
"Example:",
@ -664,7 +655,6 @@
},
{
"title": "Averages/Mode",
"type": "Waypoint",
"description": [
"<p>Write a program to find the <a href=\"https://en.wikipedia.org/wiki/Mode (statistics)\" title=\"wp: Mode (statistics)\">mode</a> value of a collection.</p><p>The case where the collection is empty may be ignored. Care must be taken to handle the case where the mode is non-unique.</p><p>If it is not appropriate or possible to support a general collection, use a vector (array), if possible. If it is not appropriate or possible to support an unspecified value type, use integers.</p>"
],
@ -709,7 +699,6 @@
},
{
"title": "Averages/Pythagorean means",
"type": "Waypoint",
"description": [
"<p class='rosetta__paragraph'>Compute all three of the <a class='rosetta__link--wiki' href='https://en.wikipedia.org/wiki/Pythagorean means' title='wp: Pythagorean means'>Pythagorean means</a> of the set of integers <big>1</big> through <big>10</big> (inclusive).</p><p class='rosetta__paragraph'>Show that <big>$A(x_1,\\ldots,x_n) \\geq G(x_1,\\ldots,x_n) \\geq H(x_1,\\ldots,x_n)$</big> for this set of positive integers.</p> The most common of the three means, the <a class='rosetta__link--rosetta' href='http://rosettacode.org/wiki/Averages/Arithmetic mean' title='Averages/Arithmetic mean'>arithmetic mean</a>, is the sum of the list divided by its length: <big>$ A(x_1, \\ldots, x_n) = \\frac{x_1 + \\cdots + x_n}{n}$</big>The <a class='rosetta__link--wiki' href='https://en.wikipedia.org/wiki/Geometric mean' title='wp: Geometric mean'>geometric mean</a> is the $n$th root of the product of the list: <big>$ G(x_1, \\ldots, x_n) = \\sqrt[n]{x_1 \\cdots x_n} $</big>The <a class='rosetta__link--wiki' href='https://en.wikipedia.org/wiki/Harmonic mean' title='wp: Harmonic mean'>harmonic mean</a> is $n$ divided by the sum of the reciprocal of each item in the list: <big>$ H(x_1, \\ldots, x_n) = \\frac{n}{\\frac{1}{x_1} + \\cdots + \\frac{1}{x_n}} $</big>",
"<p class='rosetta__paragraph'>Assume the input is an ordered array of all inclusive numbers.</p>",
@ -769,7 +758,6 @@
},
{
"title": "Averages/Root mean square",
"type": "Waypoint",
"description": [
"<p>Compute the <a href=\"https://en.wikipedia.org/wiki/Root mean square\" title=\"wp: Root mean square\">Root mean square</a> of the numbers 1 through 10 inclusive.</p>",
"<p>The root mean square is also known by its initials RMS (or rms), and as the quadratic mean.</p><p>The RMS is calculated as the mean of the squares of the numbers, square-rooted:</p>",
@ -811,7 +799,6 @@
},
{
"title": "Babbage problem",
"type": "Waypoint",
"description": [
"<p><a href=\"https://en.wikipedia.org/wiki/Charles_Babbage\" title=\"wp: Charles_Babbage\">Charles Babbage</a>, looking ahead to the sorts of problems his Analytical Engine would be able to solve, gave this example:</p>",
"<blockquote>What is the smallest positive integer whose square ends in the digits 269,696?</blockquote>",
@ -858,7 +845,6 @@
},
{
"title": "Balanced brackets",
"type": "Waypoint",
"description": [
"<p>Determine whether a generated string of brackets is balanced; that is, whether it consists entirely of pairs of opening/closing brackets (in that order), none of which mis-nest.</p>",
"Examples:",
@ -993,7 +979,6 @@
},
{
"title": "Circles of given radius through two points",
"type": "Waypoint",
"description": [
"<p>Given two points on a plane and a radius, usually two circles of given radius can be drawn through the points.</p>",
"Exceptions:",
@ -1083,7 +1068,6 @@
},
{
"title": "Closest-pair problem",
"type": "Waypoint",
"description": [
"Task:",
"<p>Provide a function to find the closest two points among a set of given points in two dimensions, i.e. to solve the <a href=\"https://en.wikipedia.org/wiki/Closest pair of points problem\" title=\"wp: Closest pair of points problem\">Closest pair of points problem</a> in the planar case.</p><p>The straightforward solution is a O(n<sup>2</sup>) algorithm (which we can call brute-force algorithm); the pseudo-code (using indexes) could be simply:</p>",
@ -1306,7 +1290,6 @@
},
{
"title": "Combinations",
"type": "Waypoint",
"description": [
"Task:",
"<p>Given non-negative integers <big> m </big> and <big> n</big>, generate all size <big> m </big> <a href=\"http://mathworld.wolfram.com/Combination.html\" title=\"link: http://mathworld.wolfram.com/Combination.html\">combinations</a> of the integers from <big> 0</big> (zero) to <big> n-1 </big> in sorted order (each combination is sorted and the entire table is sorted).</p>",
@ -1369,7 +1352,6 @@
},
{
"title": "Comma quibbling",
"type": "Waypoint",
"description": [
"<p>Comma quibbling is a task originally set by Eric Lippert in his <a href=\"http://blogs.msdn.com/b/ericlippert/archive/2009/04/15/comma-quibbling.aspx\" title=\"link: http://blogs.msdn.com/b/ericlippert/archive/2009/04/15/comma-quibbling.aspx\">blog</a>.</p>",
"Task:<p>Write a function to generate a string output which is the concatenation of input words from a list/sequence where:</p>",
@ -1437,7 +1419,6 @@
},
{
"title": "Compare a list of strings",
"type": "Waypoint",
"description": [
"<p>Given a <a href=\"https://en.wikipedia.org/wiki/List_(abstract_data_type)\" title=\"wp: List_(abstract_data_type)\">list</a> of arbitrarily many strings, implement a function for each of the following conditions:</p> test if they are all lexically equal",
" test if every string is lexically less than the one after it (i.e. whether the list is in strict ascending order)"
@ -1523,7 +1504,6 @@
},
{
"title": "Convert seconds to compound duration",
"type": "Waypoint",
"description": [
"Task:",
"<p>Implement a function which:</p>",
@ -1634,7 +1614,6 @@
},
{
"title": "Count occurrences of a substring",
"type": "Waypoint",
"description": [
"Task:",
"<p>Create a function, or show a built-in function, to count the number of non-overlapping occurrences of a substring inside a string.</p><p>The function should take two arguments:</p>",
@ -1689,7 +1668,6 @@
},
{
"title": "Count the coins",
"type": "Waypoint",
"description": [
"<p>There are four types of common coins in <a href=\"https://en.wikipedia.org/wiki/United_States\" title=\"link: https://en.wikipedia.org/wiki/United_States\">US</a> currency:</p>",
"quarters (25 cents)",
@ -1742,7 +1720,6 @@
},
{
"title": "Cramer's rule",
"type": "Waypoint",
"description": [
"<p>In <a href=\"https://en.wikipedia.org/wiki/linear algebra\" title=\"wp: linear algebra\">linear algebra</a>, <a href=\"https://en.wikipedia.org/wiki/Cramer's rule\" title=\"wp: Cramer's rule\">Cramer's rule</a> is an explicit formula for the solution of a <a href=\"https://en.wikipedia.org/wiki/system of linear equations\" title=\"wp: system of linear equations\">system of linear equations</a> with as many equations as unknowns, valid whenever the system has a unique solution. It expresses the solution in terms of the determinants of the (square) coefficient matrix and of matrices obtained from it by replacing one column by the vector of right hand sides of the equations.</p>",
"<p>Given</p>",
@ -1819,7 +1796,6 @@
},
{
"title": "Date format",
"type": "Waypoint",
"description": [
"Task:",
"<p>Return an array with the current date in the formats:</p>",
@ -1881,7 +1857,6 @@
},
{
"title": "Date manipulation",
"type": "Waypoint",
"description": [
"Task:",
"<p>Given a date string in EST, output the given date as a string with 12 hours added to the time. </p>",
@ -1960,7 +1935,6 @@
},
{
"title": "Day of the week",
"type": "Waypoint",
"description": [
"<p>A company decides that whenever Xmas falls on a Sunday they will give their workers all extra paid holidays so that, together with any public holidays, workers will not have to work the following week (between the 25th of December and the first of January).</p>",
"<p>Task:</p>",
@ -2011,7 +1985,6 @@
},
{
"title": "Deal cards for FreeCell",
"type": "Waypoint",
"description": [
"<p>Free Cell is the solitaire card game that Paul Alfille introduced to the PLATO system in 1978. Jim Horne, at Microsoft, changed the name to FreeCell and reimplemented the game for <a href=\"http://rosettacode.org/wiki/DOS\" title=\"DOS\">DOS</a>, then <a href=\"http://rosettacode.org/wiki/Windows\" title=\"Windows\">Windows</a>. </p>",
"<p>This version introduced 32000 numbered deals. (The <a href=\"http://www.solitairelaboratory.com/fcfaq.html\" title=\"link: http://www.solitairelaboratory.com/fcfaq.html\">FreeCell FAQ</a> tells this history.)</p><p>As the game became popular, Jim Horne disclosed <a href=\"http://www.solitairelaboratory.com/mshuffle.txt\" title=\"link: http://www.solitairelaboratory.com/mshuffle.txt\">the algorithm</a>, and other implementations of FreeCell began to reproduce the Microsoft deals. </p>",
@ -2128,7 +2101,6 @@
},
{
"title": "Deepcopy",
"type": "Waypoint",
"description": [
"Task:",
"<p>Write a function that returns a deep copy of a given object.</p>",
@ -2196,7 +2168,6 @@
},
{
"title": "Define a primitive data type",
"type": "Waypoint",
"description": [
"Task:",
"<p>Define a type that behaves like an integer but has a lowest valid value of 1 and a highest valid value of 10.</p>",
@ -2288,7 +2259,6 @@
},
{
"title": "Department Numbers",
"type": "Waypoint",
"description": [
"<p>There is a highly organized city that has decided to assign a number to each of their departments:</p>",
"Police department",
@ -2374,7 +2344,6 @@
},
{
"title": "Discordian date",
"type": "Waypoint",
"description": [
"Task:",
"<p>Convert a given date from the <a href=\"https://en.wikipedia.org/wiki/Gregorian calendar\" title=\"wp: Gregorian calendar\">Gregorian calendar</a> to the <a href=\"https://en.wikipedia.org/wiki/Discordian calendar\" title=\"wp: Discordian calendar\">Discordian calendar</a>.</p>"
@ -2437,7 +2406,6 @@
},
{
"title": "Element-wise operations",
"type": "Waypoint",
"description": [
"<p>Implement basic element-wise matrix-matrix and scalar-matrix operations.</p><p>Implement:</p>",
"<p>::* addition</p>",
@ -2504,7 +2472,6 @@
},
{
"title": "Emirp primes",
"type": "Waypoint",
"description": [
"<p>An emirp (prime spelled backwards) are primes that when reversed (in their decimal representation) are a different prime.</p>",
"<p>Write a function that should be able to : Show the first <b>n</b> eprimes numbers.Show the eprimes numbers in a range.Show the number of eprimes in a range.Show the <b>n<sup>th</sup></b> eprimes number.<p>The function should have two parameters. The first will receive <b>n</b> or the range as an array. The second will receive a boolean, that specifies if the function returns the eprimes as an array or a single number(the number of primes in the range or the <b>n<sup>th</sup></b> prime). According to the parameters the function should return an array or a number."
@ -2555,7 +2522,6 @@
},
{
"title": "Entropy",
"type": "Waypoint",
"description": [
"Task:",
"<p>Calculate the Shannon entropy H of a given input string.</p><p>Given the discreet random variable $X$ that is a string of $N$ \"symbols\" (total characters) consisting of $n$ different characters (n=2 for binary), the Shannon entropy of X in bits/symbol is :</p>",
@ -2614,7 +2580,6 @@
},
{
"title": "Equilibrium index",
"type": "Waypoint",
"description": [
"<p>An equilibrium index of a sequence is an index into the sequence such that the sum of elements at lower indices is equal to the sum of elements at higher indices.</p>",
"<p>For example, in a sequence <big>$A$</big>:</p><p>:::: <big>$A_0 = -7$</big></p>",
@ -2689,7 +2654,6 @@
},
{
"title": "Ethiopian multiplication",
"type": "Waypoint",
"description": [
"<p>Ethiopian multiplication is a method of multiplying integers using only addition, doubling, and halving.</p>",
"<p>Method: </p>",
@ -2783,7 +2747,6 @@
},
{
"title": "Euler method",
"type": "Waypoint",
"description": [
"<p>Euler's method numerically approximates solutions of first-order ordinary differential equations (ODEs) with a given initial value. It is an explicit method for solving initial value problems (IVPs), as described in <a href=\"https://en.wikipedia.org/wiki/Euler method\" title=\"wp: Euler method\">the wikipedia page</a>.</p><p>The ODE has to be provided in the following form:</p><p>:: <big>$\\frac{dy(t)}{dt} = f(t,y(t))$</big></p><p>with an initial value</p><p>:: <big>$y(t_0) = y_0$</big></p><p>To get a numeric solution, we replace the derivative on the LHS with a finite difference approximation:</p><p>:: <big>$\\frac{dy(t)}{dt} \\approx \\frac{y(t+h)-y(t)}{h}$</big></p><p>then solve for $y(t+h)$:</p><p>:: <big>$y(t+h) \\approx y(t) + h \\, \\frac{dy(t)}{dt}$</big></p><p>which is the same as</p><p>:: <big>$y(t+h) \\approx y(t) + h \\, f(t,y(t))$</big></p><p>The iterative solution rule is then:</p><p>:: <big>$y_{n+1} = y_n + h \\, f(t_n, y_n)$</big></p><p>where <big>$h$</big> is the step size, the most relevant parameter for accuracy of the solution. A smaller step size increases accuracy but also the computation cost, so it has always has to be hand-picked according to the problem at hand.</p>",
"<p>Example: Newton's Cooling Law</p><p>Newton's cooling law describes how an object of initial temperature <big>$T(t_0) = T_0$</big> cools down in an environment of temperature <big>$T_R$</big>:</p><p>:: <big>$\\frac{dT(t)}{dt} = -k \\, \\Delta T$</big></p>",
@ -2848,7 +2811,6 @@
},
{
"title": "Evaluate binomial coefficients",
"type": "Waypoint",
"description": [
"<p>Write a function to calculate the binomial coefficient for the given value of n and k.</p><p>This formula is recommended:</p>",
"$\\binom{n}{k} = \\frac{n!}{(n-k)!k!} = \\frac{n(n-1)(n-2)\\ldots(n-k+1)}{k(k-1)(k-2)\\ldots 1}$"
@ -2902,7 +2864,6 @@
},
{
"title": "Execute a Markov algorithm",
"type": "Waypoint",
"description": [
"Task:",
"<p>Create an interpreter for a <a href=\"https://en.wikipedia.org/wiki/Markov algorithm\" title=\"wp: Markov algorithm\">Markov Algorithm</a>.</p><p>Rules have the syntax:</p>",
@ -3059,7 +3020,6 @@
},
{
"title": "Execute Brain****",
"type": "Waypoint",
"description": [
"<p>Write a function to implement a Brain**** interpreter. The function will take a string as a parameter and should return a string as the output. More details are given below : </p>",
"<p>RCBF is a set of <a href=\"http://rosettacode.org/wiki/Brainf***\" title=\"Brainf***\">Brainf***</a> compilers and interpreters written for Rosetta Code in a variety of languages.</p><p>Below are links to each of the versions of RCBF.</p><p>An implementation need only properly implement the following instructions:</p>",
@ -3135,7 +3095,6 @@
},
{
"title": "Extensible prime generator",
"type": "Waypoint",
"description": [
"<p>Write a generator of prime numbers, in order, that will automatically adjust to accommodate the generation of any reasonably high prime.</p> The generator should be able to : Show the first <b>n</b> prime numbers.Show the prime numbers in a range.Show the number of primes in a range.Show the <b>n<sup>th</sup></b> prime number.<p>The function should have two parameters. The first will receive <b>n</b> or the range as an array. The second will receive a boolean, that specifies if the function returns the prime numbers as an array or a single number(the number of primes in the range or the <b>n<sup>th</sup></b> prime). According to the parameters the function should return an array."
],
@ -3184,7 +3143,6 @@
},
{
"title": "Factorial",
"type": "Waypoint",
"description": [
"<p>Write a function to return the factorial of a number.</p>",
"<p>Factorial of a number is given by : </p>",
@ -3245,7 +3203,6 @@
},
{
"title": "Factors of a Mersenne number",
"type": "Waypoint",
"description": [
"<p>A Mersenne number is a number in the form of 2<sup>P</sup>-1.</p><p>If P is prime, the Mersenne number may be a Mersenne prime</p>",
"<p>(if P is not prime, the Mersenne number is also not prime).</p><p>In the search for Mersenne prime numbers it is advantageous to eliminate exponents by finding a small factor before starting a, potentially lengthy, <a href=\"http://rosettacode.org/wiki/Lucas-Lehmer test\" title=\"Lucas-Lehmer test\">Lucas-Lehmer test</a>.</p><p>There are very efficient algorithms for determining if a number divides 2<sup>P</sup>-1 (or equivalently, if 2<sup>P</sup> mod (the number) = 1).</p>",
@ -3324,7 +3281,6 @@
},
{
"title": "Factors of an integer",
"type": "Waypoint",
"description": [
"<p>Write a function that returns the factors of a positive integer.</p><p>These factors are the positive integers by which the number being factored can be divided to yield a positive integer result.</p>",
"///"
@ -3372,7 +3328,6 @@
},
{
"title": "Farey sequence",
"type": "Waypoint",
"description": [
"<p>Write a function that returns the Farey sequence of order n. The function should have one parameter that is n. It should return the sequence as an array. Read the following for more details : </p><p>The <a href=\"https://en.wikipedia.org/wiki/Farey sequence\" title=\"wp: Farey sequence\">Farey sequence</a> F<sub>n</sub> of order n is the sequence of completely reduced fractions between 0 and 1 which, when in lowest terms, have denominators less than or equal to n, arranged in order of increasing size.</p><p>The Farey sequence is sometimes incorrectly called a Farey series.</p>",
"<p>Each Farey sequence:</p>",
@ -3433,7 +3388,6 @@
},
{
"title": "Fibonacci n-step number sequences",
"type": "Waypoint",
"description": [
"<p>Write a function to generate Fibonacci n-step number sequences and Lucas sequences. The first parameter will be n. The second parameter will be the number of elements to be returned. The third parameter will specify whether to output the Fibonacci sequence or the Lucas sequence. If the parameter is \"f\" then return the Fibonacci sequence and if it is \"l\", then return the Lucas sequence. The sequences must be returned as an array. More details are given below : </p><p>These number series are an expansion of the ordinary <a href=\"http://rosettacode.org/wiki/Fibonacci sequence\" title=\"Fibonacci sequence\">Fibonacci sequence</a> where:</p>",
"For $n = 2$ we have the Fibonacci sequence; with initial values $[1, 1]$ and $F_k^2 = F_{k-1}^2 + F_{k-2}^2$",
@ -3530,7 +3484,6 @@
},
{
"title": "Fibonacci sequence",
"type": "Waypoint",
"description": [
"<p>Write a function to generate the <big> n<sup>th</sup> </big> Fibonacci number.</p>",
"///<p>The <big> n<sup>th</sup> </big> Fibonacci number is given by :",
@ -3584,7 +3537,6 @@
},
{
"title": "Fibonacci word",
"type": "Waypoint",
"description": [
"<p>Write a function to return the Fibonacci Words upto N. N will be provided as a parameter to the function. The function should return an array of objects. The objects should be of the form : { N: 1, Length: 1, Entropy: 0, Word: '1' }. More details are given below : </p><p>The Fibonacci Word may be created in a manner analogous to the Fibonacci Sequence <a href=\"http://hal.archives-ouvertes.fr/docs/00/36/79/72/PDF/The_Fibonacci_word_fractal.pdf\" title=\"link: http://hal.archives-ouvertes.fr/docs/00/36/79/72/PDF/The_Fibonacci_word_fractal.pdf\">as described here</a>:</p><p>Define F_Word<sub>1</sub> as 1</p>",
"<p>Define F_Word<sub>2</sub> as 0</p>",
@ -3638,7 +3590,6 @@
},
{
"title": "Hailstone sequence",
"type": "Waypoint",
"description": [
"<p>The Hailstone sequence of numbers can be generated from a starting positive integer, n by:</p>",
" If n is 1 then the sequence ends.",
@ -3690,7 +3641,6 @@
},
{
"title": "Happy numbers",
"type": "Waypoint",
"description": [
"<p>A happy number is defined by the following process:</p>",
"<p>Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number equals 1 (where it will stay), or it loops endlessly in a cycle which does not include 1. Those numbers for which this process ends in 1 are happy numbers, while those that do not end in 1 are unhappy numbers.</p>",
@ -3773,7 +3723,6 @@
},
{
"title": "Harshad or Niven series",
"type": "Waypoint",
"description": [
"<p>The <a href=\"http://mathworld.wolfram.com/HarshadNumber.html\" title=\"link: http://mathworld.wolfram.com/HarshadNumber.html\">Harshad</a> or Niven numbers are positive integers ≥ 1 that are divisible by the sum of their digits.</p><p>For example, 42 is a <a href=\"http://rosettacode.org/wiki/oeis:A005349\" title=\"oeis:A005349\">Harshad number</a> as 42 is divisible by (4 + 2) without remainder.</p>",
"Assume that the series is defined as the numbers in increasing order.",
@ -3824,7 +3773,6 @@
},
{
"title": "Hash from two arrays",
"type": "Waypoint",
"description": [
"Task:",
"<p>Using two Arrays of equal length, create a Hash object where the elements from one array (the keys) are linked to the elements of the other (the values)</p>",
@ -3903,7 +3851,6 @@
},
{
"title": "Hash join",
"type": "Waypoint",
"description": [
"<p>An <a href=\"https://en.wikipedia.org/wiki/Join_(SQL)#Inner_join\" title=\"wp: Join_(SQL)#Inner_join\">inner join</a> is an operation that combines two data tables into one table, based on matching column values. The simplest way of implementing this operation is the <a href=\"https://en.wikipedia.org/wiki/Nested loop join\" title=\"wp: Nested loop join\">nested loop join</a> algorithm, but a more scalable alternative is the <a href=\"https://en.wikipedia.org/wiki/hash join\" title=\"wp: hash join\">hash join</a> algorithm.</p>",
"<p>Implement the \"hash join\" algorithm, and demonstrate that it passes the test-case listed below.</p><p>You should represent the tables as data structures that feel natural in your programming language.</p>",
@ -4123,7 +4070,6 @@
},
{
"title": "Heronian triangles",
"type": "Waypoint",
"description": [
"<p><a href=\"https://en.wikipedia.org/wiki/Heron's formula\" title=\"wp: Heron's formula\">Hero's formula</a> for the area of a triangle given the length of its three sides <big> a,</big> <big>b,</big> and <big>c</big> is given by:</p><p><big>$$A = \\sqrt{s(s-a)(s-b)(s-c)},$$</big></p><p>where <big>s</big> is half the perimeter of the triangle; that is,</p><p><big>$$s=\\frac{a+b+c}{2}.$$</big></p>",
"<p><a href=\"http://www.had2know.com/academics/heronian-triangles-generator-calculator.html\" title=\"link: http://www.had2know.com/academics/heronian-triangles-generator-calculator.html\">Heronian triangles</a> are triangles whose sides and area are all integers.</p>",
@ -4190,7 +4136,6 @@
},
{
"title": "Hofstadter Figure-Figure sequences",
"type": "Waypoint",
"description": [
"<p>These two sequences of positive integers are defined as:</p>",
"<p><big>$$R(1)=1\\ ;\\ S(1)=2 \\\\R(n)=R(n-1)+S(n-1), \\quad n>1.$$</big></p>",
@ -4287,7 +4232,6 @@
},
{
"title": "Hofstadter Q sequence",
"type": "Waypoint",
"description": [
"<p>The <a href=\"https://en.wikipedia.org/wiki/Hofstadter_sequence#Hofstadter_Q_sequence\" title=\"wp: Hofstadter_sequence#Hofstadter_Q_sequence\">Hofstadter Q sequence</a> is defined as:</p>",
"<p>$Q(1)=Q(2)=1, \\\\ Q(n)=Q\\big(n-Q(n-1)\\big)+Q\\big(n-Q(n-2)), \\quad n>2.$</p>",
@ -4348,7 +4292,6 @@
},
{
"title": "Sailors, coconuts and a monkey problem",
"type": "Waypoint",
"description": [
" <p>",
" Five sailors are shipwrecked on an island and",
@ -4452,7 +4395,6 @@
},
{
"title": "SEDOLs",
"type": "Waypoint",
"null": [],
"description": [
" Task:",
@ -4534,7 +4476,6 @@
},
{
"title": "S-Expressions",
"type": "Waypoint",
"description": [
"<p>",
"<a href=\"https://en.wikipedia.org/wiki/S-Expression\" title=\"wp: S-Expression\">S-Expressions</a> are one convenient way to parse and store data.",
@ -4620,7 +4561,6 @@
},
{
"title": "Taxicab numbers",
"type": "Waypoint",
"description": [
"A &nbsp; <a href=\"https://en.wikipedia.org/wiki/HardyRamanujan number\" title=\"wp: HardyRamanujan number\">taxicab number</a>",
"&nbsp; (the definition that is being used here) &nbsp; is a positive integer that can be expressed as the sum of two positive cubes in more than one way.",
@ -4700,7 +4640,6 @@
},
{
"title": "Tokenize a string with escaping",
"type": "Waypoint",
"description": [
"<p>",
"Write a function or program that can split a string at each non-escaped occurrence of a separator character.",
@ -4776,7 +4715,6 @@
},
{
"title": "Topological sort",
"type": "Waypoint",
"description": [
"<p>",
"Given a mapping between items, and items they depend on, a ",
@ -4919,7 +4857,6 @@
},
{
"title": "Top rank per group",
"type": "Waypoint",
"description": [
"Task:",
"<p>Find the top N ranked data in each group, where N is provided as a parameter. Name of the rank and the group are also provided as parameter.</p>",
@ -5041,7 +4978,6 @@
},
{
"title": "Towers of Hanoi",
"type": "Waypoint",
"description": [
" Task:",
"<p>Solve the <a href=\"https://en.wikipedia.org/wiki/Towers_of_Hanoi\" title=\"wp: Towers_of_Hanoi\">Towers of Hanoi</a> problem.</p>",
@ -5106,7 +5042,6 @@
},
{
"title": "Vector cross product",
"type": "Waypoint",
"description": [
"A vector is defined as having three dimensions as being represented by an ordered collection of three numbers: &nbsp; (X, Y, Z).",
"<p>",
@ -5160,7 +5095,6 @@
},
{
"title": "Vector dot product",
"type": "Waypoint",
"description": [
"<p>",
"A vector is defined as having three dimensions as being represented by an ordered collection of three numbers: &nbsp; (X, Y, Z).",
@ -5223,7 +5157,6 @@
},
{
"title": "Word wrap",
"type": "Waypoint",
"description": [
"<p>",
"Even today, with proportional fonts and complex layouts, there are still",
@ -5314,7 +5247,6 @@
},
{
"title": "Y combinator",
"type": "Waypoint",
"description": [
"<p>",
"In strict ",
@ -5396,7 +5328,6 @@
},
{
"title": "Zeckendorf number representation",
"type": "Waypoint",
"description": [
"<p>",
"Just as numbers can be represented in a",
@ -5471,7 +5402,6 @@
},
{
"title": "Zhang-Suen thinning algorithm",
"type": "Waypoint",
"description": [
"This is an algorithm used to thin a black and white i.e. one bit per pixel images.",
"For example, with an input image of:",
@ -5652,7 +5582,6 @@
},
{
"title": "Zig-zag matrix",
"type": "Waypoint",
"description": [
"A &nbsp; ''zig-zag'' &nbsp; array is a square arrangement of the first &nbsp;",
"$N^2$ &nbsp; integers, &nbsp; where the",

View File

@ -19,9 +19,7 @@
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen.",
"You can get feedback on your project by sharing it with your friends on Facebook."
],
"challengeSeed": [],
"tests": [],
"type": "zipline",
"challengeType": 3,
"isRequired": false,
"translations": {
@ -73,9 +71,7 @@
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen.",
"You can get feedback on your project by sharing it with your friends on Facebook."
],
"challengeSeed": [],
"tests": [],
"type": "zipline",
"challengeType": 3,
"isRequired": false,
"translations": {
@ -116,9 +112,7 @@
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen.",
"You can get feedback on your project by sharing it with your friends on Facebook."
],
"challengeSeed": [],
"tests": [],
"type": "zipline",
"challengeType": 3,
"isRequired": false,
"translations": {
@ -173,11 +167,9 @@
"Once you've finished implementing these user stories, click the \"I've completed this challenge\" button and enter the URLs for both your GitHub repository and your live app running on Glitch.",
"You can get feedback on your project by sharing it with your friends on Facebook."
],
"challengeSeed": [],
"tests": [],
"isRequired": true,
"releasedOn": "January 1, 2016",
"type": "basejump",
"challengeType": 4,
"translations": {
"es": {
@ -208,9 +200,7 @@
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen.",
"You can get feedback on your project by sharing it with your friends on Facebook."
],
"challengeSeed": [],
"tests": [],
"type": "zipline",
"challengeType": 3,
"isRequired": false,
"translations": {
@ -248,9 +238,7 @@
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen.",
"You can get feedback on your project by sharing it with your friends on Facebook."
],
"challengeSeed": [],
"tests": [],
"type": "zipline",
"challengeType": 3,
"isRequired": false,
"translations": {
@ -291,9 +279,7 @@
"You can get feedback on your project by sharing it with your friends on Facebook."
],
"releasedOn": "January 1, 2016",
"challengeSeed": [],
"tests": [],
"type": "zipline",
"isRequired": false,
"challengeType": 3,
"translations": {
@ -347,9 +333,7 @@
"You can get feedback on your project by sharing it with your friends on Facebook."
],
"releasedOn": "January 1, 2016",
"challengeSeed": [],
"tests": [],
"type": "zipline",
"isRequired": false,
"challengeType": 3,
"translations": {
@ -410,9 +394,7 @@
"You can get feedback on your project by sharing it with your friends on Facebook."
],
"releasedOn": "January 1, 2016",
"challengeSeed": [],
"tests": [],
"type": "zipline",
"isRequired": false,
"challengeType": 3,
"translations": {
@ -478,9 +460,7 @@
"You can get feedback on your project by sharing it with your friends on Facebook."
],
"releasedOn": "January 1, 2016",
"challengeSeed": [],
"tests": [],
"type": "zipline",
"isRequired": false,
"challengeType": 3,
"translations": {
@ -543,9 +523,7 @@
"When you are finished, click the \"I've completed this challenge\" button and include a link to your Glitch App.",
"You can get feedback on your project by sharing it with your friends on Facebook."
],
"challengeSeed": [],
"tests": [],
"type": "zipline",
"challengeType": 3,
"isRequired": false,
"releasedOn": "January 1, 2016"
@ -564,11 +542,9 @@
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. ",
"You can get feedback on your project by sharing it with your friends on Facebook."
],
"challengeSeed": [],
"tests": [],
"isRequired": false,
"releasedOn": "January 1, 2016",
"type": "zipline",
"challengeType": 3,
"translations": {
"es": {
@ -605,11 +581,9 @@
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. ",
"You can get feedback on your project by sharing it with your friends on Facebook."
],
"challengeSeed": [],
"tests": [],
"isRequired": false,
"releasedOn": "January 1, 2016",
"type": "zipline",
"challengeType": 3,
"translations": {
"es": {
@ -643,9 +617,7 @@
"Once you've finished implementing these user stories, click the \"I've completed this challenge\" button and enter the URLs for both your GitHub repository and your live app running on Heroku.",
"You can get feedback on your project by sharing it with your friends on Facebook."
],
"challengeSeed": [],
"tests": [],
"type": "basejump",
"challengeType": 4,
"translations": {
"es": {
@ -680,9 +652,7 @@
"Once you've finished implementing these user stories, click the \"I've completed this challenge\" button and enter the URLs for both your GitHub repository and your live app running on Heroku.",
"You can get feedback on your project by sharing it with your friends on Facebook."
],
"challengeSeed": [],
"tests": [],
"type": "basejump",
"challengeType": 4,
"translations": {
"es": {
@ -719,11 +689,7 @@
"Once you've finished implementing these user stories, click the \"I've completed this challenge\" button and enter the URLs for both your GitHub repository and your live app running on Heroku.",
"You can get feedback on your project by sharing it with your friends on Facebook."
],
"challengeSeed": [
"Gei7QfPmcMw"
],
"tests": [],
"type": "basejump",
"challengeType": 4,
"isRequired": true,
"translations": {
@ -757,11 +723,7 @@
"Once you've finished implementing these user stories, click the \"I've completed this challenge\" button and enter the URLs for both your GitHub repository and your live app running on Heroku.",
"You can get feedback on your project by sharing it with your friends on Facebook."
],
"challengeSeed": [
"CENs50cnRgM"
],
"tests": [],
"type": "basejump",
"challengeType": 4,
"isRequired": true,
"translations": {
@ -797,12 +759,7 @@
"<strong>User Story:</strong> As an authenticated user, if I don't like the options on a poll, I can create a new option.",
"Once you've finished implementing these user stories, click the \"I've completed this challenge\" button and enter the URLs for both your GitHub repository and your live app running on Heroku.",
"You can get feedback on your project by sharing it with your friends on Facebook."
],
"challengeSeed": [
"JBKnbY_fdg4"
],
"tests": [],
"type": "basejump",
],"tests": [],
"challengeType": 4,
"isRequired": true,
"translations": {
@ -840,9 +797,7 @@
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen.",
"You can get feedback on your project by sharing it with your friends on Facebook."
],
"challengeSeed": [],
"tests": [],
"type": "zipline",
"challengeType": 3,
"isRequired": false
},
@ -863,9 +818,7 @@
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen.",
"You can get feedback on your project by sharing it with your friends on Facebook."
],
"challengeSeed": [],
"tests": [],
"type": "zipline",
"challengeType": 3,
"isRequired": false
}

View File

@ -8,7 +8,6 @@
"title": "API's and Microservices Certificate",
"challengeType": 7,
"description": [],
"challengeSeed": [],
"isPrivate": true,
"tests": [
{

View File

@ -8,7 +8,6 @@
"title": "Data Visualization Certificate",
"challengeType": 7,
"description": [],
"challengeSeed": [],
"isPrivate": true,
"tests": [
{

View File

@ -8,7 +8,6 @@
"title": "Front End Libraries Certificate",
"challengeType": 7,
"description": [],
"challengeSeed": [],
"isPrivate": true,
"tests": [
{

View File

@ -8,7 +8,6 @@
"title": "Information, Securtiy and Quality Assurance Certificate",
"challengeType": 7,
"description": [],
"challengeSeed": [],
"isPrivate": true,
"tests": [
{

View File

@ -8,7 +8,6 @@
"title": "JavaScript Algorithms and Data Structures Certificate",
"challengeType": 7,
"description": [],
"challengeSeed": [],
"isPrivate": true,
"tests": [
{

View File

@ -8,7 +8,6 @@
"title": "Legacy Back End Certificate",
"challengeType": 7,
"description": [],
"challengeSeed": [],
"isPrivate": true,
"tests": [
{

View File

@ -8,7 +8,6 @@
"title": "Legacy Data Visualization Certificate",
"challengeType": 7,
"description": [],
"challengeSeed": [],
"isPrivate": true,
"tests": [
{

View File

@ -8,7 +8,6 @@
"title": "Legacy Front End Certificate",
"challengeType": 7,
"description": [],
"challengeSeed": [],
"isPrivate": true,
"tests": [
{

View File

@ -8,7 +8,6 @@
"title": "Responsive Web Design Certificate",
"challengeType": 7,
"description": [],
"challengeSeed": [],
"isPrivate": true,
"tests": [
{

View File

@ -2,6 +2,7 @@
// no import here as this runs without babel
const fs = require('fs');
const path = require('path');
const omit = require('lodash/omit');
const hiddenFile = /(^(\.|\/\.))|(.md$)/g;
@ -52,6 +53,24 @@ module.exports = function getChallenges(challengesDir) {
challengeSpec.fileName = data.file;
challengeSpec.superBlock = superInfo.name;
challengeSpec.superOrder = superInfo.order;
challengeSpec.challenges = challengeSpec.challenges
.map(challenge => omit(
challenge,
[
'betaSolutions',
'betaTests',
'hints',
'MDNlinks',
'null',
'rawSolutions',
'react',
'reactRedux',
'redux',
'releasedOn',
'translations',
'type'
]
));
return challengeSpec;
});
};

View File

@ -1,6 +1,6 @@
{
"name": "@freecodecamp/curriculum",
"version": "1.0.0",
"version": "1.0.1",
"description": "freeCodeCamp's curriculum seed files",
"main": "dist/index.js",
"publishConfig": {

View File

@ -4,9 +4,6 @@ Joi.objectId = require('joi-objectid')(Joi);
const schema = Joi.object().keys({
block: Joi.string(),
blockId: Joi.objectId(),
challengeSeed: Joi.array().items(
Joi.string().allow('')
),
challengeType: Joi.number().min(0).max(9).required(),
checksum: Joi.number(),
dashedName: Joi.string(),
@ -20,15 +17,21 @@ const schema = Joi.object().keys({
key: Joi.string(),
ext: Joi.string(),
name: Joi.string(),
head: Joi.string().allow(''),
tail: Joi.string().allow(''),
contents: Joi.string().allow('')
head: [
Joi.array().items(Joi.string().allow('')),
Joi.string().allow('')
],
tail: [
Joi.array().items(Joi.string().allow('')),
Joi.string().allow('')
],
contents: [
Joi.array().items(Joi.string().allow('')),
Joi.string().allow('')
]
})
),
guideUrl: Joi.string().uri({ scheme: 'https' }),
head: Joi.array().items(
Joi.string().allow('')
),
helpRoom: Joi.string(),
id: Joi.objectId().required(),
isBeta: Joi.bool(),
@ -52,13 +55,16 @@ const schema = Joi.object().keys({
superBlock: Joi.string(),
superOrder: Joi.number(),
suborder: Joi.number(),
tail: Joi.array().items(
Joi.string().allow('')
),
tests: Joi.array().items(
// public challenges
Joi.object().keys({
text: Joi.string().required(),
testString: Joi.string().allow('').required()
}),
// our tests used in certification verification
Joi.object().keys({
id: Joi.string().required(),
title: Joi.string().required()
})
),
template: Joi.string(),

View File

@ -8,6 +8,7 @@ import getChallenges from './getChallenges';
import MongoIds from './mongoIds';
import ChallengeTitles from './challengeTitles';
import addAssertsToTapTest from './addAssertsToTapTest';
import { validateChallenge } from './schema/challengeSchema';
// modern challengeType
const modern = 6;
@ -203,6 +204,15 @@ function createTest({
}
Observable.from(getChallenges())
.do(({ challenges }) => {
challenges.forEach(challenge => {
const result = validateChallenge(challenge);
if (result.error) {
console.log(result.value);
throw new Error(result.error);
}
});
})
.flatMap(challengeSpec => {
return Observable.from(challengeSpec.challenges);
})