Backbone.js: Best way to handle multiple nullable filter parameters <p>have the following function on my <strong>collection</strong>:</p> <pre><code>getFiltered: function (status, city) { return this.filter(function (trainer) { return ((status === null) ? trainer : trainer.get("TrainerStatusName") === status) &amp;&amp; ((city === null) ? trainer : trainer.get('City') === city); }); } </code></pre> <p>What is is best way to deal with nullable params passed in i.e. if city it null then ignore filter/fetch all and if status is null then ignore filter/fetch all</p> <p>The code above works, but curious about alternatives</p>