Skip to content

Commit 2f2683a

Browse files
authored
Remove useless if
PR-URL: #25
1 parent 24ad8cb commit 2f2683a

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

JavaScript/6-recursive.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ const compose = (...fns) => (x) => {
44
if (fns.length === 0) return x;
55
const fn = fns.pop();
66
const res = fn(x);
7-
if (fns.length === 0) return res;
87
return compose(...fns)(res);
98
};
109

1110
const pipe = (...fns) => (x) => {
1211
if (fns.length === 0) return x;
1312
const fn = fns.shift();
1413
const res = fn(x);
15-
if (fns.length === 0) return res;
1614
return pipe(...fns)(res);
1715
};
1816

0 commit comments

Comments
 (0)