Find me on medium
JavaScript utilizes functions in just about every JavaScript application that exists. Thanks to functions, the language is capab...
For further actions, you may consider blocking this person and/or reporting abuse
i also suggest a re write to this functionality of the last pass
from my understanding, this will only go once per frog and not create array.filter 4 times
please correct me if iam wrong or missed something on your implementation
Hi SerjoA, thank you for the suggestion and the workaround!
I will edit the post and swap out the current code example with the example you provided because its correct.
I'm going to make a slight modification to your
combineFilters
function to run this instead:This is a slightly more optimized version which reduces the amount of iterations as much as possible.
Thank you!
great, looks good
can you please explain how composeFrogFilterers is not creating the line:
return frogs.filter(filter)
from the filterFrogs function
while the above function :
applyAllFilters
does create this line 4 times instead of 1 like you mention?
from the logs i did, both run 4 times not just one
can you please say where iam wrong:
inside applyAllFilters:
inside composeFrogFilters:
You are right, both of the examples both re-create the arrays. Will edit the post with the correct solution (check my response to your other reply for the solution)
It's really useful to see the logic and workings, thanks. I've been increasingly developing with a functional approach and find it quite liberating. You only find out how and why by trying it out and learning by doing.
For a really simple solution in this case could you use the Ramda ap function? ramdajs.com/0.19.1/docs/#ap
Hey there! I shared your article here t.me/theprogrammersclub and check out the group if you haven't already!
Thank you so much!