Searching for text inside nested object (Backbone.js collection as example)
问题 I have a backbone.js collection where I need to do a fulltextsearch on. The tools I have at hand are the following: Backbone.js, underscore.js, jQuery For those not familiar with backbone: A backbones collection is just an object. Inside the collection there is an array with models. Each model has an array with attributes. I have to search each attribute for a string. The code I am using for this is: query = 'some user input'; query = $.trim(query); query = query.replace(/ /gi, '|'); var