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!
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!