Skip to content

Commit a459987

Browse files
authored
Merge pull request #62 from UtpalKant/patch-1
Update functions.mdx
2 parents 261af5c + 374168d commit a459987

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

web/src/pages/challenges/functions.mdx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,12 @@ function multiply(num1) {
166166

167167
```js copy
168168
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-
};
169+
return function curry(...args) {
170+
if(args.length < fn.length) {
171+
return curry.bind(this, ...args);
172+
}
173+
return fn.apply(this, args);
176174
}
177-
};
178175
}
179176

180177
// driver code

0 commit comments

Comments
 (0)