manip-array
v1.0.2
Published
Make arrays easier to manipulate!
Downloads
4
Maintainers
Readme
manip-array
Make arrays easier to manipulate! 🦾
Installation
npm i manip-array
Usage
.remove(array, value :int :string)
remove a specific string or index from an array
const manipArray = require('manip-array');
let array = ['foo','bar','foobar']
let foo = manipArray.remove(array, 'bar')
let bar = manipArray.remove(array, 2)
.create(string, {method: 'method'})
create an array from a string.
const manipArray = require('manip-array');
let foo = manipArray.create('testing if this works', {method: 'charachter'})
console.log(foo);
| methods | Returns? | |-------------|---------------------------------------------| | whitespaces | String split into array without whitespaces | | character | All characters to an array |
.compact(array)
removes every empty string and or whitespaces inside of an array.
const manipArray = require('manip-array');
let foo = manipArray.create('testing if this works', {method: 'charachter'});
let bar = manipArray.compact(foo);
console.log(bar);