Q:

lodash dropWhile not working

I wrote this function with lodash , but at times it works ok and not others, it is well written or I was wrong in the syntax?
    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

A:

Use _.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);
    }
});

