src/sofa.util.js
function (collection, callback) {
        var index,
            iterable = collection,
            result = iterable;

        if (!iterable) {
            return result;
        }

        if (!sofa.Util.objectTypes[typeof iterable]) {
            return result;
        }

        for (index in iterable) {
            if (Object.prototype.hasOwnProperty.call(iterable, index)) {
                if (callback(iterable[index], index, collection) === false) {
                    return result;
                }
            }
        }
        return result;
    }
function (collection, callback) {
        var index,
            iterable = collection,
            result = iterable;

        if (!iterable) {
            return result;
        }

        if (!sofa.Util.objectTypes[typeof iterable]) {
            return result;
        }

        for (index in iterable) {
            if (Object.prototype.hasOwnProperty.call(iterable, index)) {
                if (callback(iterable[index], index, collection) === false) {
                    return result;
                }
            }
        }
        return result;
    }
function ( collection , callback ) { var index , iterable = collection , result = iterable ; if ( ! iterable ) { return result ; } if ( ! sofa . Util . objectTypes [ typeof iterable ] ) { return result ; } for ( index in iterable ) { if ( Object . prototype . hasOwnProperty . call ( iterable , index ) ) { if ( callback ( iterable [ index ] , index , collection ) === false ) { return result ; } } } return result ; }
this method is ripped out from lo-dash
this method is ripped out from lo - dash