Skip to content
On this page

LinkedList<T>.last ​

Gets the last node of the LinkedList<T>.

Property Value ​

null | LinkedListNode<T>

Example ​

typescript
const list = new LinkedList<number>([1, 2, 3, 4]);

list.last // => LinkListNode(4)

Remarks ​

If the LinkedList<T> is empty, the first and last properties contain null.

Retrieving the value of this property is an O(1) operation.