Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "array/filled-by/docs/types/index.d"

Index

Type aliases

ArrayOrTypedArray

ArrayOrTypedArray: Array<any> | RealOrComplexTypedArray

Array or typed array.

Callback

Callback: Nullary | Unary

Callback function.

param

current array index

returns

fill value

Nullary

Nullary: () => any

Nullary callback function.

returns

fill value

Type declaration

    • (): any
    • Returns any

Unary

Unary: (i: number) => any

Unary callback function.

param

current array index

returns

fill value

Type declaration

    • (i: number): any
    • Parameters

      • i: number

      Returns any

Functions

Export assignment filledarrayBy

  • Creates a filled array according to a provided callback function and having a specified data type.

    The function recognizes the following data types:

    • float64: double-precision floating-point numbers (IEEE 754)
    • float32: single-precision floating-point numbers (IEEE 754)
    • complex128: double-precision complex floating-point numbers
    • complex64: single-precision complex floating-point numbers
    • int32: 32-bit two's complement signed integers
    • uint32: 32-bit unsigned integers
    • int16: 16-bit two's complement signed integers
    • uint16: 16-bit unsigned integers
    • int8: 8-bit two's complement signed integers
    • uint8: 8-bit unsigned integers
    • uint8c: 8-bit unsigned integers clamped to 0-255
    • generic: generic JavaScript values

    Parameters

    Returns ArrayOrTypedArray

    filled array

    Example

    var arr = filledarrayBy();
    // returns <Float64Array>

    Example

    var arr = filledarrayBy( 'float32' );
    // returns <Float32Array>
  • Creates a filled array according to a provided callback function and having a specified length.

    Parameters

    • length: number

      array length

    • clbk: Callback

      callback function

    • Optional thisArg: any

      callback function execution context

    Returns ArrayOrTypedArray

    filled array

    Example

    var constantFunction = require( `@stdlib/utils/constant-function` );
    
    var arr = filledarrayBy( 5, constantFunction( 1.0 ) );
    // returns <Float64Array>[ 1.0, 1.0, 1.0, 1.0, 1.0 ]
  • Creates a filled array according to a provided callback function and having a specified length.

    The function recognizes the following data types:

    • float64: double-precision floating-point numbers (IEEE 754)
    • float32: single-precision floating-point numbers (IEEE 754)
    • complex128: double-precision complex floating-point numbers
    • complex64: single-precision complex floating-point numbers
    • int32: 32-bit two's complement signed integers
    • uint32: 32-bit unsigned integers
    • int16: 16-bit two's complement signed integers
    • uint16: 16-bit unsigned integers
    • int8: 8-bit two's complement signed integers
    • uint8: 8-bit unsigned integers
    • uint8c: 8-bit unsigned integers clamped to 0-255
    • generic: generic JavaScript values

    Parameters

    • length: number

      array length

    • dtype: DataType

      data type

    • clbk: Callback

      callback function

    • Optional thisArg: any

      callback function execution context

    Returns ArrayOrTypedArray

    filled array

    Example

    var constantFunction = require( `@stdlib/utils/constant-function` );
    
    var arr = filledarrayBy( 5, 'float64', constantFunction( 1.0 ) );
    // returns <Float64Array>[ 1.0, 1.0, 1.0, 1.0, 1.0 ]
  • Creates a filled array from another array according to a provided callback function.

    Parameters

    • array: Collection

      typed array or array-like object

    • clbk: Callback

      callback function

    • Optional thisArg: any

      callback function execution context

    Returns ArrayOrTypedArray

    filled array

    Example

    var constantFunction = require( `@stdlib/utils/constant-function` );
    
    var arr = filledarrayBy( [ 5.0, -3.0, 2.0 ], constantFunction( 1.0 ) );
    // returns <Float64Array>[ 1.0, 1.0, 1.0 ]
  • Creates a filled array from another array according to a provided callback function.

    The function recognizes the following data types:

    • float64: double-precision floating-point numbers (IEEE 754)
    • float32: single-precision floating-point numbers (IEEE 754)
    • complex128: double-precision complex floating-point numbers
    • complex64: single-precision complex floating-point numbers
    • int32: 32-bit two's complement signed integers
    • uint32: 32-bit unsigned integers
    • int16: 16-bit two's complement signed integers
    • uint16: 16-bit unsigned integers
    • int8: 8-bit two's complement signed integers
    • uint8: 8-bit unsigned integers
    • uint8c: 8-bit unsigned integers clamped to 0-255
    • generic: generic JavaScript values

    Parameters

    • array: Collection

      typed array or array-like object

    • dtype: DataType

      data type

    • clbk: Callback

      callback function

    • Optional thisArg: any

      callback function execution context

    Returns ArrayOrTypedArray

    filled array

    Example

    var constantFunction = require( `@stdlib/utils/constant-function` );
    
    var arr = filledarrayBy( [ 5.0, -3.0, 2.0 ], 'float64', constantFunction( 1.0 ) );
    // returns <Float64Array>[ 1.0, 1.0, 1.0 ]
  • Creates a filled array from an iterable according to a callback function.

    Parameters

    Returns ArrayOrTypedArray

    filled array

    Example

    var constantFunction = require( `@stdlib/utils/constant-function` );
    var iterConstant = require( `@stdlib/iter/constant` );
    
    var it = iterConstant( 3.0, {
        'iter': 3
    });
    var arr = filledarrayBy( it, constantFunction( 1.0 ) );
    // returns <Float64Array>[ 1.0, 1.0, 1.0 ]
  • Creates a filled array from an iterable according to a callback function.

    The function recognizes the following data types:

    • float64: double-precision floating-point numbers (IEEE 754)
    • float32: single-precision floating-point numbers (IEEE 754)
    • complex128: double-precision complex floating-point numbers
    • complex64: single-precision complex floating-point numbers
    • int32: 32-bit two's complement signed integers
    • uint32: 32-bit unsigned integers
    • int16: 16-bit two's complement signed integers
    • uint16: 16-bit unsigned integers
    • int8: 8-bit two's complement signed integers
    • uint8: 8-bit unsigned integers
    • uint8c: 8-bit unsigned integers clamped to 0-255
    • generic: generic JavaScript values

    Parameters

    Returns ArrayOrTypedArray

    filled array

    Example

    var constantFunction = require( `@stdlib/utils/constant-function` );
    var iterConstant = require( `@stdlib/iter/constant` );
    
    var it = iterConstant( 3.0, {
        'iter': 3
    });
    var arr = filledarrayBy( it, 'float64', constantFunction( 1.0 ) );
    // returns <Float64Array>[ 1.0, 1.0, 1.0 ]
  • Returns a filled typed array view of an ArrayBuffer according to a provided callback function.

    Notes

    • Creating a generic array from an ArrayBuffer is not supported.

    Parameters

    • buffer: ArrayBuffer

      ArrayBuffer

    • byteOffset: number

      byte offset

    • length: number

      view length

    • clbk: Callback

      callback function

    • Optional thisArg: any

      callback function execution context

    Returns RealOrComplexTypedArray

    filled array

    Example

    var constantFunction = require( `@stdlib/utils/constant-function` );
    var ArrayBuffer = require( `@stdlib/array/buffer` );
    
    var buf = new ArrayBuffer( 32 );
    var arr = filledarrayBy( buf, 8, 2, constantFunction( 1.0 ) );
    // returns <Float64Array>[ 1.0, 1.0 ]
  • Returns a filled typed array view of an ArrayBuffer according to a provided callback function.

    The function recognizes the following data types:

    • float64: double-precision floating-point numbers (IEEE 754)
    • float32: single-precision floating-point numbers (IEEE 754)
    • complex128: double-precision complex floating-point numbers
    • complex64: single-precision complex floating-point numbers
    • int32: 32-bit two's complement signed integers
    • uint32: 32-bit unsigned integers
    • int16: 16-bit two's complement signed integers
    • uint16: 16-bit unsigned integers
    • int8: 8-bit two's complement signed integers
    • uint8: 8-bit unsigned integers
    • uint8c: 8-bit unsigned integers clamped to 0-255
    • generic: generic JavaScript values

    Notes

    • Creating a generic array from an ArrayBuffer is not supported.

    Parameters

    • buffer: ArrayBuffer

      ArrayBuffer

    • byteOffset: number

      byte offset

    • length: number

      view length

    • dtype: DataType

      data type

    • clbk: Callback

      callback function

    • Optional thisArg: any

      callback function execution context

    Returns RealOrComplexTypedArray

    filled array

    Example

    var constantFunction = require( `@stdlib/utils/constant-function` );
    var ArrayBuffer = require( `@stdlib/array/buffer` );
    
    var buf = new ArrayBuffer( 32 );
    var arr = filledarrayBy( buf, 8, 2, 'float64', constantFunction( 1.0 ) );
    // returns <Float64Array>[ 1.0, 1.0 ]
  • Returns a filled typed array view of an ArrayBuffer according to a provided callback function.

    Notes

    • Creating a generic array from an ArrayBuffer is not supported.

    Parameters

    • buffer: ArrayBuffer

      ArrayBuffer

    • byteOffset: number

      byte offset

    • clbk: Callback

      callback function

    • Optional thisArg: any

      callback function execution context

    Returns RealOrComplexTypedArray

    filled array

    Example

    var constantFunction = require( `@stdlib/utils/constant-function` );
    var ArrayBuffer = require( `@stdlib/array/buffer` );
    
    var buf = new ArrayBuffer( 32 );
    var arr = filledarrayBy( buf, 8, constantFunction( 1.0 ) );
    // returns <Float64Array>[ 1.0, 1.0, 1.0 ]
  • Returns a filled typed array view of an ArrayBuffer according to a provided callback function.

    The function recognizes the following data types:

    • float64: double-precision floating-point numbers (IEEE 754)
    • float32: single-precision floating-point numbers (IEEE 754)
    • complex128: double-precision complex floating-point numbers
    • complex64: single-precision complex floating-point numbers
    • int32: 32-bit two's complement signed integers
    • uint32: 32-bit unsigned integers
    • int16: 16-bit two's complement signed integers
    • uint16: 16-bit unsigned integers
    • int8: 8-bit two's complement signed integers
    • uint8: 8-bit unsigned integers
    • uint8c: 8-bit unsigned integers clamped to 0-255
    • generic: generic JavaScript values

    Notes

    • Creating a generic array from an ArrayBuffer is not supported.

    Parameters

    • buffer: ArrayBuffer

      ArrayBuffer

    • byteOffset: number

      byte offset

    • dtype: DataType

      data type

    • clbk: Callback

      callback function

    • Optional thisArg: any

      callback function execution context

    Returns RealOrComplexTypedArray

    filled array

    Example

    var constantFunction = require( `@stdlib/utils/constant-function` );
    var ArrayBuffer = require( `@stdlib/array/buffer` );
    
    var buf = new ArrayBuffer( 32 );
    var arr = filledarrayBy( buf, 8, 'float64', constantFunction( 1.0 ) );
    // returns <Float64Array>[ 1.0, 1.0, 1.0 ]
  • Returns a filled typed array view of an ArrayBuffer according to a provided callback function.

    Notes

    • Creating a generic array from an ArrayBuffer is not supported.

    Parameters

    • buffer: ArrayBuffer

      ArrayBuffer

    • clbk: Callback

      callback function

    • Optional thisArg: any

      callback function execution context

    Returns RealOrComplexTypedArray

    filled array

    Example

    var constantFunction = require( `@stdlib/utils/constant-function` );
    var ArrayBuffer = require( `@stdlib/array/buffer` );
    
    var buf = new ArrayBuffer( 32 );
    var arr = filledarrayBy( buf, constantFunction( 1.0 ) );
    // returns <Float64Array>[ 1.0, 1.0, 1.0, 1.0 ]
  • Returns a filled typed array view of an ArrayBuffer according to a provided callback function.

    The function recognizes the following data types:

    • float64: double-precision floating-point numbers (IEEE 754)
    • float32: single-precision floating-point numbers (IEEE 754)
    • complex128: double-precision complex floating-point numbers
    • complex64: single-precision complex floating-point numbers
    • int32: 32-bit two's complement signed integers
    • uint32: 32-bit unsigned integers
    • int16: 16-bit two's complement signed integers
    • uint16: 16-bit unsigned integers
    • int8: 8-bit two's complement signed integers
    • uint8: 8-bit unsigned integers
    • uint8c: 8-bit unsigned integers clamped to 0-255
    • generic: generic JavaScript values

    Notes

    • Creating a generic array from an ArrayBuffer is not supported.

    Parameters

    • buffer: ArrayBuffer

      ArrayBuffer

    • dtype: DataType

      data type

    • clbk: Callback

      callback function

    • Optional thisArg: any

      callback function execution context

    Returns RealOrComplexTypedArray

    filled array

    Example

    var constantFunction = require( `@stdlib/utils/constant-function` );
    var ArrayBuffer = require( `@stdlib/array/buffer` );
    
    var buf = new ArrayBuffer( 32 );
    var arr = filledarrayBy( buf, 'float64', constantFunction( 1.0 ) );
    // returns <Float64Array>[ 1.0, 1.0, 1.0, 1.0 ]