Forums
Learn
Careers
Store
About
SUBSCRIBE
NEW: My new book Pro SwiftUI is out now – level up your SwiftUI skills today! >>
Question 1/12: This code is valid Swift – true or false?
Hint: Closures don't take parameters in parentheses, and they are case-sensitive just like regular functions. Click to show.
var signAutograph(to name: String) = { print("To \(name), my #1 fan") } signAutograph(to: "Lisa")
Correct! Unlike functions, closures put their parameters inside the opening brace.
Oops – that's not correct. Unlike functions, closures put their parameters inside the opening brace.
Return to Review Menu
You are not logged in
Link copied to your pasteboard.