of     1   

vinboi
#183912243Friday, February 19, 2016 12:13 AM GMT

function add(a, b) print(a + b) end money = add(5, 4) so I never called the function add(a,b) I only set it as a variable so why does it print to the output. Could this be used instead of using return because I can set a value to a function without return?
uglypoe
#183912314Friday, February 19, 2016 12:14 AM GMT

Money would be equal to nil, as you didn't return a value. However, it still runs the function, as you called it. Lua has the nice advantage of not throwing exceptions in situations like this, as opposed to languages such as Java.
Rocky28447
#183912334Friday, February 19, 2016 12:15 AM GMT

You called the function, and inside the function it says to print it to the output. function add(a, b) return (a + b) end choo choo
vinboi
#183912465Friday, February 19, 2016 12:17 AM GMT

thanks you

    of     1