make-array
Creates a real Array from almost anything.
Install
$ npm i make-array --save
Usage
var makeArray = ;; // []; // []; // []; // [1]; // [1, 2]; // [1, 2] { return ;} ; // [1, 2, 3]
makeArray(subject, [host])
- subject
mixed
things you want to make it an array - host
Array=
ifhost
is specified, the newly-created array will append to the end of thehost
Returns Array
. If host
is specified, it will return the host
itself.
var host = 1 2;{ return arguments;} var result = ;result; // [1, 2, {}, []];result === host; // true
Changelog
1.0.0: bump version to mark it as stable.
License
MIT