arrayEx

aeq. arrayEx

new arrayEx(arr)

Source:

Array with some extensions that mimics modern JavaScript.

Parameters:
Name Type Description
arr Array

The array object to extend. If not supplied, an empty arrayEx will be returned.

Methods

(static) attr() → {type}

Source:
See:

Checks the arguments length to determine to get or set and it needs an object to get or set attributes to.

Returns:

[description]

Type
type

(static) exists(callback) → {boolean}

Source:

Loops through the elements in the array and returns true if callback returns true for any element

Parameters:
Name Type Description
callback function

Function to execute for each element

Returns:

Whether the function returned true for any element

Type
boolean

(static) filter(callback) → {aeq.arrayEx}

Source:

Runs callback on each element, and returns a new arrayEx of elements that trigger callback === true

Parameters:
Name Type Description
callback function

Function to execute for each element

Returns:

ArrayEx of filtered elements

Type
aeq.arrayEx

(static) find(callback, defopt) → {any}

Source:

Returns array element that triggers callback === true

Parameters:
Name Type Attributes Description
callback function

Function to execute for each element

def any <optional>

Default element to return if target be found

Returns:

Array element that triggered callback, or default

Type
any

(static) first() → {any}

Source:

Gets first element in array

Returns:

First element in array

Type
any

(static) forEach(callback)

Source:

Loops through the elements in the array and executes a function.

Parameters:
Name Type Description
callback forEachArrayCallback

Function to execute for each element

(static) indexOf(searchElement, fromIndexopt) → {number}

Source:

Returns index of searchElement in an array, or -1 if not found

Parameters:
Name Type Attributes Default Description
searchElement any

Element to find in arrayEx

fromIndex number <optional>
0

Index to start searching from, or 0 if not passed

Returns:

-1 if element is not found, else index number

Type
number

(static) insertAt(insert, index)

Source:

Inserts an element into arrayEx at specified index

Parameters:
Name Type Description
insert any

Element to insert

index number

Index to insert element at

(static) isTrueForAll(callback) → {boolean}

Source:

Loops through the elements in the array and returns true if callback returns true for all elements

Parameters:
Name Type Description
callback function

Function to execute for each element

Returns:

Whether the function returned true for ALL elements

Type
boolean

(static) map(callback) → {object}

Source:

[description]

Parameters:
Name Type Description
callback function

Function to execute for each element

Returns:

[description]

Type
object

(static) select(callback) → {aeq.arrayEx}

Source:

[description]

Parameters:
Name Type Description
callback function

Function to execute for each element

Returns:

[description]

Type
aeq.arrayEx