@ -301,7 +301,7 @@ someFunction(1, 2)
|
|||||||
func someFunction(parameterWithDefault: Int = 12) {
|
func someFunction(parameterWithDefault: Int = 12) {
|
||||||
// function body goes here
|
// function body goes here
|
||||||
// if no arguments are passed to the function call,
|
// if no arguments are passed to the function call,
|
||||||
// value of parameterWithDefault is 42
|
// value of parameterWithDefault is 12
|
||||||
}
|
}
|
||||||
someFunction(6) // parameterWithDefault is 6
|
someFunction(6) // parameterWithDefault is 6
|
||||||
someFunction() // parameterWithDefault is 12
|
someFunction() // parameterWithDefault is 12
|
||||||
|
|||||||
Reference in New Issue
Block a user