Hi, I would like to know when to use return
. The only thing I know where to use return is a simple add function, like this:
function addnum(num1,num2) return print(num1,num2) end addnum(1,2)
Although the same results can be seen without return
:
function addnum(num1,num2) print(num1 + num2) end addnum(1,2)
I would appreciate it if someone could tell me when to use return and how to use it.
Thanks to those who helped!