aboutsummaryrefslogtreecommitdiff
path: root/util/array.ts
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-07-01 16:37:50 +0200
committerlonkaars <loek@pipeframe.xyz>2023-07-01 16:37:50 +0200
commitce9e0788317b25e5d297ed38d9fed0754a341288 (patch)
tree29563a39c73ded16cd93eb7b5c5664d1ece944ac /util/array.ts
parent8ff39cbe6300ca479584fe7d85ff03a1f65bc9b0 (diff)
WIP sentence API
Diffstat (limited to 'util/array.ts')
-rw-r--r--util/array.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/util/array.ts b/util/array.ts
index 5b8c512..f032935 100644
--- a/util/array.ts
+++ b/util/array.ts
@@ -6,6 +6,8 @@ declare global {
peek(): T;
/** @summary create Set from this array */
set(): Set<T>;
+ /** @summary clear array */
+ clear(): void;
}
}
@@ -21,3 +23,7 @@ Array.prototype.set = function() {
return new Set(this);
}
+Array.prototype.clear = function() {
+ while (this.length > 0) this.pop();
+}
+