You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was able to hardcode the value to make the test pass. I think there should be a test written to test against this possible scenario. See my code below:
functionwhere(collection,source){vararr=[];// What's in a name?arr=collection.filter(function(item){returnitem.last===source.last;});returnarr;}where([{first: 'Romeo',last: 'Montague'},{first: 'Mercutio',last: null},{first: 'Tybalt',last: 'Capulet'}],{last: 'Capulet'});
The text was updated successfully, but these errors were encountered:
I'm not sure if there is a way to test against this scenario. The test cases are only checking for the proper output in ALL of the bonfires, they aren't testing how you got to that output.
As for your code, I'm not sure how you consider that "hardcoding" the answer, you're just generating the answer using functional programming technique. This isn't the intended way of solving this bonfire, but it's certainly a valid method, especially once you pass the Functional Programming waypoint and go back and redo the bonfires using those techniques like some of us have.
Challenge http://www.freecodecamp.com/challenges/bonfire-where-art-thou has an issue. Please describe how to reproduce it, and include links to screen shots if possible.
I was able to hardcode the value to make the test pass. I think there should be a test written to test against this possible scenario. See my code below:
The text was updated successfully, but these errors were encountered: