#can someone help me understand returning?

1 messages · Page 1 of 1 (latest)

ripe sun
#

No youtube didn't help, and no chatGPT didn't help because chatGPT always likes to assume im talking about the same thing over and over again even when I tell it differently.

ripe sun
#

I don't wanna use an ai to program for me

#

thats a lotta $

winged shuttle
gentle coyote
jaunty sierraBOT
#

studio** You are now Level 2! **studio

gentle coyote
#

So not lotts

karmic karma
#

returning as in function() .... return x end ??

unique olive
#

But all that return does it give is hault the code and gives you something

#

If I were to make a function to add two numbers together, I can make that function also return those numbers to me

#
local function add(x, y)
    return x + y
end

print(add(1, 2)) --> prints 3
ripe sun
#

In the function

#

Same thing

unique olive
#

This may be the reason you might not be understanding return

winged shuttle
winged shuttle
arctic valley
#

returning is kinda like referencing

#

returning is very useful in functions especially

ripe sun
#

I understand

#

now

#

ty

ripe sun