-
I understand R.Binary's spcification from https://ramdajs.com/docs/#binary . But I don't know what situation I use this for. I think It was made because it's useful. It is good if someone give me an example. Thank you. |
Beta Was this translation helpful? Give feedback.
Answered by
kedashoe
Apr 13, 2023
Replies: 1 comment 2 replies
-
Not very often, I would say 😛 But basically, if you are calling a function that takes however many arguments, you can use let xs = ["1", "2", "3"];
console.log(xs.map(parseInt)); // => [1, NaN, NaN]
console.log(xs.map(R.unary(parseInt))); // => [1, 2, 3] |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
coleea
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 withunary