-
Notifications
You must be signed in to change notification settings - Fork 1
vitals.roll
Adam Smith edited this page Mar 3, 2016
·
9 revisions
Method | Section | Alias |
---|---|---|
roll | base | |
roll.up | base | |
roll.down | base |
A shortcut for deriving a result by iterating over object maps, arrays, or cycles.
Params
-
base
*=
If defined it is the base value. Note that for number sources (i.e. cycles) a base is required.
-
source
!(Object|function|Array|number)
Details per type:
- object source: Iterates over all properties in random order.
- array source: Iterates over all indexed properties from 0 to length.
- number source: Iterates over all cycles.
-
iteratee
function(*=, *=, (string|number)=, !(Object|function)=)
It has the optional params - previousValue, currentValue, key/index, and source. Note this method lazily clones the source based on the iteratee's length property (i.e. if you alter the source object within the iteratee ensure to define the iteratee's fourth param so you can safely assume all references to the source are its original values).
-
thisArg
Object=
If defined the iteratee is bound to this value.
Returns *
A shortcut for deriving a sum by iterating over object maps, arrays, or cycles.
Params
-
base
*=
If defined it is the base value. Note that for number sources (i.e. cycles) a base is required.
-
source
!(Object|function|Array|number)
Details per type:
- object source: Iterates over all properties in random order.
- array source: Iterates over all indexed properties from 0 to length.
- number source: Iterates over all cycles.
-
iteratee
function(*=, (string|number)=, !(Object|function)=)
It has the optional params - value, key/index, source. Note this method lazily clones the source based on the iteratee's [length property](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/length) (i.e. if you alter the source object within the iteratee ensure to define the iteratee's third param so you can safely assume all references to the source are its original values).
-
thisArg
Object=
If defined the iteratee is bound to this value.
Returns *
A shortcut for deriving a difference by iterating over object maps, arrays, or cycles.
Params
-
base
*=
If defined it is the base value. Note that for number sources (i.e. cycles) a base is required.
-
source
!(Object|function|Array|number)
Details per type:
- object source: Iterates over all properties in random order.
- array source: Iterates over all indexed properties from 0 to length.
- number source: Iterates over all cycles.
-
iteratee
function(*=, (string|number)=, !(Object|function)=)
It has the optional params - value, key/index, source. Note this method lazily clones the source based on the iteratee's [length property](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/length) (i.e. if you alter the source object within the iteratee ensure to define the iteratee's third param so you can safely assume all references to the source are its original values).
-
thisArg
Object=
If defined the iteratee is bound to this value.
Returns *
-- Happy Developing,