💬

Community answer

Collected from the ACE community Discord archive around 2020-05-15. It may be informal or outdated — anyone can edit this page to improve it. Original discussion

Lua method call sugar t:Test() vs t.Test(t)

🌙 LuaUpdated 2 days ago•0 views
Yes - obj:method(args) is sugar for obj.method(obj, args), so 'self' inside the function receives the table. Use the colon definition for methods.

Is t:Test(arg) the same as t.Test(t, arg) and does self still work

Yes - obj:method(args) is sugar for obj.method(obj, args), so 'self' inside the function receives the table. Use the colon definition for methods.

Was this article helpful?

See More

Discussion(0)

No comments yet. Be the first to ask a question!

Have a question? Sign in to join the discussion.