matrix-fill
Create and fill in 2D Array of any type.
Install
Install with npm:
$ npm install --save matrix-fill
Usage
Returns 2D array of values of any type.
const fill = ; console//=> [ [ 'abc', 'abc', 'abc', 'abc', 'abc' ],// [ 'abc', 'abc', 'abc', 'abc', 'abc' ],// [ 'abc', 'abc', 'abc', 'abc', 'abc' ],// [ 'abc', 'abc', 'abc', 'abc', 'abc' ],// [ 'abc', 'abc', 'abc', 'abc', 'abc' ] ] console//=> [ [ 5, 5, 5, 5, 5 ],// [ 5, 5, 5, 5, 5 ],// [ 5, 5, 5, 5, 5 ],// [ 5, 5, 5, 5, 5 ],// [ 5, 5, 5, 5, 5 ] ] console;// [ [ { name: 'steve' }, { name: 'steve' }, { name: 'steve' } ],// [ { name: 'steve' }, { name: 'steve' }, { name: 'steve' } ],// [ { name: 'steve' }, { name: 'steve' }, { name: 'steve' } ] ]
Params
;
value
: {*} the value to fill the matrix with.rows
: {Number} the number of rows in the matrix.columns
: {Number} the number of columns in the matrix.