Back

$.utils.each( collection, iteratee )

Iterate over each item in a collection

Handles all types of collections gracefully (even undefined)

Params

collection{Array/Object}A collection of items to iterate over
iteratee{Function}A function to be called once for each item that receives (value, key, collection) as arguments

Returns

DollarJS (chainable)

Examples

$.utils.each(['foo', 'bar'], function(v, k){ console.log(v); })
$.utils.each({ abc: 123, def: 456 }, function(v, k){ console.log(v); })