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