Protected Optional_toThe converter used to transform a raw element (R) into a public element (E).
Get the number of buckets allocated.
Bucket count.
Get the index of the first bucket in use.
Zero-based bucket index.
Get the index of the last bucket in use.
Zero-based bucket index.
Get the current bucket size.
Bucket capacity per bucket.
Get the index inside the first bucket.
Zero-based index within the first bucket.
Get the index inside the last bucket.
Zero-based index within the last bucket.
Get the number of elements in the deque.
Current length.
Upper bound for length (if positive), or -1 when unbounded.
Maximum allowed length.
Protected_createProtected_createProtected_get(Protected) Translate a logical position to bucket/offset.
Zero-based position.
An object containing bucketIndex and indexInBucket.
Protected_getProtected_getProtected_reallocateProtected_setReturns an iterator over the structure's elements.
Rest...args: unknown[]Optional iterator arguments forwarded to the internal iterator.
An IterableIterator<E> that yields the elements in traversal order.
Insert repeated copies of an element at a position.
Zero-based position from the front.
Element to insert.
Optionalnum: number = 1Number of times to insert (default 1).
True if inserted.
Cut the deque to keep items up to index; optionally mutate in-place.
Last index to keep.
OptionalisCutSelf: boolean = falseWhen true, mutate this deque; otherwise return a new deque.
This deque if in-place; otherwise a new deque of the prefix.
Cut the deque to keep items from index onward; optionally mutate in-place.
First index to keep.
OptionalisCutSelf: boolean = falseWhen true, mutate this deque; otherwise return a new deque.
This deque if in-place; otherwise a new deque of the suffix.
Delete the first occurrence of a value.
Element to remove (using the configured equality).
True if an element was removed.
Fill a range with a value.
Value to set.
Inclusive start.
Exclusive end.
This list.
Finds the first element that satisfies the predicate and returns it.
Finds the first element of type S (a subtype of E) that satisfies the predicate and returns it.
The matched element typed as S, or undefined if not found.
Checks whether a strictly-equal element exists in the structure.
The element to test with === equality.
true if an equal element is found; otherwise false.
First index of a value from the left.
Value to match.
Start position (supports negative index).
Index or -1 if not found.
Last index of a value from the right.
Value to match.
Start position (supports negative index).
Index or -1 if not found.
Append one element at the back.
Element to append.
True when appended.
Replace the element at a given position.
Zero-based position from the front.
New element value.
True if updated.
Remove and/or insert elements at a position (array-like behavior).
Start index (clamped to [0, length]).
OptionaldeleteCount: number = ...Number of elements to remove (default: length - start).
Optional Rest...items: E[]Elements to insert after start.
A new deque containing the removed elements (typed as this).
Prepend one element at the front.
Element to prepend.
True when prepended.
Staticfrom
Deque implemented with circular buckets allowing O(1) amortized push/pop at both ends.
Remarks
Time O(1), Space O(1)
Example
Example