Swift - Functions
Which of the following function declarations correctly omits the argument label for the first parameter?
_ name: String._ name: String correctly. func greet(name: String) { print("Hello, \(name)!") } uses a label. func greet(name _ : String) { print("Hello, \(name)!") } has wrong syntax. func greet(_name: String) { print("Hello, \(_name)!") } uses an invalid parameter name.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions