Last active
November 3, 2018 15:57
-
-
Save jsrath/b55e8f23bb7c44f34dfab7dafa33499c 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
sortLetters() { | |
this.dataService.contacts[0].forEach(contact => { | |
this.letters.push(contact.name.toUpperCase().slice(0, 1)); | |
}); | |
this.letters = this.letters.filter( (elem, index, self) => index === self.indexOf(elem)); | |
} | |
sortContacts() { | |
this.dataService.contacts[0] = this.dataService.contacts[0].sort((a, b) => a.name.localeCompare(b.name)) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment