Why do we use _ in Swift?

The _ is a placeholder for the parameter name . In your example, you call them differently, in the second function, you need to write the parameter name a: 1 . Swift’s function name convention is funcName(param1:param2:) , and it needs the _ as a placeholder to create the name of the function.

Sizin İçin Seçtik  What is & before a variable in Swift?

Leave a Reply

Your email address will not be published. Required fields are marked *