-
-
Notifications
You must be signed in to change notification settings - Fork 125
fix(challenges): fixed object keys in instruction #86 #143
base: dev
Are you sure you want to change the base?
Conversation
fixes Use the filter Method to Extract Data from an Array: wrong indices freeCodeCamp#86
Hi @lynxlynxlynx, thank you for taking the time to submit this PR. While I don't believe title and rating need to be changed here, I do think that the description could be a little more clear about what the user is supposed to do. Here's what I'm thinking:
|
Why don't you think it needs changing? The objects learners get to work with don't have those keys. As for your text proposal, post a diff ... |
I believe it could lead to confusion about how to solve the problem. What it's saying is that the new array should have the keys title and rating, not Title and imdbRating. But I do see your point, which could also lead to confusion. How about improving the description to be more clear that Title and imdbRating in the original objects should be title and rating in the final object? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know what you think or if you have any other proposals about how the description should read.
@@ -655,7 +655,7 @@ | |||
"Another useful array function is <code>Array.prototype.filter()</code>, or simply <code>filter()</code>. The <code>filter</code> method returns a new array which is at most as long as the original array, but usually has fewer items.", | |||
"<code>Filter</code> doesn't alter the original array, just like <code>map</code>. It takes a callback function that applies the logic inside the callback on each element of the array. If an element returns true based on the criteria in the callback function, then it is included in the new array.", | |||
"<hr>", | |||
"The variable <code>watchList</code> holds an array of objects with information on several movies. Use a combination of <code>filter</code> and <code>map</code> to return a new array of objects with only <code>title</code> and <code>rating</code> keys, but where <code>imdbRating</code> is greater than or equal to 8.0. Note that the rating values are saved as strings in the object and you may want to convert them into numbers to perform mathematical operations on them." | |||
"The variable <code>watchList</code> holds an array of objects with information on several movies. Use a combination of <code>filter</code> and <code>map</code> to return a new array of objects with only <code>Title</code> and <code>imdbRating</code> keys, but where <code>imdbRating</code> is greater than or equal to 8.0. Note that the rating values are saved as strings in the object and you may want to convert them into numbers to perform mathematical operations on them." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"The variable watchList
holds an array of objects with information on several movies. Use filter
to create a filtered array that includes all movies with an imdbRating
greater than or equal to 8.0. Then, use map
to return a new array of objects with only the Title
and imdbRating
keys as title
and rating
, respectively. Note that the rating values are saved as strings in the object and you may want to convert them into numbers to perform mathematical operations on them."
Hi @lynxlynxlynx, haven't heard from you in a bit. Are you still interested in updating this challenge? Just let us know either way. |
@scissorsneedfoodtoo I like your suggested improvement. |
fixes Use the filter Method to Extract Data from an Array: wrong indices #86. Was partially using names from the tests.
dev
branch.fix/
,feature/
, ortranslate/
(e.g.fix/challenge-tests
)npm test
.npm run commit
to generate a conventional commit message.Learn more here: https://conventionalcommits.org/#why-use-conventional-commits
If they were done on the web interface you have ensured that you are creating conventional commit messages.
Checklist:
Closes #86