So I know that lua is pass by reference, because
local a = {}
local b = a
b[1] = true
print(a[1]) --true
Meaning, if I change b will change a and changing a will change b. But does that only apply for inserting stuff into tables? because if I set a to something else, I'd expect b to change as well, but no.
local a = {}
local b = a
a = nil
print(b) --stills prints the table
And for numbers
local a = 2
local b = a
b = b*2
print(b,a) --4, 2
I'm confused, can someone explain more?

1 comment
b was assigned to a before a was nill, you cannot necessarily make reference variables like you can in C++