Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

nulls

Create an array filled with nulls and having a specified length.

Usage

var nulls = require( '@stdlib/array/nulls' );

nulls( length[, dtype] )

Creates an array filled with nulls and having a specified length.

var arr = nulls( 2 );
// returns [ null, null ]

The function recognizes the following data types:

  • generic: generic JavaScript values.

By default, the output array data type is 'generic'. To specify an alternative data type, provide a dtype argument.

var arr = nulls( 2, 'generic' );
// returns [ null, null ]

Examples

var nulls = require( '@stdlib/array/nulls' );

// Create a filled array:
var x = nulls( 10 );
console.log( x );