Skip to content

when R.binary function is used ? #3372

Answered by kedashoe
coleea asked this question in Q&A
Apr 13, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Not very often, I would say 😛 But basically, if you are calling a function that takes however many arguments, you can use unary, binary, nAry to create a new function that takes exactly how many arguments you want. An example with unary

let xs = ["1", "2", "3"];
console.log(xs.map(parseInt)); // => [1, NaN, NaN]
console.log(xs.map(R.unary(parseInt))); // => [1, 2, 3]

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@FernandoBasso
Comment options

@coleea
Comment options

Answer selected by coleea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants