lodash drop 不工作

lodash dropWhile not working

我用 lodash 写了这个函数,但有时它运行正常,但其他的却不行,它写得很好还是我的语法有误?

    myApp.controller('geoCtrl', function($scope, Canchas){

    var filtro = [];

    $scope.filtroJugadores = function(){

        if($scope.j5===true){
            var j5 = _(filtro).push({'jugadores5':true});
            j5 = j5.commit();
        }else{
            _.dropWhile(filtro, ['jugadores5', true]);
            //index = _.indexOf(filtro, _.find(filtro, {'jugadores5':true}));
            //if (index != -1){filtro.splice(index, 1, {'jugadores5':false})};
        }

        if($scope.j9===true){
            var j9 = _(filtro).push({'jugadores9':true});
            j9 = j9.commit();
        }else{
            _.dropWhile(filtro, ['jugadores9', true]);

            //index = _.indexOf(filtro, _.find(filtro, {'jugadores9':true}));
            //if (index != -1){filtro.splice(index, 1, {'jugadores9':false})};
        }

        filtro = _.uniqBy(filtro, 'jugadores5');
        filtro = _.uniqBy(filtro, 'jugadores9');

        console.log(filtro);
    }
});

plunker

使用_.uniqWith

    myApp.controller('geoCtrl', function($scope, Canchas){

    var filtro = [];

    $scope.filtroJugadores = function(){
        filtro = _.uniqWith(filtro, _.isEqual);
        if($scope.j5===true){
            var j5 = _(filtro).push({'jugadores5':true});
            j5 = j5.commit();
        }else{
            if(_.some(filtro, {'jugadores5':true})) {
                _.dropWhile(users, ['jugadores5', true]);
            }
        }

        if($scope.j9===true){
            var j9 = _(filtro).push({'jugadores9':true});
            j9 = j9.commit();
        }else{
            if(_.some(filtro, {'jugadores9':true})) {
                _.dropWhile(filtro, ['jugadores9', true]);
            }
        }
        console.log(filtro);
    }
});