freeCodeCamp icon indicating copy to clipboard operation
freeCodeCamp copied to clipboard

fix: implement the filter method on a prototype test typo

Open scissorsneedfoodtoo opened this issue 2 years ago • 2 comments

Checklist:

  • [x] I have read freeCodeCamp's contribution guidelines.
  • [x] My pull request has a descriptive title (not a vague title like Update index.md)
  • [x] My pull request targets the main branch of freeCodeCamp.
  • [x] I have tested these changes either locally on my machine, or GitPod.

Closes #XXXXX

We received an email in the support inbox that solution 2 for this challenge on the forum no longer works: https://forum.freecodecamp.org/t/freecodecamp-challenge-guide-implement-the-filter-method-on-a-prototype/301231

After some digging, it seems like there may have been a typo introduced in this recent PR to improve this and the "Implement map on a Prototype" challenges: https://github.com/freeCodeCamp/freeCodeCamp/pull/48483/files

The changes from https://github.com/freeCodeCamp/freeCodeCamp/pull/48483/files did make it so that learners can't just hardcode the value for the array s, but it also looks like the === 1 condition is missing from the test text and _callback.

=== 1 used to be in the prefilled test case in the seed code, but was recently removed in this PR: https://github.com/freeCodeCamp/freeCodeCamp/pull/48519

If these changes are merged, solution 2 on the forum should work again.

scissorsneedfoodtoo avatar Nov 18 '22 04:11 scissorsneedfoodtoo

gitpod-io[bot] avatar Nov 18 '22 04:11 gitpod-io[bot]

:eyes: Review this PR in a CodeSee Review Map

View the CodeSee Map of this change

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map Legend

ghost avatar Nov 18 '22 04:11 ghost

@jeremylt, thanks for pointing that out. After bit more testing it does seem like it would be best to leave things the way they currently are to better test that solutions are closer to the actual .filter() method.

I'll go in and update the guide post to remove the other faulty solution.

scissorsneedfoodtoo avatar Nov 22 '22 12:11 scissorsneedfoodtoo