array-future

A collection of Array prototypes prollyfills as proposition for ECMAScript 7.

Usage no npm install needed!

<script type="module">
  import arrayFuture from 'https://cdn.skypack.dev/array-future';
</script>

README

array-future

Last version Build Status Dependency status Dev Dependencies Status NPM Status Donate

A collection of Array prototypes prollyfills as proposition for ECMAScript 7.

Prollyfill: A polyfill for a not yet standardized API.

Install

npm install array-future --save

If you want to use in the browser (powered by Browserify):

bower install array-future --save

and later link in your HTML:

<script src="bower_components/array-future/dist/array-future.js"></script>

Usage

As library

var arrayFuture = require('array-future')

As global

require('array-future/register')

API

Instance

  • Array.clear()
  • Array.clone()
  • Array.combination({size})
  • Array.compact()
  • Array.difference({Array})
  • Array.empty()
  • Array.first()
  • Array.includes({elem})
  • Array.intersect({Array})
  • Array.last()
  • Array.max()
  • Array.mean()
  • Array.median()
  • Array.min()
  • Array.mode()
  • Array.range()
  • Array.remove({elem})
  • Array.replace({oldElem}, {newElem})
  • Array.shuffle()
  • Array.sum()
  • Array.unique()
  • Array.zip({...others})

Static

  • Array.range({start, stop, step})

Related

  • array-list – Simple array list implementation.

License

MIT © Kiko Beats