Returning key of maximum or minimum number in a table

Viewed 10940

A simple Lua problem here: how to find the index, or key, of the minimum or maximum number in a given table.

math.max/math.min only gives the actual max or min number, not the key.

2 Answers
Related