Skip to content Skip to sidebar Skip to footer

Underscore.js Filter Not Returning All Results

I am trying to build an filtering function that works similar to the way an auto-complete field would work. I am using Underscore.js to filter an array of names. Here is a JSFiddle

Solution 1:

If you could get rid of the global flag from RegExp this should work.

var pattern = new RegExp($(event.currentTarget).val(), 'im');

Post a Comment for "Underscore.js Filter Not Returning All Results"