In our last article we learned how to create functions and pass data into them. But functions can also send data back β€” they do some work and return the result. That's what makes them truly powerful. 🧠

To return a value from a function you need two things:

An arrow -> followed by the data type before the opening brace β€” telling Swift what type of data will come back

The return keyword to actually send the data back

Here's a simple example β€” rolling a dice: