Create an ndarray filled with
falsevalues and having a specified shape and data type.
var falses = require( '@stdlib/ndarray/base/falses' );Creates an ndarray filled with false values and having a specified shape and data type.
var getDType = require( '@stdlib/ndarray/dtype' );
var arr = falses( 'bool', [ 2, 2 ], 'row-major' );
// returns <ndarray>[ [ false, false ], [ false, false ] ]
var dt = String( getDType( arr ) );
// returns 'bool'The function accepts the following arguments:
var ndarray2array = require( '@stdlib/ndarray/to-array' );
var falses = require( '@stdlib/ndarray/base/falses' );
var arr = falses( 'bool', [ 2, 2 ], 'row-major' );
console.log( ndarray2array( arr ) );
arr = falses( 'generic', [ 2, 2 ], 'row-major' );
console.log( ndarray2array( arr ) );