Return is applicable in many ways. You can get values on a long formula, but you only have to type in the formula once. For example:
Instead of
1 | x = math.sqrt(math.pow( 3 , 2 ) + math.pow( 4 , 2 )) |
2 | y = math.sqrt(math.pow( 6 , 2 ) + math.pow( 12 , 2 )) |
You can simplify that into one function:
08 | Answer = math.sqrt(math.pow(a, 2 ) + math.pow(b, 2 )) |
Of course, there are other useful things to do with return, but this is just one example.
The gist is that you're literally converting a function into a value.
Take note that a return statement immediately stops the function, so anything besides ends after it will error out.