Interface ArrayStatic

Index

Methods

Methods

public create(args?: Array<T>): Array<T>

Alternate array constructor.

extra

This method will create a single array by calling %concat% on all arguments passed. In addition to ensuring that an unknown variable is in a single, flat array (the standard constructor will create nested arrays, this one will not), it is also a useful shorthand to convert a function's arguments object into a standard array.

example

Array.create('one', true, 3) -> ['one', true, 3] Array.create(['one', true, 3]) -> ['one', true, 3] Array.create(function(n) { return arguments; }('howdy', 'doody'));

Parameters

  • args?: Array<T> optional

    Elements to create the array from.

Returns

Array<T>

Array containing the elements in .

public isArray(obj: any): boolean

Returns true if is an Array.

extra

This method is provided for browsers that don't support it internally.

example

Array.isArray(3) -> false Array.isArray(true) -> false Array.isArray('wasabi') -> false Array.isArray([1,2,3]) -> true

Parameters

  • obj: any

    Object to check if it is an Array.

Returns

boolean

True if is of type Array.