Skip to content

Instantly share code, notes, and snippets.

@homanp
Created June 21, 2016 10:17
Show Gist options
  • Save homanp/9634721a03f7e153852d6a0de4cf43fa to your computer and use it in GitHub Desktop.
Save homanp/9634721a03f7e153852d6a0de4cf43fa to your computer and use it in GitHub Desktop.
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