Great article!
With curry and partial application, you can also use some like this:
some
const contacts = ['Stewie', 'Meg', 'Quagmire', 'Cleveland']; const equals = a => b => a === b contacts.some(equals('Lois')) // false contacts.some(equals('Meg')) // true
You could also write every like this:
every
const propGte = prop => val => obj => obj[prop] >= val; const lengthGte = propGte('length'); ['Stewie', 'Meg', 'Quagmire', 'Cleveland'].every(lengthGte(4)); // false ['Stewie', 'Megan', 'Quagmire', 'Cleveland'].every(lengthGte(4)); // true
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 article!
With curry and partial application, you can also use
somelike this:You could also write
everylike this: