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.
1 parent 261af5c commit 65a1569Copy full SHA for 65a1569
1 file changed
web/src/pages/challenges/functions.mdx
@@ -165,16 +165,13 @@ function multiply(num1) {
165
- The arguments can be 1 or multiple, and the actual function will be called once the count of expected arguments are reached
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
- };
+function curryFunc(func) {
+ return function curry(...ip) {
+ if(ip.length < func.length) {
+ return curry.bind(this, ...ip);
+ }
+ return func(...ip);
176
}
177
178
179
180
// driver code
0 commit comments