Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "array/full/docs/types/index.d"

Index

Functions

Functions

Export assignment full

  • full<T, U>(length: number, value: T, dtype?: U): DataTypeMap<T>[U]
  • Creates a filled array having a specified length.

    Type parameters

    Parameters

    • length: number

      array length

    • value: T

      fill value

    • Optional dtype: U

      data type (default: 'float64')

    Returns DataTypeMap < T > [ U ]

    filled array

    Example

    var arr = full( 2, 1.0 );
    // returns <Float64Array>[ 1.0, 1.0 ]

    Example

    var arr = full( 2, 1.0, 'float32' );
    // returns <Float32Array>[ 1.0, 1.0 ]