21
rated 0 times
[
25]
[
4]
/ answers: 1 / hits: 31551
/ 12 Years ago, tue, january 8, 2013, 12:00:00
I have this
var matches = bookmarks.filter(function(x) {
return _.contains(x.get(tags), 'apple');
});
Which will return the bookmark objects that have the apple tags
I want to put an array there instead to pull and all the bookmarks that have the matching values, similar to this
var matches = bookmarks.filter(function(x) {
return _.contains(x.get(tags), ['apple','orange']);
});
This doesn't work, any way to get it to work?
EDIT: Im sorry, bookmarks is a collection and im trying to return the models that have the apple and orange tags
More From » underscore.js