资 源 简 介
This javascript extension for Prototype.js aims to provide more basic tools and functions for math-related development. It extends Math native object, Number and Array native classes.
Please visit the Wiki section for some documentation.
The Prototype.js javascript framework can be found at http://www.prototypejs.org .
```
/*** Here are some examples of what you can do with math-extend. ***/
// Get the mean value of an array of numbers:
Math.mean([1, 2, 3, 4, 5]); // -> returns 3
// Get the standard deviation value of an array of numbers:
Math.stdDev([78, 88, 93, 67, 89, 75, 91]); // -> returns approximately 9
// Shuffle an array, which can contain elements of any kind:
["Hello", "World", 1, 2, 3].shuffle(); // -> possible output: [3, "World", 1, "Hello", 2]
// Or, randomly select some items from an array:
[3, 7, 12, 21, 5, 1, 9].randomDraw(3); // -