new Array()
- Source:
Methods
-
(static) from(object, mapFunctionopt, thatopt) → {Array}
-
Parameters:
Name Type Attributes Description objectObject Array-like object mapFunctionfunction <optional>
(this = that, value, key) that* <optional>
- Source:
Returns:
- Type
- Array
-
(static) is(value) → {Boolean}
-
Determines whether the given value is an array.
Parameters:
Name Type Description value* - Source:
Returns:
- Type
- Boolean
-
(static) isArray(value) → {Boolean}
-
Alias for Array.is
Parameters:
Name Type Description value* - Source:
Returns:
- Type
- Boolean
-
add(items) → {this}
-
Adds items to the array.
Parameters:
Name Type Description itemsArray - Source:
Returns:
- Type
- this
-
each(callback, fromIndexopt, toIndexopt) → {this}
-
Executes the given function for every item in the array.
Parameters:
Name Type Attributes Description callbackfunction (this = this, value, index, array = this) fromIndexNumber <optional>
inclusive toIndexNumber <optional>
exclusive - Source:
Returns:
- Type
- this
-
every(callback, thatopt) → {Boolean}
-
Parameters:
Name Type Attributes Description callbackArray.Callback that* <optional>
- Source:
Returns:
- Type
- Boolean
-
filter(callback, thatopt) → {Array}
-
Parameters:
Name Type Attributes Description callbackArray.Callback that* <optional>
- Source:
Returns:
- Type
- Array
-
find(callback, thatopt) → {*}
-
Parameters:
Name Type Attributes Description callbackArray.Callback that* <optional>
- Source:
Returns:
- Type
- *
-
findIndex(callback, thatopt) → {Number}
-
Parameters:
Name Type Attributes Description callbackArray.Callback that* <optional>
- Source:
Returns:
- Type
- Number
-
first() → {*}
-
- Source:
Returns:
- Type
- *
-
forEach(callback, thatopt)
-
Parameters:
Name Type Attributes Description callbackArray.Callback that* <optional>
- Source:
-
indexOf(value, fromopt) → {Number}
-
Parameters:
Name Type Attributes Description value* fromNumber <optional>
- Source:
Returns:
- Type
- Number
-
insert(index, items) → {this}
-
Inserts the given items in the array at the given index.
Parameters:
Name Type Description indexNumber itemsArray - Source:
Returns:
- Type
- this
-
last() → {*}
-
- Source:
Returns:
- Type
- *
-
lastIndexOf(value, fromopt) → {Number}
-
Parameters:
Name Type Attributes Description value* fromNumber <optional>
- Source:
Returns:
- Type
- Number
-
map(callback, thatopt) → {Array}
-
Parameters:
Name Type Attributes Description callbackArray.Callback that* <optional>
- Source:
Returns:
- Type
- Array
-
reduce(callback, currentopt) → {Array}
-
Parameters:
Name Type Attributes Default Description callbackArray.ReduceCallback current* <optional>
this.first() - Source:
Returns:
- Type
- Array
-
reduceRight(callback, currentopt) → {Array}
-
Parameters:
Name Type Attributes Default Description callbackArray.ReduceCallback current* <optional>
this.last() - Source:
Returns:
- Type
- Array
-
remove(item) → {this}
-
Removes the item (if it is in the array) from the array.
Parameters:
Name Type Description item* - Source:
Returns:
- Type
- this
-
removeAt(indexopt, amountopt) → {this}
-
Removes an item at the given index from the array.
Parameters:
Name Type Attributes Default Description indexNumber <optional>
0 amountNumber <optional>
1 - Source:
Returns:
- Type
- this
-
some(callback, thatopt) → {Boolean}
-
Parameters:
Name Type Attributes Description callbackArray.Callback that* <optional>
- Source:
Returns:
- Type
- Boolean
-
tack(…items) → {this}
-
Similar to Array#add, but accepts items as arguments.
Parameters:
Name Type Attributes Description items* <repeatable>
- Source:
Returns:
- Type
- this
Type Definitions
-
Callback(value, index, array) → {undefined|Boolean|*}
-
This:
- that
Parameters:
Name Type Description value* indexNumber arrayArray - Source:
Returns:
- Type
- undefined | Boolean | *
-
ReduceCallback(current, value, index, array) → {*}
-
Parameters:
Name Type Description current* value* indexNumber arrayArray - Source:
Returns:
Passed as the next `current`.- Type
- *