Skip to content

antoniobrandao/ab-array

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Array prototype addons

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published