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 0e8e384 commit 415cf47Copy full SHA for 415cf47
βarray_to_list.tsβ
@@ -2,7 +2,8 @@ export interface List<T> {
2
value: T;
3
rest: List<T> | null;
4
}
5
-export function arrayToList<T>(values: T[]): List<T> {
6
- const [hey] = values;
7
- return { value: hey, rest: null };
+
+// Recursivity FTW πππ
+export function arrayToList<T>([value, ...values]: T[]): List<T> | null {
8
+ return value ? { value, rest: arrayToList(values) } : null;
9
βmod.tsβ
@@ -0,0 +1,7 @@
1
+export * from "./array_to_list.ts";
+export * from "./bean_counting.ts";
+export * from "./minimum.ts";
+export * from "./is_even.ts";
+export * from "./range.ts";
+export * from "./reversing_array.ts";
+export * from "./sum.ts";
0 commit comments