I have a list of objects which have a last name property and I would like to find the object with the last name which the user types in.
I can do this using the underscore filter function which works fine but the case matters. So for example if the last name is Jacobs in my object array and the user types jacobs, it will not find that object. How can I get make the filer find the object regardless of case?
This is how I currently use filter.
var user = _.filter(arr, function(item) {
return item.lastname.indexOf(typedLastName) > -1;
});
Thanks!