Created
March 9, 2015 11:25
-
-
Save ketanghumatkar/47109cb8fa3c10ae845d to your computer and use it in GitHub Desktop.
Filter the objects from array of objects based of array of ids
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var collectionObject = [{id: 1}, {id: 2}, {id: 3}, {id: 4}] | |
var ids = [2,3] | |
_.filter(collectionObject, function(ca){ | |
return _.contains(ids, ca.id) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment