JSR?
This commit is contained in:
25 files changed
+186
-94
No files matched your search
@@ -35,9 +35,9 @@ export class Stack<T> implements Iterable<T> {
|
||||
}
|
||||
|
||||
/** The number of elements remaining in the stack */
|
||||
get length() { return this.#head }
|
||||
get length(): number { return this.#head }
|
||||
|
||||
*[Symbol.iterator]() {
|
||||
*[Symbol.iterator](): Generator<NonNullable<T>, void, unknown> {
|
||||
while (this.length !== 0) yield this.pop()!
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user