function(fn, scope) {
        var me = this,
            newCollection = new this.self(),
            keys   = me.keys,
            items  = me.all,
            length = items.length,
            i;

        newCollection.getKey = me.getKey;

        for (i = 0; i < length; i++) {
            if (fn.call(scope || me, items[i], me.getKey(items[i]))) {
                newCollection.add(keys[i], items[i]);
            }
        }

        return newCollection;
    }
function(fn, scope) {
        var me = this,
            newCollection = new this.self(),
            keys   = me.keys,
            items  = me.all,
            length = items.length,
            i;

        newCollection.getKey = me.getKey;

        for (i = 0; i < length; i++) {
            if (fn.call(scope || me, items[i], me.getKey(items[i]))) {
                newCollection.add(keys[i], items[i]);
            }
        }

        return newCollection;
    }
function ( fn , scope ) { var me = this , newCollection = new this . self ( ) , keys = me . keys , items = me . all , length = items . length , i ; newCollection . getKey = me . getKey ; for ( i = 0 ; i < length ; i ++ ) { if ( fn . call ( scope || me , items [ i ] , me . getKey ( items [ i ] ) ) ) { newCollection . add ( keys [ i ] , items [ i ] ) ; } } return newCollection ; }
Filter by a function. Returns a _new_ collection that has been filtered. The passed function will be called with
each object in the collection. If the function returns `true`, the value is included otherwise it is filtered.
@param {Function} fn The function to be called.
@param {Object} fn.o The object.
@param {String} fn.k The key.
@param {Object} scope The scope (`this` reference) in which the function is executed. Defaults to this
MixedCollection.
@return {Ext.util.MixedCollection} The new filtered collection
Filter by a function . Returns a _new_ collection that has been filtered . The passed function will be called with each object in the collection . If the function returns true the value is included otherwise it is filtered .