scripts/utopia.js
function(obj, func, context) {
		if(!_.type(func) == 'function') {
			throw Error('The second argument in Utopia.each() must be a function');
		};

		context = context || obj;

		for (var i in obj) {
			if(obj.hasOwnProperty && obj.hasOwnProperty(i)) {
				var ret = func.call(context, obj[i], i);

				if(!!ret || ret === 0 || ret === '') {
					return ret;
				}
			}
		}

		return null;
	}
function(obj, func, context) {
		if(!_.type(func) == 'function') {
			throw Error('The second argument in Utopia.each() must be a function');
		};

		context = context || obj;

		for (var i in obj) {
			if(obj.hasOwnProperty && obj.hasOwnProperty(i)) {
				var ret = func.call(context, obj[i], i);

				if(!!ret || ret === 0 || ret === '') {
					return ret;
				}
			}
		}

		return null;
	}
function ( obj , func , context ) { if ( ! _ . type ( func ) == 'function' ) { throw Error ( 'The second argument in Utopia.each() must be a function' ) ; } ; context = context || obj ; for ( var i in obj ) { if ( obj . hasOwnProperty && obj . hasOwnProperty ( i ) ) { var ret = func . call ( context , obj [ i ] , i ) ; if ( ! ! ret || ret === 0 || ret === '' ) { return ret ; } } } return null ; }
Iterate over the properties of an object. Checks whether the properties actually belong to it.
Can be stopped if the function explicitly returns a value that isn't null, undefined or NaN.

@param obj {Object} The object to iterate over
@param func {Function} The function used in the iteration. Can accept 2 parameters: one of the
value of the object and one for its name.
@param context {Object} Context for the above function. Default is the object being iterated.

@return {Object} Null or the return value of func, if it broke the loop at some point.
Iterate over the properties of an object . Checks whether the properties actually belong to it . Can be stopped if the function explicitly returns a value that isn t null undefined or NaN .