Skip to content
On this page

LinkedList<T>.length

Gets the number of nodes actually contained in the LinkedList<T>.

Property Value

number

Example

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

list.length // => 4

Remarks

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