Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "utils/argument-function/docs/types/index.d"

Index

Functions

Functions

Export assignment argumentFunction

  • argumentFunction(idx: number): Function
  • Returns a function which always returns a specified argument.

    Notes

    • The input argument corresponds to the zero-based index of the argument to return.
    throws

    must provide a nonnegative integer

    Parameters

    • idx: number

      argument index

    Returns Function

    argument function

    Example

    var argn = argumentFunction( 1 );
    
    var v = argn( 1.0, 2.0, 3.0 );
    // returns 2.0
    
    v = argn( 'a', 'b', 'c' );
    // returns 'b'
    
    v = argn( null );
    // returns undefined