Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Challenge Waypoint: Filter Arrays with filter has an issue. #4039

Closed
huy-qn opened this issue Oct 30, 2015 · 3 comments
Closed

Challenge Waypoint: Filter Arrays with filter has an issue. #4039

huy-qn opened this issue Oct 30, 2015 · 3 comments

Comments

@huy-qn
Copy link

huy-qn commented Oct 30, 2015

Challenge Waypoint: Filter Arrays with filter has an issue.
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36.

It asked me to use filter to remove all elements from array that are greater than 5. When I run test with my code, the result I got is true but it didn't let me pass.

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 === true;
});

// Only change code above this line.

(function() { return newArray; })();
@ltegman
Copy link
Member

ltegman commented Oct 30, 2015

Looks like your code isn't just removing values greater than 5, it is also removing 5.

Closing as not an issue with the tests but feel free to reply if you need further clarification.

Thanks and happy coding!

@ltegman ltegman closed this as completed Oct 30, 2015
@huy-qn
Copy link
Author

huy-qn commented Oct 30, 2015

Oh I see, thank you!

@Mohab17
Copy link

Mohab17 commented May 20, 2016

Hi it must be:

return val < 6 === true;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants