Make any value an array. No dependencies.
npm install as-array --save
var asArray = require('as-array');
asArray() === [];
asArray('my string') === ['my string'];
asArray([1,2,3]) === [1,2,3];
function tester () {
asArray(arguments) === ['arg1', 'arg2'];
}
tester('arg1', 'arg2');
data
- any data type to convert to an arrayconvertObject
- OPTIONALboolean
- pull values from object as array content
npm install
npm test