use of ".map()" should be ".forEach()"
In "seed/challenges/json-apis-and-ajax.json", the use of ".map()" in the 5th and 6th challenges doesn't make sense -- we're not creating a new array by modifying each element of the response, and in challenge 4, the learner was told to use ".forEach()". Seeing ".map()" instead for no apparent reason would likely be a source of confusion.
This commit is contained in:
@ -239,7 +239,7 @@
|
|||||||
"",
|
"",
|
||||||
" var html = \"\";",
|
" var html = \"\";",
|
||||||
"",
|
"",
|
||||||
" json.map(function(val) {",
|
" json.forEach(function(val) {",
|
||||||
"",
|
"",
|
||||||
" html += \"<div class = 'cat'>\";",
|
" html += \"<div class = 'cat'>\";",
|
||||||
"",
|
"",
|
||||||
@ -310,7 +310,7 @@
|
|||||||
" ",
|
" ",
|
||||||
" // Only change code above this line.",
|
" // Only change code above this line.",
|
||||||
"",
|
"",
|
||||||
" json.map(function(val){",
|
" json.forEach(function(val) {",
|
||||||
"",
|
"",
|
||||||
" html += \"<div class = 'cat'>\"",
|
" html += \"<div class = 'cat'>\"",
|
||||||
"",
|
"",
|
||||||
|
Reference in New Issue
Block a user