JavaScript: Methods for finding the maximum or minimum element in an Array / List with randomization or shuffling

There are many scenarios where the maximum or minimum element of an array has to be selected. For instance in Box Plots. Fewer scenarios come to mind, where shuffling of elements or picking a random element within an array, is necessary. A typical sample scenario would be, the selection of a random tune from a playlist, a script visualizing a stochastic process or endowing an algorithm with random initial parameters.

The following script shows how easy such operations are accessible in JavaScript:
LihatTutupKomentar