I'm referring to an example in the Apple 3.1 Swift Tour:
func greet(_ person: String, on day: String) -> String {
return "Hello \(person), today is \(day)."
}
greet("John", on: "Wednesday")
In the function head it states "on day
" whereas in the return
statement, the code only refers to "day
" and finally, when calling the function, it only assigns a value to "on
". Why "on day
" in the first place? Why not just "day
"?