Provides extensions to the base ECMAScript (JavaScript) Array functionality by adding static methods.
Array Type Extensions
Methods
public add(array: Array<any>, element: any)
Adds an element to the end of an Array object. This function is static and is invoked without creating an instance of the object.
Parameters
public addRange(array: any, items: any)
Copies all the elements of the specified array to the end of an Array object.
Parameters
public clear()
Removes all elements from an Array object.
public clone(): Array<any>
Creates a shallow copy of an Array object.
Returns
Array<any>
public contains(element: any): boolean
Determines whether an element is in an Array object.
Parameters
Returns
boolean
public dequeue(): any
Removes the first element from an Array object.
Returns
any
public enqueue(element: any)
Adds an element to the end of an Array object. Use the add function instead of the Array.enqueue function.
Parameters
public forEach(array: Array<any>, method: Function, instance: Array<any>)
Performs a specified action on each element of an Array object.
Parameters
-
array: Array<any>
-
method: Function
-
instance: Array<any>
public indexOf(array: Array<any>, item: any, startIndex?: number): number
Searches for the specified element of an Array object and returns its index.
Parameters
-
array: Array<any>
-
item: any
-
startIndex?: number optional
Returns
number
public insert(array: Array<any>, index: number, item: any): any
Inserts a value at the specified location in an Array object.
Parameters
-
array: Array<any>
-
index: number
-
item: any
Returns
any
public isArray(arg: any): boolean
Parameters
Returns
boolean
public parse(value: string): Array<any>
Creates an Array object from a string representation.
Parameters
Returns
Array<any>
public remove(array: Array<any>, item: any): boolean
Removes the first occurrence of an element in an Array object.
Parameters
-
array: Array<any>
-
item: any
Returns
boolean
public removeAt(array: Array<any>, index: number)
Removes an element at the specified location in an Array object.
Parameters
-
array: Array<any>
-
index: number