Calculate min & max of an array:
Math.max.apply(Math, my_array) Math.min.apply(Math, my_array)
I did not found it out by myself, I took it from this discussion!
You could also use:
…but that doesn’t always work, without knowing why 😉