b, 0);
How I can create curry function to execute this sum function with rest params?
I would like to execute like
curry(sum)(1)()(2) => 3
I have tried but sum function doesn't have length so it's returning function only
trying but not working I am doing something wrong here
Curry will not work with variadic functions
You can't, a curried function has to know its length
ohh okay I was figuring from last one hour :D
Currying is taking a function like (a, b, c) -> and converting it to a -> b -> c -> So by definition it can't work if it doesn't know length
Yeah right I though it might possible but I was stuck with unknown length of function
Обсуждают сегодня