15.6 Handling Return Values
To call a function named buildMessage that takes two parameters and returns a result, on the other hand, we might write the following code:
val message = buildMessageFor("John", 10)
To improve code readability, the parameter names may also be specified when making the function call:
val message = buildMessageFor(name = "John", count = 10)
In the above examples, we have created a new variable called message and then used the assignment operator (=) to store the result returned by the function.