Skip to content
This repository has been archived by the owner on Sep 25, 2019. It is now read-only.

fix(challenges): fixed object keys in instruction #86 #143

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

lynxlynxlynx
Copy link
Member

@lynxlynxlynx lynxlynxlynx commented Jul 14, 2018

fixes Use the filter Method to Extract Data from an Array: wrong indices #86. Was partially using names from the tests.

  • Your pull request targets the dev branch.
  • Branch starts with either fix/, feature/, or translate/ (e.g. fix/challenge-tests)
  • All new and existing tests pass the command npm test.
  • Use npm run commit to generate a conventional commit message.
    Learn more here: https://conventionalcommits.org/#why-use-conventional-commits
  • The changes were done locally on your machine and NOT GitHub web interface.
    If they were done on the web interface you have ensured that you are creating conventional commit messages.

Checklist:

  • Tested changes locally.
  • Addressed currently open issue

Closes #86

fixes Use the filter Method to Extract Data from an Array: wrong indices freeCodeCamp#86
@scissorsneedfoodtoo
Copy link
Contributor

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:

"The variable <code>watchList</code> holds an array of objects with information on several movies. Use <code>filter</code> to create a filtered array that includes all movies with an <code>imdbRating</code> greater than or equal to 8.0. Then, use <code>map</code> to return a new array of objects with only <code>title</code> and <code>rating</code> keys. 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."

@lynxlynxlynx
Copy link
Member Author

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 ...

@scissorsneedfoodtoo
Copy link
Contributor

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?

Copy link
Contributor

@scissorsneedfoodtoo scissorsneedfoodtoo left a 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."
Copy link
Contributor

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."

@raisedadead raisedadead added the status: ready for QA To be applied to PR that are ready for QA. label Jul 27, 2018
@scissorsneedfoodtoo
Copy link
Contributor

Hi @lynxlynxlynx, haven't heard from you in a bit. Are you still interested in updating this challenge? Just let us know either way.

@RandellDawson
Copy link
Member

@scissorsneedfoodtoo I like your suggested improvement.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: ready for QA To be applied to PR that are ready for QA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use the filter Method to Extract Data from an Array: wrong indices
4 participants