You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: coderoad.json
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -267,12 +267,12 @@
267
267
]
268
268
},
269
269
{
270
-
"description": "`flatten` works as promised. Now `map` over the course data array, and `map` over the student array inside of the course data. Set `doubleArray` to return an array of array of objects that looks like this:\n```js\n {\n\"title\": \"Relational Databases\",\n\"instructor\": \"SQ Lewis\",\n\"name\": \"Rebecca Heineman\",\n\"score\": 71,\n\"grade\": \"C\"\n}\n```",
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",
271
271
"tests": [
272
272
"1/06/02-concat"
273
273
],
274
274
"actions": [
275
-
"insert('\n// map over doubleArray twice\n// return an object with:\n// course.title, course.instructor\n// student.name, student.score, student.grade\nvar doubleArray = courses;\n')"
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')"
276
276
]
277
277
},
278
278
{
@@ -281,7 +281,7 @@
281
281
"1/06/03-concat"
282
282
],
283
283
"actions": [
284
-
"insert('\n// `flatten` doubleArray\nvar students = doubleArray;\n')"
284
+
"insert('// `flatten` doubleArray\nvar students = doubleArray;\n')"
285
285
]
286
286
},
287
287
{
@@ -290,7 +290,7 @@
290
290
"1/06/04-concat"
291
291
],
292
292
"actions": [
293
-
"insert('\n\nvar suspects = [\"Hack Kerr\"];\n// filter to data matching `suspects`\nvar suspectData = students;\n')"
293
+
"insert('\nvar suspects = [\"Hack Kerr\"];\n// filter to data matching `suspects`\nvar suspectData = students;\n')"
@@ -118,33 +119,33 @@ var flattenedArray = numberedList;
118
119
```
119
120
))
120
121
121
-
+`flatten` works as promised. Now `map` over the course data array, and `map` over the student array inside of the course data. Set `doubleArray` to return an array of array of objects that looks like this:
122
-
```js
123
-
{
124
-
"title":"Relational Databases",
125
-
"instructor":"SQ Lewis",
126
-
"name":"Rebecca Heineman",
127
-
"score":71,
128
-
"grade":"C"
129
-
}
130
-
```
122
+
123
+
+ Now `map` over the courses array, and `map` over the students array inside of it.
124
+
125
+
Return the fields:
126
+
127
+
* title
128
+
* instructor
129
+
* name
130
+
* grade
131
+
* score
132
+
131
133
@test('1/06/02-concat')
132
134
@action(insert(
133
135
```
134
-
135
-
// map over doubleArray twice
136
-
// return an object with:
137
-
// course.title, course.instructor
138
-
// student.name, student.score, student.grade
136
+
// map over courses then
137
+
// map over students inside of courses
138
+
// return "title", "instructor",
139
+
// "name", "grade", "score" fields
139
140
var doubleArray = courses;
141
+
140
142
```
141
143
))
142
144
143
145
+ Use `flatten` to put all data into a single array. Set `students` to the result.
0 commit comments