Skip to content

Instantly share code, notes, and snippets.

@saru2020
Created May 20, 2019 07:54
Show Gist options
  • Save saru2020/61c6c5d7ba2117950e9ba6f58d634d14 to your computer and use it in GitHub Desktop.
Save saru2020/61c6c5d7ba2117950e9ba6f58d634d14 to your computer and use it in GitHub Desktop.
//Get just the name of the contacts into a separate array
//Imperative Programming
var contactNamesImp = [String]()
for contact in contacts { // for each
contactNamesImp.append(contact.firstName)
}
print(contactNamesImp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment