ab-array

0.0.6 • Public • Published

ab-array

Array prototype addons.

// move element up Array.prototype.moveUp() // move element down Array.prototype.moveDown() // get index of element Array.prototype.indexOf() // remove element Array.prototype.removeElement()

Install

With npm do:

$ npm install ab-array --save-dev

Usage

require('ab-array');

var myarray = ['a', 'b', 'c'];

myarray.moveUp('c', 1);

// myarray becomes ['a', 'c', 'b'];

myarray.moveDown('c', 1);

// myarray becomes ['a', 'b', 'c'];

myarray.indexOf('c'); 

// 2

myarray.removeElement('c');

// myarray becomes ['a', 'b'];

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i ab-array

Weekly Downloads

1

Version

0.0.6

License

MIT

Last publish

Collaborators

  • antoniobrandao