These are my lecture for University and College level students.
func triple(value: Int) {
let result = value * 3
print(”If you multiply \(value) by 3, you’ll get \(result).”)
}
In the case above, the parameter value is a constant you can use within the function. When you call a function, you pass values for its parameters as arguments. In the code below, the argument for value in the call to the function triple(value:) is 10.
triple(value: 10)
Console Output:
If you multiply 10 by 3, you’ll get 30.
Apple Education. “Develop in Swift Fundamentals.” Apple Inc. - Education, 2021. Apple Books. https://books.apple.com/us/book/devel...