> For the complete documentation index, see [llms.txt](https://trizen.gitbook.io/sidef-lang/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trizen.gitbook.io/sidef-lang/programming_tasks/g/greatest_element_of_a_list.md).

# Greatest element of a list

The `max` method returns the greatest element in a list. It works only if the array's elements have the same type (e.g.: strings, numbers).

```ruby
values.max
```
