JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text">
JavaScript
$(function(){
var items = [
{id: 1, tags: ['foo']},
{id: 2, tags: ['fish', 'ball']},
{id: 3, tags: ['bar', 'goo']},
];
var input = $('input:first');
input.on('input', function(e) {
var test = _.filter(items, function(item) {
for(var t in item.tags) {
if(item.tags[t].indexOf(input.val())==0) {
return true;
}
}
return false;
});
console.log(test);
});
});