Swift Functions and Argument Labels
A Swift function declares each parameter with an optional argument label, a name, and a type. The underscore in _ name removes the label for the first parameter, while times keeps its label, so callers write greet("Bo", times: 2).
Swift
func greet(_ name: String, times: Int = 1) -> String {
return Array(repeating: "Hi \(name)!", count: times).joined(separator: " ")
}
print(greet("Ada"))
print(greet("Bo", times: 2))