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 1a665c5 commit 449ca87Copy full SHA for 449ca87
README.md
@@ -49,6 +49,8 @@ Step 2. Add the dependency
49
50
<summary>展开查看</summary>
51
52
+https://leetcode.cn/problems/function-composition
53
+
54
https://leetcode.cn/problems/array-reduce-transformation/
55
56
https://leetcode.cn/problems/curry
function-composition/index.ts
@@ -0,0 +1,11 @@
1
+type F = (x: number) => number;
2
3
+function compose(functions: F[]): F {
4
+ return function (x) {
5
+ return functions.reduceRight((p, c) => c(p), x);
6
+ };
7
+}
8
9
+export default compose;
10
11
+export type { F };
0 commit comments