An open API service indexing awesome lists of open source software.

https://github.com/harrystevens/-deprecated-arrays

A JavaScript library for manipulating arrays.
https://github.com/harrystevens/-deprecated-arrays

Last synced: 27 days ago
JSON representation

A JavaScript library for manipulating arrays.

Awesome Lists containing this project

README

          

This project is deprecated. Please use [jsz](https://github.com/harrystevens/jsz) instead.

# arrays.js

arrays.js is a Javascript library for manipulating arrays. Javascript has many [built-in methods for manipulating arrays](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array). The functions in this library are meant to supplement those.

To use this library, download `arrays.js` or `arrays.min.js` from the `src` directory and include it in your HTML file as `` or ``.

## API Reference
* [Math](#math)
* [Queries](#queries)
* [Transformations](#transformations)
* [Other](#other)

### Math

Functions for doing math with arrays of numbers.

# arrays.average(array)

Returns the average of an array of numbers.

# arrays.extent(array)

Returns the minimum and maximum values of an array of numbers as the array [min, max].

# arrays.max(array)

Returns the maximum value of an array of numbers.

# arrays.median(array)

Returns the median of an array of numbers.

# arrays.min(array)

Returns the minimum value of an array of numbers.

# arrays.sum(array)

Returns the sum of an array of numbers.

### Queries

Functions for testing arrays for certain properties. Return booleans.

# arrays.is(array)

Tests whether an element is an array. Returns *true* or *false*.

### Transformations

Functions for transforming arrays.

# arrays.shuffle(array)

Shuffles an array.

# arrays.sortNumbers(array)

Sorts an array of numbers.

### Other

Miscellaneous functions.

# arrays.random(array)

Returns a random item from an array.