[Omitting Arguments] How does this work?

func greet(_ person : String, abc day: String) -> String {
    return "Hello \(person), today is \(day)."
}
print (greet("John", abc: "Wednesday")) // Prints Hello John, today is Wednesday.

func greet(_ person : String, day: String) -> String {
    return "Hello \(person), today is \(day)."
}
print (greet("John", day: "Wednesday")) // Prints Hello John, today is Wednesday.

Both of these have the same output. How does the first one work ?
Any link I can refer to understand this would be very helpful.
Thank You.

Hello Kushal. You may enjoy reading the Function Argument Labels and Parameter Names chapter of Swift documentation. You'll learn how _, person, abc and day interact together.

2 Likes

Clarified. Thank You.

1 Like