create-array
Create an array from a given size and a generator
Features
- Compatible Node & browsers
- Pre-allocate array for better performance.
Installation
Browserify/Webpack
Node &Installation of the npm package:
> npm install --save create-array
Then require the package:
var createArray = ;
Browser
You can directly use the build provided at unpkg.com:
Usage
var array = createArray(length, generator)
:
// From a value.console;// → ['foo', 'foo', 'foo'] // With a function.console;// → ['item #0', 'item #1', 'item #2']
Contributions
Contributions are very welcomed, either on the documentation or on the code.
You may:
- report any issue you've encountered;
- fork and create a pull request.
License
ISC © Julien Fontanet