Requesting for
You should have filtered out all values from the array that are greater than 5.
However the final code is return val <= 5;
similar to issue #7125 (https://github.com/FreeCodeCamp/FreeCodeCamp/issues/7125)
Challenge Filter Arrays with filter has an issue.
User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36.
Please describe how to reproduce this issue, and include links to screenshots if possible.
My code:
var oldArray = [1,2,3,4,5,6,7,8,9,10];
// Only change code below this line.
var newArray = oldArray.filter(function(val) {
return val <= 5;
});
Although technically the description and the test say the same thing, I can see how the inconsistency causes confusion. The description says to _keep_ all the values _smaller_ than 6. The test says to _remove_ all the values _greater_ than five. Any value smaller than or equal to five is smaller than six.
To avoid the confusion, I think it would be a good idea update either the test or the description. I'm not sure what would make more sense. What do you think @yitch?
@FreeCodeCamp/moderators any input?
@systimotic: starting with the intent of teaching people to code. The instructions should be made clear (and not confuse users with english subtleties)
That being said, it's also real life situation to have users who give funny requirements and it would be necessary to search forums for answers. This could be an easter egg type question :)
Already resolved in staging
I actually looked at that Pull Request, but I read the diff wrong. 馃槄 That lead me to believe this specific part wasn't fixed yet, but now I see that it is. Thank you Stuart!
Most helpful comment
@systimotic: starting with the intent of teaching people to code. The instructions should be made clear (and not confuse users with english subtleties)
That being said, it's also real life situation to have users who give funny requirements and it would be necessary to search forums for answers. This could be an easter egg type question :)