|
1 | 1 | { |
2 | 2 | "project": { |
3 | 3 | "title": "Functional School", |
4 | | - "description": "A trip through functional programming in Javascript." |
| 4 | + "description": "A trip through functional programming in Javascript.\n\nLevel: Intermediate\nKeywords: javascript, functional\nLength: 1-2 hours" |
5 | 5 | }, |
6 | 6 | "chapters": [ |
7 | 7 | { |
|
267 | 267 | ] |
268 | 268 | }, |
269 | 269 | { |
270 | | - "description": "Now `map` over the courses array, and `map` over the students array inside of it.\n\nReturn the fields:\n\n * title\n * instructor\n * name\n * grade\n * score", |
| 270 | + "description": "Now `map` over the courses array, and `map` over the students array inside of it.\nReturn the fields:\n\n * title\n * instructor\n * name\n * grade\n * score", |
271 | 271 | "tests": [ |
272 | 272 | "1/06/02-concat" |
273 | 273 | ], |
274 | 274 | "actions": [ |
275 | | - "insert('// map over courses then\n// map over students inside of courses\n// return \"title\", \"instructor\",\n// \"name\", \"grade\", \"score\" fields\nvar doubleArray = courses;\n\n')" |
| 275 | + "insert('\n// map over courses then\n// map over students inside of courses\nvar doubleArray = courses;\n\n')" |
276 | 276 | ] |
277 | 277 | }, |
278 | 278 | { |
|
294 | 294 | ] |
295 | 295 | }, |
296 | 296 | { |
297 | | - "description": "You just thought of two more suspects! `concat` the new suspects array onto the `suspects` list.", |
| 297 | + "description": "You just thought of two more suspects! Make a new variable called `newSuspects` and add it above `suspects`. Set `newSuspects` to `['Albert Gonzalez', 'Kevin Mitnick']`\n\n`concat` the `newSuspects` onto the `suspects` list.", |
298 | 298 | "tests": [ |
299 | 299 | "1/06/05-concat" |
300 | | - ], |
301 | | - "actions": [ |
302 | | - "insert('\nvar newSuspects = [\"Kevin Mitnick\", \"Albert Gonzalez\"];\n')" |
303 | 300 | ] |
304 | 301 | } |
305 | 302 | ] |
|
316 | 313 | ], |
317 | 314 | "actions": [ |
318 | 315 | "open('07-reduce.js')", |
319 | | - "set('var practice = [1, 1, 2, 3, 5, 8, 13, 21];\n\n// total the numbers using a reduce function\n// hint: start at 0\nvar total = practice.reduce();\n')" |
| 316 | + "set('var practice = [1, 1, 2, 3, 5, 8, 13, 21];\n\nfunction add(a, b) {\n return a + b;\n}\n\n// total the numbers using a reduce function\n// hint: start at 0\nvar total = practice.reduce();\n')" |
320 | 317 | ] |
321 | 318 | }, |
322 | 319 | { |
|
338 | 335 | ] |
339 | 336 | }, |
340 | 337 | { |
341 | | - "description": "`map` over suspect data to find the `\"difference\"` from subtracting the students score from the average score. Add this to `suspectScores` using the key `difference`. The resulting array should look like this:\n```js\n[{\n name: 'suspectName',\n scores: [50, 65, 75, 85...],\n difference: 15\n}]\n```", |
| 338 | + "description": "`map` over suspect data to find the `\"difference\"` from subtracting the students score from the average score. Add this to `suspectScores` using the key `difference`. The resulting array should look like this:\n```js\n[{\n name: 'suspectName',\n scores: [50, 65, 75 ...],\n difference: 15\n}]\n```", |
342 | 339 | "tests": [ |
343 | 340 | "1/07/04-reduce" |
344 | 341 | ] |
345 | 342 | }, |
346 | 343 | { |
347 | | - "description": "`reduce` down to any likely suspect names by filtering with the `isCheater` function", |
| 344 | + "description": "`reduce` down to likely suspect names by filtering with the `isCheater` function", |
348 | 345 | "tests": [ |
349 | 346 | "1/07/05-reduce" |
350 | 347 | ], |
|
0 commit comments