Function Namespace Pot.Deferred.reduce
Defined in: <potlite.js>.
Constructor Attributes | Constructor Name and Description |
---|---|
Pot.Deferred.reduce(object, callback, initial, (context))
Apply a function against an accumulator and each value of
the object (from left-to-right) as to reduce it to a single value.
|
Field Attributes | Field Name and Description |
---|---|
Iterates "reduce" loop with slower speed.
|
|
Iterates "reduce" loop with fast speed.
|
|
Iterates "reduce" loop with slowest speed.
|
|
Iterates "reduce" loop with fastest speed.
|
|
Iterates "reduce" loop with default speed.
|
|
Iterates "reduce" loop with faster speed.
|
|
Iterates "reduce" loop with slow speed.
|
Function Namespace Detail
Pot.Deferred.reduce(object, callback, initial, (context))
Apply a function against an accumulator and each value of
the object (from left-to-right) as to reduce it to a single value.
Iteration will use the results of the previous chain.
This method like Array.prototype.reduce
var numbers = [1, 2, 3, 4, 5]; Pot.Deferred.reduce(numbers, function(a, b) { return a + b; }).then(function(result) { debug(result); }); // @results result = 15
- Parameters:
- {Array|Object|*} object
- A target object.
- {Function} callback
- A callback function.
- {*} initial
- An initial value passed as `callback` argument that will be used on first iteration.
- {*} (context)
- (Optional) Object to use as the first argument to the first call of the `callback`.
- Returns:
- {*} Return the result of each callbacks.
Field Detail
{Function}
doze
Iterates "reduce" loop with slower speed.
{Function}
fast
Iterates "reduce" loop with fast speed.
{Function}
limp
Iterates "reduce" loop with slowest speed.
{Function}
ninja
Iterates "reduce" loop with fastest speed.
{Function}
normal
Iterates "reduce" loop with default speed.
{Function}
rapid
Iterates "reduce" loop with faster speed.
{Function}
slow
Iterates "reduce" loop with slow speed.