void ng.obj_each (Object obj, Function func, [Mixed bind = null], [Mixed args = null]) vs. 1.1.0 Full+Lite

Iterate and execute a function over each object obj property. The function will receive the current value and the key plus any arguments passed to the each function. In order to imulate a true loop, we need a break statment. The function can return false when the loop needs to stop.

Difference between the each and a for in loop

Comparing to for in loop, the each function will avoid any added properties of the object by other frameworks. This will insure the loop happens only for the values that were set by the developers (not added by any JavaScript library).


Object obj Required vs. 1.1.0 Full+Lite
The object on which to iterate.
Function func (val, key, arg, arg,) vs. 1.1.0 Full+Lite
The function that process each value or property of the object. This function will receive the value and the key of each property plus any additional argument that were passed to the each function. The function can break out of the loop when it returns false
Mixed bind (Optional - Default: null) vs. 1.1.0 Full+Lite
The object in which to bind the function to, default is window (null). See Function.bind for details.
Mixed args (Optional - Default: null) vs. 1.1.0 Full+Lite
Any additional arguments to be passed to the function. To pass more than one argument, use an array of variables. See example for details.


Using ng.obj_each(obj, func, bind, args)