compact-array
v0.0.1
Published
Returns an array with "non-empty" values only.
Downloads
15
Readme
compact-array
Returns an array with non-empty values only.
Install
npm install compact-array
bower install compact-array
Usage
var compact = require('compact-array');
var array = [
'b',
null,
false,
1,
0,
'',
['lolz', null, ['a',4,null], undefined]
];
console.log(compact(array));
// [
'b',
false,
1,
0,
['lolz',['a',4]
]
console.log(compact('non array')); // []
License
MIT