Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Div
classapi-page

fluid.each(source, func)

Section
Column
width70%

Better jQuery.each which works on hashes as well as having the arguments the right way round.

Code Block
javascript
javascript
bgColorwhite
borderStylenonejavascript
fluid.each(source, func);

File name: Fluid.js

Parameters

Span
classborderless-table

source

(Arrayable or Object) The container to be iterated over.

func

(Function) A function accepting (value, key) for each iterated object. This function may return a value to terminate the iteration

Return Value

Span
classborderless-table

None

Column
width5%

Column

See Also


Example

Code Block
javascript
javascript
var now = <current time>;
var items = [... an array of objects ...];
fluid.each(items, function(entry) {entry.timeStamp = now;});

In this example, the current time is added to each object in the array items.