# size

Source: https://taxilang.org/docs/language/stdlib/size

**Full name:** `taxi.stdlib.size`

## Signature

```taxi
declare extension function <T> size(collection:T[]):Int
```

## Description

Returns the number of elements in the collection.

```taxi
find { orders: Order[] } as {
   orderCount: Int = orders.size()
}
```

## Examples

Returns the number of elements in the collection.

Schema:

```taxi
model Cart {
   items: String[]
}
```

Query:

```taxi
given {
   cart: Cart = { items: ['apple', 'banana', 'cherry'] }
}
find {
   itemCount: Int = cart.items.size()
}
```

Result:

```json
{
  "itemCount": 3
}
```
