Created
June 21, 2016 10:17
-
-
Save homanp/9634721a03f7e153852d6a0de4cf43fa to your computer and use it in GitHub Desktop.
This file contains 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
let contacts = []; | |
_.filter(phoneContacts, (contact) => { | |
_.filter(contact.phoneNumbers, (number) => { | |
if (number.digits.indexOf(searchString) > -1 || contact.fullName.indexOf(searchString) > -1) { | |
let mutableContact = _.clone(contact); | |
contacts.push(mutableContact); | |
} | |
}); | |
}); | |
return contacts; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment