arrayMax

arrayMax

> Functions

Returns the element with the maximum value in the array array. Values are ranked as follows: null x > m ? x : m)` instead.

Python

In Python, max() raises a ValueError on an empty list, where arrayMax returns null: pass default to get that behavior, max(a, default=None). The comparison is Python's, not LeekScript's ordering: a list mixing numbers and strings raises a TypeError instead of ordering them. max also accepts a key, max(a, key=lambda e: e.life), and then returns the element, not the value of the key.