# Last selector

Learn how to get the last items of a list.

The last selector is the counterpart of the first selector. It allows you to access the last elements of a [collection](/reference/cql/data-types/core/collection) without knowing the index or key.

For example, to access the last item in a list, you can use:

```cql
let transport = ["🚀", "🚗", "🚆️"];

transport[:last] // 🚆
```

You can also use it to access a specific number of items from the end of a list:

```cql
transport[:last(/*<count>*/)]
```

For example, to access the last two items of a list, you can use:

```cql
transport[:last(2)] // ["🚗", "🚆"]
```

In the real world, you can use it to access the last item a user added to their shopping cart:

```cql
cart.items[:last]
```

And you can also use it to access the last element of a map:

```cql
let beings = ["aliens": "👽", "robots": "🤖", "humans": "👨‍🚀"];

beings[:last] // 👨‍🚀
```

Similar to the `:first` selector, `:last` does not use the index or key to find the last element but the order in which they appear in the collection.
