---
title: std.collections
canonical_url: https://mew-lang.org/stdlib/collections/
sidecar_url: https://mew-lang.org/stdlib/collections.md
content_hash: sha256:ef60835488a215e510438e70fd502b3e1d18a8157569e815b8b270d8b95d11f1
tokens: 207
uid: stdlib.collections
reading_time_minutes: 1
---

Standard Library
# std.collections

 
## Types

 
    Type Description     List<T> A list that grows as items are added.    
## `List<T>`

 
Implements `Enumerable<T>` and `Display`.

 
    Member Description     `List<T>::new() -> List<T>` Creates an empty list.   `add(item: T)` Adds the item to the end of the list.   `count() -> i32` Returns the number of items.   `get(index: i32) -> T` Returns the item at the index. Panics if the index is out of range.   `set(index: i32, item: T)` Replaces the item at the index. Panics if the index is out of range.   `clear()` Removes all items.   `to_array() -> T[]` Copies the items into an array.    
[Previous
                
                std.cli](https://mew-lang.org/stdlib/cli.md)[Next
                    
                std.convert](https://mew-lang.org/stdlib/convert.md)