I’ve recently made two functions in a modulescript for me to use, and noticed only one of them doesn’t work when I use : to run it. It only works if I use .
So my question is, when firing functions, what’s the different between using . and :
I’ve recently made two functions in a modulescript for me to use, and noticed only one of them doesn’t work when I use : to run it. It only works if I use .
So my question is, when firing functions, what’s the different between using . and :
a:b()
is syntax sugar for a.b(a)
, so when you use :
you implicitly pass the table you are calling it on as first argument. a.b()
does not pass a
as the first argument.
Oooooh, that makes so much sense. Thank you so much!