filled

Create a filled "generic" array.

Usage

var filled = require( '@stdlib/array/base/filled' );

filled( value, len )

Returns a filled "generic" array.

var out = filled( 0.0, 3 );
// returns [ 0.0, 0.0, 0.0 ]

Examples

var filled = require( '@stdlib/array/base/filled' );

var out = filled( 0.0, 3 );
// returns [ 0.0, 0.0, 0.0 ]

out = filled( 'beep', 3 );
// returns [ 'beep', 'beep', 'beep' ]

out = filled( null, 3 );
// returns [ null, null, null ]

out = filled( true, 3 );
// returns [ true, true, true ]

out = filled( void 0, 3 );
// returns [ undefined, undefined, undefined ]
Did you find this page helpful?