Namespace: Function

utilx. Function

utilx.Function
Source:

Methods

(static) apply(fn, thisArg, argsArrayopt) → {*}

This method calls a function with a given this value and arguments provided individually.
Parameters:
Name Type Attributes Description
fn function
thisArg *
argsArray ArrayLike <optional>
Source:
Returns:
Type
*

(static) bind(fn, thisArg, …varArgsopt) → {boundFunction}

The bind() function creates a new function (a bound function) with the same function body (internal call property in ECMAScript 5 terms) as the function it is being called on (the bound function's target function) with the this value bound to thisArg, which cannot be overridden.
Parameters:
Name Type Attributes Description
fn bindTargetFunction
thisArg * the this argument to be bound to the new function
varArgs * <optional>
<repeatable>
any arguments to be bound to the new function.
Source:
See:
Throws:
if fn is not a function.
Type
TypeError
Returns:
.
Type
boundFunction

(static) call(fn, thisArg, …varArgsopt) → {*}

This method calls a function with a given this value and arguments provided individually.
Parameters:
Name Type Attributes Description
fn function
thisArg *
varArgs * <optional>
<repeatable>
Source:
Returns:
Type
*

(static) inherits(ctor, superCtor) → {undefined}

This method inherits the prototype methods from one constructor into another.
Parameters:
Name Type Description
ctor function
superCtor function
Source:
Returns:
Type
undefined

(static) isFunction(inputArg) → {boolean}

Returns true if the operand inputArg is a Function.
Parameters:
Name Type Description
inputArg *
Source:
See:
Returns:
Type
boolean

(static) isNativeFunction(inputArg) → {boolean}

Returns true if the operand inputArg is a native Function.
Parameters:
Name Type Description
inputArg *
Source:
Returns:
Type
boolean

(static) noop() → {undefined}

Returns the primitive value undefined.
Source:
Returns:
Type
undefined

(static) returnArgs(…varArgsopt) → {Arguments}

Returns an arguments object of the arguments supplied.
Parameters:
Name Type Attributes Description
varArgs * <optional>
<repeatable>
Source:
Returns:
Type
Arguments

(static) ToMethod(protoFn, checkThisArgFn) → {boundPrototypalFunction}

The function takes one argument protoFn, and returns the bound function as a stand alone method. Default this check is to checkObjectCoercible.
Parameters:
Name Type Description
protoFn prototypalFunction
checkThisArgFn function
Source:
Throws:
if protoFn is not a function.
Type
TypeError
Returns:
Type
boundPrototypalFunction