Created
July 19, 2021 11:04
-
-
Save erdemildiz/a96ee98b7853fc9eb8de0064f89e1238 to your computer and use it in GitHub Desktop.
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
// 1. Method | |
let combinedName = names.reduce(""){ initialText, nextName in "\(initialText) \(nextName)"} | |
// 2. Method | |
let combinedName = names.reduce("", +) | |
// 3. Method | |
let combinedName = numbers.reduce("") { $0 + $1 } | |
// Result | |
// MynameisTom |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment