freeCodeCamp: Wrong filter description
Describe the Issue
This page incorrectly says that filter keeps elements when the callback returns the Boolean value true. This is incorrect, any element that results in a truthy return value is retained.
Affected Page
Expected behavior
The line:
filtercalls a function on each element of an array and returns a new array containing only the elements for which that function returnstrue.
Should be replaced with the line:
filtercalls a function on each element of an array and returns a new array containing only the elements for which that function returns a truthy value - that is, a value which returnstrueif passed to theBoolean()constructor.
Screenshots
No response
System
All
Additional context
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 22 (22 by maintainers)
Yep that should be fine.
I’ll go ahead and open this up to contribution, then.
I think we may be splitting hairs on this.