prefill-array
Prefill an array with values.
Install
Install prefill-array
using npm:
npm install --save prefill-array
Or via yarn:
yarn add prefill-array
Usage
const prefill = ; const leet = ;console;// → [ 1337, 1337, 1337, 1337, 1337 ] const recursive = ;console;// → [ [ '2D', '2D' ], [ '2D', '2D' ], [ '2D', '2D' ], [ '2D', '2D' ] ]
Syntax
const newArray = ;
Parameters
number
Number of elements to insert. Must be greater than or equal to zero.
value
Value to use for filling.
Return value
Returns the filled array.
License
MIT