There’s an unfortunate collision of terminology here, since both reference and value have Lua-specific meanings as well as the more general computer science ones.
Lua :
Lua tables are references to the underlying table contents. When assigned to multiple variables, each one will contain the same value , the value being that particular reference. You can modify the table’s contents, of course, e.g. t.x = 5 , and since each such variable is currently watching the same reference, they will all see the change. If you assign a new value to one of the variables themselves, however–not its contents–the other variables still see the old table.
General :
That said, every call in Lua is actually pass-by- value. When your removeObject () function gets called, the value (your table reference) is copied into a new variable, obj. When you reassign obj, as mentioned above, you’re only changing the value held by the local variable (parameters are just this, in the end). This is true for any input.
(If by any chance you come from a C / C++ background, as your last comment suggests, a table parameter corresponds to a pointer-to-a-table, but not a pointer-to-a-pointer-to-a-table. Alternatively, it isn’t a ref or inout parameter, as found in say C#.)