Skip to content

Commit d91fd76

Browse files
committed
update solve problem to Function composition
1 parent feb0711 commit d91fd76

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: 2629. function-composition/index.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const compose = (functions) => {
2+
return (x) => {
3+
let temp = x
4+
for(let i = functions.length - 1; i >= 0; i--){
5+
temp = functions[i](temp)
6+
}
7+
return temp
8+
9+
}
10+
}

0 commit comments

Comments
 (0)