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:






