dojox/lang/functional/object (version 1.10)

See the dojox/lang/functional/object reference documentation for more information.

Method Summary

  • buildLambda(s) builds a function from a snippet, returns a string, which represents the function.
  • clearLambdaCache() clears internal cache of lambdas
  • every(a,f,o) tests whether all elements in the array pass the test implemented by the provided function.
  • everyRev(a,f,o) tests whether all elements in the array pass the test implemented by the provided function.
  • filter(a,f,o) creates a new array with all elements that pass the test implemented by the provided function.
  • filterIn(obj,f,o) creates new object with all attributes that pass the test implemented by the provided function.
  • filterRev(a,f,o) creates a new array with all elements that pass the test implemented by the provided function.
  • foldl(a,f,z,o) repeatedly applies a binary function to an array from left to right using a seed value as a starting point; returns the final value.
  • foldl1(a,f,o) repeatedly applies a binary function to an array from left to right; returns the final value.
  • foldr(a,f,z,o) repeatedly applies a binary function to an array from right to left using a seed value as a starting point; returns the final value.
  • foldr1(a,f,o) repeatedly applies a binary function to an array from right to left; returns the final value.
  • forEach(a,f,o) executes a provided function once per array element.
  • forEachRev(a,f,o) executes a provided function once per array element.
  • forIn(obj,f,o) iterates over all object attributes.
  • keys(obj) returns an array of all keys in the object
  • lambda(s) builds a function from a snippet, or array (composing), returns a function object; functions are passed through unmodified.
  • map(a,f,o) creates a new array with the results of calling a provided function on every element in this array.
  • mapIn(obj,f,o) creates new object with the results of calling a provided function on every attribute in this object.
  • mapRev(a,f,o) creates a new array with the results of calling a provided function on every element in this array.
  • rawLambda(s) builds a function from a snippet, or array (composing), returns an object describing the function; functions are passed through unmodified.
  • reduce(a,f,z) apply a function simultaneously against two values of the array (from left-to-right) as to reduce it to a single value.
  • reduceRight(a,f,z) apply a function simultaneously against two values of the array (from right-to-left) as to reduce it to a single value.
  • repeat(n,f,z,o) builds an array by repeatedly applying a unary function N times with a seed value Z.
  • scanl(a,f,z,o) repeatedly applies a binary function to an array from left to right using a seed value as a starting point; returns an array of values produced by foldl() at that point.
  • scanl1(a,f,o) repeatedly applies a binary function to an array from left to right; returns an array of values produced by foldl1() at that point.
  • scanr(a,f,z,o) repeatedly applies a binary function to an array from right to left using a seed value as a starting point; returns an array of values produced by foldr() at that point.
  • scanr1(a,f,o) repeatedly applies a binary function to an array from right to left; returns an array of values produced by foldr1() at that point.
  • some(a,f,o) tests whether some element in the array passes the test implemented by the provided function.
  • someRev(a,f,o) tests whether some element in the array passes the test implemented by the provided function.
  • unfold(pr,f,g,z,o) builds an array by unfolding a value
  • until(pr,f,z,o) builds an array by repeatedly applying a unary function with a seed value Z until the predicate is satisfied.
  • values(obj) returns an array of all values in the object

Methods

buildLambda(s)

builds a function from a snippet, returns a string, which represents the function.

This method returns a textual representation of a function built from the snippet. It is meant to be evaled in the proper context, so local variables can be pulled from the environment.

Parameter Type Description
s String
Returns:string
clearLambdaCache()

clears internal cache of lambdas

every(a,f,o)

tests whether all elements in the array pass the test implemented by the provided function.

Parameter Type Description
a Array | String | Object
f Function | String | Array
o Object
Optional
Returns:boolean
everyRev(a,f,o)

tests whether all elements in the array pass the test implemented by the provided function.

Parameter Type Description
a Array | String
f Function | String | Array
o Object
Optional
Returns:boolean
filter(a,f,o)

creates a new array with all elements that pass the test implemented by the provided function.

Parameter Type Description
a Array | String | Object
f Function | String | Array
o Object
Optional
Returns:Array
filterIn(obj,f,o)

creates new object with all attributes that pass the test implemented by the provided function.

Parameter Type Description
obj Object
f Function | String | Array
o Object
Optional
Returns:object
filterRev(a,f,o)

creates a new array with all elements that pass the test implemented by the provided function.

Parameter Type Description
a Array | String
f Function | String | Array
o Object
Optional
Returns:Array
foldl(a,f,z,o)

repeatedly applies a binary function to an array from left to right using a seed value as a starting point; returns the final value.

Parameter Type Description
a Array | String | Object
f Function
z Object
o Object
Optional
Returns:undefined
foldl1(a,f,o)

repeatedly applies a binary function to an array from left to right; returns the final value.

Parameter Type Description
a Array | String | Object
f Function | String | Array
o Object
Optional
Returns:undefined
foldr(a,f,z,o)

repeatedly applies a binary function to an array from right to left using a seed value as a starting point; returns the final value.

Parameter Type Description
a Array | String
f Function | String | Array
z Object
o Object
Optional
Returns:Object
foldr1(a,f,o)

repeatedly applies a binary function to an array from right to left; returns the final value.

Parameter Type Description
a Array | String
f Function | String | Array
o Object
Optional
Returns:undefined
forEach(a,f,o)

executes a provided function once per array element.

Parameter Type Description
a Array | String | Object
f Function | String | Array
o Object
Optional
Returns:string
forEachRev(a,f,o)

executes a provided function once per array element.

Parameter Type Description
a Array | String
f Function | String | Array
o Object
Optional
forIn(obj,f,o)

iterates over all object attributes.

Parameter Type Description
obj Object
f Function | String | Array
o Object
Optional
Returns:string
keys(obj)

returns an array of all keys in the object

Parameter Type Description
obj Object
Returns:Array
lambda(s)

builds a function from a snippet, or array (composing), returns a function object; functions are passed through unmodified.

This method is used to normalize a functional representation (a text snippet, an array, or a function) to a function object.

Parameter Type Description
s Function | String | Array
Returns:Function|String|Array | undefined | instance
map(a,f,o)

creates a new array with the results of calling a provided function on every element in this array.

Parameter Type Description
a Array | String | Object
f Function | String | Array
o Object
Optional
Returns:Array
mapIn(obj,f,o)

creates new object with the results of calling a provided function on every attribute in this object.

Parameter Type Description
obj Object
f Function | String | Array
o Object
Optional
Returns:object
mapRev(a,f,o)

creates a new array with the results of calling a provided function on every element in this array.

Parameter Type Description
a Array | String
f Function | String | Array
o Object
Optional
Returns:instance
rawLambda(s)

builds a function from a snippet, or array (composing), returns an object describing the function; functions are passed through unmodified.

This method is to normalize a functional representation (a text snippet) to an object that contains an array of arguments, and a body , which is used to calculate the returning value.

Parameter Type Description
s String
Returns:undefined
reduce(a,f,z)

apply a function simultaneously against two values of the array (from left-to-right) as to reduce it to a single value.

Parameter Type Description
a Array | String | Object
f Function | String | Array
z Object
Optional
Returns:undefined
reduceRight(a,f,z)

apply a function simultaneously against two values of the array (from right-to-left) as to reduce it to a single value.

Parameter Type Description
a Array | String
f Function | String | Array
z Object
Optional
Returns:undefined
repeat(n,f,z,o)

builds an array by repeatedly applying a unary function N times with a seed value Z. N should be greater than 0.

Parameter Type Description
n Number
f Function | String | Array
z Object
o Object
Optional
Returns:instance
scanl(a,f,z,o)

repeatedly applies a binary function to an array from left to right using a seed value as a starting point; returns an array of values produced by foldl() at that point.

Parameter Type Description
a Array | String | Object
f Function | String | Array
z Object
o Object
Optional
Returns:Array
scanl1(a,f,o)

repeatedly applies a binary function to an array from left to right; returns an array of values produced by foldl1() at that point.

Parameter Type Description
a Array | String | Object
f Function | String | Array
o Object
Optional
Returns:Array
scanr(a,f,z,o)

repeatedly applies a binary function to an array from right to left using a seed value as a starting point; returns an array of values produced by foldr() at that point.

Parameter Type Description
a Array | String
f Function | String | Array
z Object
o Object
Optional
Returns:instance
scanr1(a,f,o)

repeatedly applies a binary function to an array from right to left; returns an array of values produced by foldr1() at that point.

Parameter Type Description
a Array | String
f Function | String | Array
o Object
Optional
Returns:instance
some(a,f,o)

tests whether some element in the array passes the test implemented by the provided function.

Parameter Type Description
a Array | String | Object
f Function | String | Array
o Object
Optional
Returns:boolean
someRev(a,f,o)

tests whether some element in the array passes the test implemented by the provided function.

Parameter Type Description
a Array | String
f Function | String | Array
o Object
Optional
Returns:boolean
unfold(pr,f,g,z,o)

builds an array by unfolding a value

Parameter Type Description
pr Function | String | Array
f Function | String | Array
g Function | String | Array
z Object
o Object
Optional
Returns:Array
until(pr,f,z,o)

builds an array by repeatedly applying a unary function with a seed value Z until the predicate is satisfied.

Parameter Type Description
pr Function | String | Array
f Function | String | Array
z Object
o Object
Optional
Returns:Array
values(obj)

returns an array of all values in the object

Parameter Type Description
obj Object
Returns:Array
Error in the documentation? Can’t find what you are looking for? Let us know!