LinkedList
Defined in: src/list/LinkedList.ts:42
Doubly linked list that implements both List and Deque, so one object serves as a list, a FIFO queue and a stack.
Adding, removing and reading at either end is O(1), and so are add, set and remove through a
ListIterator. Positional access (get, set, add(i, e), removeAt) walks from the nearer end,
O(min(i, n − i)). contains, indexOf and remove(o) are O(n).
Permits null and undefined elements. Because poll() and peek() return null when the list
is empty, check isEmpty() when null may be stored. Iterates head to tail; iterators, forEach
and views are fail-fast.
Extends
Section titled “Extends”Type Parameters
Section titled “Type Parameters”E
Implements
Section titled “Implements”List<E>Deque<E>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new LinkedList<
E>():LinkedList<E>
Defined in: src/list/LinkedList.ts:48
Creates an empty list.
Returns
Section titled “Returns”LinkedList<E>
Overrides
Section titled “Overrides”AbstractSequentialList.constructor
Constructor
Section titled “Constructor”new LinkedList<
E>(c):LinkedList<E>
Defined in: src/list/LinkedList.ts:53
Creates a list holding the elements of c, in its iteration order. O(n).
Parameters
Section titled “Parameters”Collection<E>
Returns
Section titled “Returns”LinkedList<E>
Throws
Section titled “Throws”NullPointerException if c is null or undefined
Overrides
Section titled “Overrides”AbstractSequentialList<E>.constructor
Properties
Section titled “Properties”modCount
Section titled “modCount”modCount:
number=0
Defined in: src/abstract/AbstractList.ts:41
Structural modification counter. Iterators, sublists and spliterators record it and throw
ConcurrentModificationException when it changes behind them. Subclasses increment it once per
structural change (add, remove, clear); set leaves it alone.
Inherited from
Section titled “Inherited from”AbstractSequentialList.modCount
Methods
Section titled “Methods”[INSPECT]()
Section titled “[INSPECT]()”[INSPECT]():
string
Defined in: src/abstract/AbstractCollection.ts:195
Node’s util.inspect hook: console.log prints the toString() form.
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”AbstractSequentialList.[INSPECT]
[iterator]()
Section titled “[iterator]()”[iterator]():
IterableIterator<E>
Defined in: src/list/LinkedList.ts:430
Returns a JS iterator over the elements, head to tail, for for...of and spread; fail-fast.
Returns
Section titled “Returns”IterableIterator<E>
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”AbstractSequentialList.[iterator]
Call Signature
Section titled “Call Signature”add(
e):boolean
Defined in: src/list/LinkedList.ts:204
Appends e at the tail, in O(1). null and undefined are allowed.
Parameters
Section titled “Parameters”E
Returns
Section titled “Returns”boolean
always true
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”Call Signature
Section titled “Call Signature”add(
index,e):void
Defined in: src/list/LinkedList.ts:210
Inserts e at index, shifting the element there and all later ones one position to the right.
Walks from the nearer end: O(min(index, n − index)), then O(1) to link.
Parameters
Section titled “Parameters”number
E
Returns
Section titled “Returns”void
Throws
Section titled “Throws”IndexOutOfBoundsException if index < 0 or index > size()
Implementation of
Section titled “Implementation of”List.add
Overrides
Section titled “Overrides”addAll()
Section titled “addAll()”Call Signature
Section titled “Call Signature”addAll(
c):boolean
Defined in: src/abstract/AbstractList.ts:100
Appends the elements of c in its iteration order (via addAllAt); returns true if c was not empty.
Parameters
Section titled “Parameters”Collection<E>
Returns
Section titled “Returns”boolean
Throws
Section titled “Throws”NullPointerException if c is null
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”Call Signature
Section titled “Call Signature”addAll(
index,c):boolean
Defined in: src/abstract/AbstractList.ts:106
Inserts the elements of c at index in its iteration order (via addAllAt); returns true if c was not empty.
Parameters
Section titled “Parameters”number
Collection<E>
Returns
Section titled “Returns”boolean
Throws
Section titled “Throws”IndexOutOfBoundsException if index < 0 || index > size()
Throws
Section titled “Throws”NullPointerException if c is null
Implementation of
Section titled “Implementation of”List.addAll
Inherited from
Section titled “Inherited from”addFirst()
Section titled “addFirst()”addFirst(
e):void
Defined in: src/list/LinkedList.ts:437
Inserts e at the head, in O(1). null and undefined are allowed.
Parameters
Section titled “Parameters”E
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”AbstractSequentialList.addFirst
addLast()
Section titled “addLast()”addLast(
e):void
Defined in: src/list/LinkedList.ts:442
Appends e at the tail, in O(1). null and undefined are allowed.
Parameters
Section titled “Parameters”E
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”AbstractSequentialList.addLast
clear()
Section titled “clear()”clear():
void
Defined in: src/list/LinkedList.ts:340
Removes all elements. O(n): unlinks every node, so a stray reference to one cannot keep the others alive.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”clone()
Section titled “clone()”clone():
LinkedList<E>
Defined in: src/list/LinkedList.ts:68
Returns a shallow, independent copy of the same runtime class, in O(n).
Returns
Section titled “Returns”LinkedList<E>
contains()
Section titled “contains()”contains(
o):boolean
Defined in: src/list/LinkedList.ts:291
Returns true if this list contains an element equal to o (by Objects.equals). O(n) scan from the head; null is allowed.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”boolean
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”AbstractSequentialList.contains
containsAll()
Section titled “containsAll()”containsAll(
c):boolean
Defined in: src/abstract/AbstractCollection.ts:83
Returns true if this collection contains every element of c (calls contains for each).
Parameters
Section titled “Parameters”Collection<unknown>
Returns
Section titled “Returns”boolean
Throws
Section titled “Throws”NullPointerException if c is null
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”AbstractSequentialList.containsAll
descendingIterator()
Section titled “descendingIterator()”descendingIterator():
Iterator<E>
Defined in: src/list/LinkedList.ts:610
Returns a fail-fast iterator over the elements from tail to head. Its remove is O(1).
Returns
Section titled “Returns”Iterator<E>
Implementation of
Section titled “Implementation of”element()
Section titled “element()”element():
E
Defined in: src/list/LinkedList.ts:553
Returns the head without removing it, in O(1); same as getFirst().
Returns
Section titled “Returns”E
Throws
Section titled “Throws”NoSuchElementException if the list is empty
Implementation of
Section titled “Implementation of”equals()
Section titled “equals()”equals(
o):boolean
Defined in: src/list/LinkedList.ts:625
Returns true if o is a List of any class with equal elements in the same order. O(n).
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”boolean
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”forEach()
Section titled “forEach()”forEach(
action):void
Defined in: src/list/LinkedList.ts:358
Calls action for each element, head to tail.
Parameters
Section titled “Parameters”action
Section titled “action”(e) => void
Returns
Section titled “Returns”void
Throws
Section titled “Throws”NullPointerException if action is null
Throws
Section titled “Throws”ConcurrentModificationException if action structurally modifies this list
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”AbstractSequentialList.forEach
get(
index):E
Defined in: src/list/LinkedList.ts:261
Returns the element at index. O(min(index, n − index)), walking from the nearer end.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”E
Throws
Section titled “Throws”IndexOutOfBoundsException if index < 0 or index >= size()
Implementation of
Section titled “Implementation of”List.get
Overrides
Section titled “Overrides”getFirst()
Section titled “getFirst()”getFirst():
E
Defined in: src/list/LinkedList.ts:450
Returns the first element. O(1).
Returns
Section titled “Returns”E
Throws
Section titled “Throws”NoSuchElementException if the list is empty
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”AbstractSequentialList.getFirst
getLast()
Section titled “getLast()”getLast():
E
Defined in: src/list/LinkedList.ts:460
Returns the last element. O(1).
Returns
Section titled “Returns”E
Throws
Section titled “Throws”NoSuchElementException if the list is empty
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”AbstractSequentialList.getLast
hashCode()
Section titled “hashCode()”hashCode():
number
Defined in: src/list/LinkedList.ts:639
Returns the list hash code, h = 31 * h + hash(e) from 1 in 32-bit arithmetic, consistent with equals. O(n).
Returns
Section titled “Returns”number
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”AbstractSequentialList.hashCode
indexOf()
Section titled “indexOf()”indexOf(
o):number
Defined in: src/list/LinkedList.ts:299
Returns the index of the first element equal to o (by Objects.equals), or -1 if there is none.
O(n) scan from the head; NaN matches NaN.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”number
Implementation of
Section titled “Implementation of”List.indexOf
Overrides
Section titled “Overrides”AbstractSequentialList.indexOf
isEmpty()
Section titled “isEmpty()”isEmpty():
boolean
Defined in: src/list/LinkedList.ts:196
Returns true if this list has no elements. O(1).
Returns
Section titled “Returns”boolean
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”AbstractSequentialList.isEmpty
iterator()
Section titled “iterator()”iterator():
Iterator<E>
Defined in: src/list/LinkedList.ts:408
Returns a fail-fast iterator over the elements, head to tail. Its remove is O(1).
Returns
Section titled “Returns”Iterator<E>
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”AbstractSequentialList.iterator
lastIndexOf()
Section titled “lastIndexOf()”lastIndexOf(
o):number
Defined in: src/list/LinkedList.ts:314
Returns the index of the last element equal to o (by Objects.equals), or -1 if there is none.
O(n) scan from the tail; NaN matches NaN.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”number
Implementation of
Section titled “Implementation of”List.lastIndexOf
Overrides
Section titled “Overrides”AbstractSequentialList.lastIndexOf
listIterator()
Section titled “listIterator()”listIterator(
index?):ListIterator<E>
Defined in: src/list/LinkedList.ts:418
Returns a fail-fast list iterator starting at index: the first next() returns the element at
index. Reaching it takes O(min(index, n − index)); then add, set and remove through it are O(1).
Parameters
Section titled “Parameters”index?
Section titled “index?”number = 0
start position, 0 by default
Returns
Section titled “Returns”ListIterator<E>
Throws
Section titled “Throws”IndexOutOfBoundsException if index < 0 or index > size()
Implementation of
Section titled “Implementation of”List.listIterator
Overrides
Section titled “Overrides”AbstractSequentialList.listIterator
offer()
Section titled “offer()”offer(
e):boolean
Defined in: src/list/LinkedList.ts:490
Inserts e at the tail, in O(1). null and undefined are allowed.
Parameters
Section titled “Parameters”E
Returns
Section titled “Returns”boolean
always true
Implementation of
Section titled “Implementation of”offerFirst()
Section titled “offerFirst()”offerFirst(
e):boolean
Defined in: src/list/LinkedList.ts:499
Inserts e at the head, in O(1). null and undefined are allowed.
Parameters
Section titled “Parameters”E
Returns
Section titled “Returns”boolean
always true
Implementation of
Section titled “Implementation of”offerLast()
Section titled “offerLast()”offerLast(
e):boolean
Defined in: src/list/LinkedList.ts:508
Inserts e at the tail, in O(1). null and undefined are allowed.
Parameters
Section titled “Parameters”E
Returns
Section titled “Returns”boolean
always true
Implementation of
Section titled “Implementation of”parallelStream()
Section titled “parallelStream()”parallelStream():
Stream<E>
Defined in: src/abstract/AbstractCollection.ts:180
Returns a stream over spliterator() flagged as parallel.
Returns
Section titled “Returns”Stream<E>
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”AbstractSequentialList.parallelStream
peek()
Section titled “peek()”peek():
E|null
Defined in: src/list/LinkedList.ts:532
Returns the head without removing it, in O(1), or null if this list is empty (ambiguous when null is stored: check isEmpty()).
Returns
Section titled “Returns”E | null
Implementation of
Section titled “Implementation of”peekFirst()
Section titled “peekFirst()”peekFirst():
E|null
Defined in: src/list/LinkedList.ts:538
Returns the first element without removing it, in O(1), or null if this list is empty (ambiguous when null is stored: check isEmpty()).
Returns
Section titled “Returns”E | null
Implementation of
Section titled “Implementation of”peekLast()
Section titled “peekLast()”peekLast():
E|null
Defined in: src/list/LinkedList.ts:544
Returns the last element without removing it, in O(1), or null if this list is empty (ambiguous when null is stored: check isEmpty()).
Returns
Section titled “Returns”E | null
Implementation of
Section titled “Implementation of”poll()
Section titled “poll()”poll():
E|null
Defined in: src/list/LinkedList.ts:514
Removes and returns the head in O(1), or null if this list is empty (ambiguous when null is stored: check isEmpty()).
Returns
Section titled “Returns”E | null
Implementation of
Section titled “Implementation of”pollFirst()
Section titled “pollFirst()”pollFirst():
E|null
Defined in: src/list/LinkedList.ts:520
Removes and returns the first element in O(1), or null if this list is empty (ambiguous when null is stored: check isEmpty()).
Returns
Section titled “Returns”E | null
Implementation of
Section titled “Implementation of”pollLast()
Section titled “pollLast()”pollLast():
E|null
Defined in: src/list/LinkedList.ts:526
Removes and returns the last element in O(1), or null if this list is empty (ambiguous when null is stored: check isEmpty()).
Returns
Section titled “Returns”E | null
Implementation of
Section titled “Implementation of”pop():
E
Defined in: src/list/LinkedList.ts:566
Pops the top of the stack this list represents, that is, removes and returns the head; same as removeFirst(). O(1).
Returns
Section titled “Returns”E
Throws
Section titled “Throws”NoSuchElementException if the list is empty
Implementation of
Section titled “Implementation of”push()
Section titled “push()”push(
e):void
Defined in: src/list/LinkedList.ts:558
Pushes e onto the stack this list represents, that is, inserts it at the head; same as addFirst(e). O(1).
Parameters
Section titled “Parameters”E
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”remove()
Section titled “remove()”Call Signature
Section titled “Call Signature”remove():
E
Defined in: src/list/LinkedList.ts:574
Removes and returns the head; same as removeFirst(). O(1).
Returns
Section titled “Returns”E
Throws
Section titled “Throws”NoSuchElementException if the list is empty
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”Call Signature
Section titled “Call Signature”remove(
o):boolean
Defined in: src/list/LinkedList.ts:580
Removes the first element equal to o (by Objects.equals), if present; same as
removeFirstOccurrence(o). O(n).
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”boolean
true if an element was removed
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”AbstractSequentialList.remove
removeAll()
Section titled “removeAll()”removeAll(
c):boolean
Defined in: src/abstract/AbstractCollection.ts:108
Removes every element that c contains, through the iterator’s remove(); returns true if any was removed.
Parameters
Section titled “Parameters”Collection<unknown>
Returns
Section titled “Returns”boolean
Throws
Section titled “Throws”NullPointerException if c is null
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”AbstractSequentialList.removeAll
removeAt()
Section titled “removeAt()”removeAt(
index):E
Defined in: src/list/LinkedList.ts:285
Removes the element at index. O(min(index, n − index)) to reach the node, then O(1) to unlink it.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”E
the removed element
Throws
Section titled “Throws”IndexOutOfBoundsException if index < 0 or index >= size()
Implementation of
Section titled “Implementation of”List.removeAt
Overrides
Section titled “Overrides”AbstractSequentialList.removeAt
removeFirst()
Section titled “removeFirst()”removeFirst():
E
Defined in: src/list/LinkedList.ts:470
Removes and returns the first element. O(1).
Returns
Section titled “Returns”E
Throws
Section titled “Throws”NoSuchElementException if the list is empty
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”AbstractSequentialList.removeFirst
removeFirstOccurrence()
Section titled “removeFirstOccurrence()”removeFirstOccurrence(
o):boolean
Defined in: src/list/LinkedList.ts:590
Removes the first element (from head to tail) equal to o. O(n) scan from the head, then O(1) to unlink.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”boolean
true if an element was removed
Implementation of
Section titled “Implementation of”removeIf()
Section titled “removeIf()”removeIf(
filter):boolean
Defined in: src/list/LinkedList.ts:374
Removes every element for which filter returns true. O(n), unlinking each match as it goes, so
elements removed before a throwing predicate stay removed.
Parameters
Section titled “Parameters”filter
Section titled “filter”(e) => boolean
Returns
Section titled “Returns”boolean
true if any element was removed
Throws
Section titled “Throws”NullPointerException if filter is null
Throws
Section titled “Throws”ConcurrentModificationException if filter structurally modifies this list
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”AbstractSequentialList.removeIf
removeLast()
Section titled “removeLast()”removeLast():
E
Defined in: src/list/LinkedList.ts:480
Removes and returns the last element. O(1).
Returns
Section titled “Returns”E
Throws
Section titled “Throws”NoSuchElementException if the list is empty
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”AbstractSequentialList.removeLast
removeLastOccurrence()
Section titled “removeLastOccurrence()”removeLastOccurrence(
o):boolean
Defined in: src/list/LinkedList.ts:602
Removes the last element (the first found from tail to head) equal to o. O(n) scan from the tail,
then O(1) to unlink.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”boolean
true if an element was removed
Implementation of
Section titled “Implementation of”removeRange()
Section titled “removeRange()”removeRange(
fromIndex,toIndex):void
Defined in: src/abstract/AbstractList.ts:160
Removes [fromIndex, toIndex). Public so views can delegate.
Parameters
Section titled “Parameters”fromIndex
Section titled “fromIndex”number
toIndex
Section titled “toIndex”number
Returns
Section titled “Returns”void
Throws
Section titled “Throws”IndexOutOfBoundsException for a bad range, before anything is removed
Inherited from
Section titled “Inherited from”AbstractSequentialList.removeRange
replaceAll()
Section titled “replaceAll()”replaceAll(
operator):void
Defined in: src/list/LinkedList.ts:398
Replaces each element with the result of operator applied to it, head to tail. O(n); not a
structural change.
Parameters
Section titled “Parameters”operator
Section titled “operator”(e) => E
Returns
Section titled “Returns”void
Throws
Section titled “Throws”NullPointerException if operator is null
Throws
Section titled “Throws”ConcurrentModificationException if operator structurally modifies this list
Implementation of
Section titled “Implementation of”List.replaceAll
Overrides
Section titled “Overrides”AbstractSequentialList.replaceAll
retainAll()
Section titled “retainAll()”retainAll(
c):boolean
Defined in: src/abstract/AbstractCollection.ts:118
Removes every element that c does not contain, through the iterator’s remove(); returns true if any was
removed.
Parameters
Section titled “Parameters”Collection<unknown>
Returns
Section titled “Returns”boolean
Throws
Section titled “Throws”NullPointerException if c is null
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”AbstractSequentialList.retainAll
reversed()
Section titled “reversed()”reversed():
LinkedList<E>
Defined in: src/list/LinkedList.ts:618
Returns a live, reverse-ordered view in O(1). The view is itself a LinkedList whose reads and
writes go through to this list, with the ends swapped.
Returns
Section titled “Returns”LinkedList<E>
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”AbstractSequentialList.reversed
set(
index,e):E
Defined in: src/list/LinkedList.ts:272
Replaces the element at index with e. O(min(index, n − index)), walking from the nearer end;
not a structural change.
Parameters
Section titled “Parameters”number
E
Returns
Section titled “Returns”E
the element previously at index
Throws
Section titled “Throws”IndexOutOfBoundsException if index < 0 or index >= size()
Implementation of
Section titled “Implementation of”List.set
Overrides
Section titled “Overrides”size()
Section titled “size()”size():
number
Defined in: src/list/LinkedList.ts:191
Returns the number of elements. O(1).
Returns
Section titled “Returns”number
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”sort()
Section titled “sort()”sort(
c?):void
Defined in: src/abstract/AbstractList.ts:222
Sorts the list stably by c (natural ordering when null or omitted): sorts a copy, then writes it back with the
list iterator’s set, so it is not a structural change.
Parameters
Section titled “Parameters”Comparator<E> | null = null
Returns
Section titled “Returns”void
Throws
Section titled “Throws”ClassCastException if natural ordering meets values that cannot be compared
Implementation of
Section titled “Implementation of”List.sort
Inherited from
Section titled “Inherited from”spliterator()
Section titled “spliterator()”spliterator():
Spliterator<E>
Defined in: src/list/LinkedList.ts:424
Returns a spliterator over the elements, used to build streams: ORDERED | SIZED | SUBSIZED, late-binding, fail-fast, splits off growing array batches.
Returns
Section titled “Returns”Spliterator<E>
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”AbstractSequentialList.spliterator
stream()
Section titled “stream()”stream():
Stream<E>
Defined in: src/abstract/AbstractCollection.ts:175
Returns a sequential stream over spliterator().
Returns
Section titled “Returns”Stream<E>
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”subList()
Section titled “subList()”subList(
fromIndex,toIndex):List<E>
Defined in: src/abstract/AbstractList.ts:193
Returns a live view of [fromIndex, toIndex): changes through it write to this list, and a structural change made
to this list directly makes the view throw ConcurrentModificationException. Carries the
RandomAccess brand when this list does.
Parameters
Section titled “Parameters”fromIndex
Section titled “fromIndex”number
toIndex
Section titled “toIndex”number
Returns
Section titled “Returns”List<E>
Throws
Section titled “Throws”IndexOutOfBoundsException if fromIndex < 0 or toIndex > size()
Throws
Section titled “Throws”IllegalArgumentException if fromIndex > toIndex
Implementation of
Section titled “Implementation of”List.subList
Inherited from
Section titled “Inherited from”AbstractSequentialList.subList
toArray()
Section titled “toArray()”Call Signature
Section titled “Call Signature”toArray():
E[]
Defined in: src/list/LinkedList.ts:326
Returns a new array with all elements, head to tail. Changing the array does not affect this list. O(n).
Returns
Section titled “Returns”E[]
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”AbstractSequentialList.toArray
Call Signature
Section titled “Call Signature”toArray<
A>(generator):A
Defined in: src/list/LinkedList.ts:331
Fills an array created by generator(size()) with the elements head to tail, and returns it. O(n).
Type Parameters
Section titled “Type Parameters”A extends WritableArrayLike<E>
Parameters
Section titled “Parameters”generator
Section titled “generator”(length) => A
creates the target array for a given length
Returns
Section titled “Returns”A
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”AbstractSequentialList.toArray
toString()
Section titled “toString()”toString():
string
Defined in: src/list/LinkedList.ts:649
Returns the elements head to tail as [a, b, c]; an element that is this list prints as (this Collection).
Returns
Section titled “Returns”string
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”AbstractSequentialList.toString
staticof<E>(…xs):LinkedList<E>
Defined in: src/list/LinkedList.ts:61
Creates a mutable list holding xs in argument order; null and undefined are allowed.
Type Parameters
Section titled “Type Parameters”E
Parameters
Section titled “Parameters”…E[]
Returns
Section titled “Returns”LinkedList<E>