We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 261af5c + 374168d commit a459987Copy full SHA for a459987
1 file changed
web/src/pages/challenges/functions.mdx
@@ -166,15 +166,12 @@ function multiply(num1) {
166
167
```js copy
168
function curryFunc(fn) {
169
- return function curry(...args) {
170
- if (fn.length <= args.length) {
171
- return fn.apply(this, args);
172
- } else {
173
- return function (...args2) {
174
- return curry.apply(this, args.concat(args2));
175
- };
+ return function curry(...args) {
+ if(args.length < fn.length) {
+ return curry.bind(this, ...args);
+ }
+ return fn.apply(this, args);
176
}
177
178
179
180
// driver code
0 commit comments