In programming, a function is nothing but a named section of code – with or without arguments – which performs a specific task and may possibly also return a value. In this chapter, we’ll see how you can get the most out of them in Swift.
5.1 Define and call a function
Problem
I want to define and call a new function from scratch.
Solution
What about calling our function?
Note
Even without arguments, we must use parentheses