Great explanation on a not so easy concept.
However you should always put the "point" (argument on which the partial application operates in the end) in the last position :
const isType = type => obj => obj.type === type;
This way you don't need to redefine functions, just :
const isFruit = isType("Fruit"); const isVegetable = isType("Vegetable");
Or write in a straightforward way :
const fruits = items.filter(isType('fruit')); const vegetables = items.filter(isType('Vegetable'));
Thanks for the great tip! I'll add this to the blog soon! 🤗
Finally got some time to update the post with this. Thanks again, for sharing!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Great explanation on a not so easy concept.
However you should always put the "point" (argument on which the partial application operates in the end) in the last position :
This way you don't need to redefine functions, just :
Or write in a straightforward way :
Thanks for the great tip! I'll add this to the blog soon! 🤗
Finally got some time to update the post with this. Thanks again, for sharing!