This could just be `return _.findIndex(filterSets, function (curFilter) { return _.isEqual(filter, curFilter); });`

Or, slightly fancier, this might work: `return _.findIndex(filterSets, _.partial(_.isEqual, filter));`