How to use _.where() in underscore to compare values regardless of case
Try using filter
instead:
var filter = ["Apple", "bANAna", "orange"];
var arr = ["apPle", "ORANGE"];
// make filter lower case once
var filterLower = _.invoke(filter, "toLowerCase");
var arr2 = _.filter(arr, function(v) {
// make entry lower case and see if it is in filterLower
return _.contains(filterLower, v.toLowerCase());
});
console.dir(arr2);
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.4/underscore-min.js"></script>