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 4238f37 commit be3e78eCopy full SHA for be3e78e
index.ts
@@ -74,6 +74,14 @@ export function tail<T>(array: ArrayLike<T>): T[] {
74
return nativeSlice.call(array, 1);
75
}
76
77
+export function push<T>(array: ArrayLike<T>, value: T): T[] {
78
+ return [...coerce(array), value];
79
+}
80
+
81
+export function pushFn<T>(value: T): (array: ArrayLike<T>) => T[] {
82
+ return array => push(array, value);
83
84
85
export function initial<T>(array: ArrayLike<T>): T[] {
86
return array.length === 0 ? [] : nativeSlice.call(array, 0, array.length - 1);
87
0 commit comments