Skip to content
On this page

LinkedList<T>.clear

Removes all nodes from the LinkedList<T>.

Example

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

list.length // => 4
list.clear();
list.length // => 0