each Function
Executes the callback function passed as the second argument for every value contained in the object or array passed as the first argument. The function should expect 2 arguments: the value from the object or array, and the current iteration, which is a numeric value in the case of an array, or a property name in the case of an object. If "scope" is specified, the function will be executed with "this" referencing the specified "scope", otherwise "window" is assumed.
Summary
Element | Function |
Returns | Boolean |
Arguments
obj | Object|Array | [required] Object or Array containing values. |
fn | Function | [required] Function to execute for each iteration. |
scope | Object | Scope the execute the function in. |
Example
nano.each(foo, function(val, i) {
alert(i + ' = ' + val);
});
|