build/utils.js
function(obj, callback) {
	var length, key, i;

	if (obj) {
		length = obj.length;

		if (length === undefined) {
			// Loop object items
			for (key in obj) {
				if (obj.hasOwnProperty(key)) {
					if (callback(obj[key], key) === false) {
						return;
					}
				}
			}
		} else {
			// Loop array items
			for (i = 0; i < length; i++) {
				if (callback(obj[i], i) === false) {
					return;
				}
			}
		}
	}
}
function(obj, callback) {
	var length, key, i;

	if (obj) {
		length = obj.length;

		if (length === undefined) {
			// Loop object items
			for (key in obj) {
				if (obj.hasOwnProperty(key)) {
					if (callback(obj[key], key) === false) {
						return;
					}
				}
			}
		} else {
			// Loop array items
			for (i = 0; i < length; i++) {
				if (callback(obj[i], i) === false) {
					return;
				}
			}
		}
	}
}
Executes the callback function for each item in array/object. If you return false in the
callback it will break the loop.

@author Moxiecode
@method each
@param {Object} obj Object to iterate.
@param {function} callback Callback function to execute for each item.