Extensions of the Array.prototype object
npm install plus_arrays[![NPM version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]
[![Coverage Status][coveralls-image]][coveralls-url]
[![Dependencies][dependencies-image]][dependencies-url]
JS-Arrays-Sugar
===============
> Extensions of the Array.prototype object
The package can be easily installed via npm:
```
npm install plus_arrays
To register the custon methods to the 'Array.prototype' object, we simply require the package
``
require(plusArrays)
Checks whether the array contains the same elements as arr. If this is the case, true will be returned, otherwise false.
which are equal to elem.$3
Returns true if the array contains elem, false otherwise.$3
Returns a random element of the array.$3
Returns a new array of length no by sampling without replacement from the original array.$3
Returns true if the array contains all elements of Array arr, false otherwise.$3
Returns true if the array contains at least one of the elements of Array arr, false otherwise.$3
Removes the element at position index such that the array ends up with one element less than before.$3
Returns a new array in which the elements of the original array are randomly re-arranged.$3
Returns a new array in which any duplicates are removed.$3
Concatenates array arr to the original array, after removing all elements present in the original array.$3
Returns an array of indices giving the position of the element in a sorted array. The fun parameter expects a custom comparator function. If none is supplied,
elements are sorted in increasing order.Unit Tests
Run tests via the command
npm test`---
[npm-image]: https://badge.fury.io/js/plus_arrays.svg
[npm-url]: http://badge.fury.io/js/plus_arrays
[travis-image]: https://travis-ci.org/Planeshifter/plusArrays.js.svg
[travis-url]: https://travis-ci.org/Planeshifter/plusArrays.js
[coveralls-image]: https://img.shields.io/coveralls/Planeshifter/plusArrays.js/master.svg
[coveralls-url]: https://coveralls.io/r/Planeshifter/plusArrays.js?branch=master
[dependencies-image]: http://img.shields.io/david/Planeshifter/plusArrays.js.svg
[dependencies-url]: https://david-dm.org/Planeshifter/plusArrays.js