Invig
|
  |
| Joined: 02 May 2017 |
| Total Posts: 22 |
|
|
| 31 Jul 2017 06:18 PM |
If I were to do this:
local MyTable = {} MyTable["Test"] = 123
MyTable["Test"] = 456
What exactly will happen to "123"? Will it just be cleaned up by the garbagecollector? |
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 31 Jul 2017 06:19 PM |
| the place where the data '123' was held now holds new data of '456' |
|
|
| Report Abuse |
|
|
Invig
|
  |
| Joined: 02 May 2017 |
| Total Posts: 22 |
|
|
| 31 Jul 2017 06:21 PM |
| Yes I know that, but where did the old "123" go? Will it still exist or will it be removed? |
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 31 Jul 2017 06:24 PM |
imagine somewhere in memory there is this value: 00000000 01111011
when you run that code, that same place in memory now holds this value: 00000001 11001000
this is simplified of course from what's actually happening. Point is, the 123 no longer is stored as a value anywhere. |
|
|
| Report Abuse |
|
|
Invig
|
  |
| Joined: 02 May 2017 |
| Total Posts: 22 |
|
| |
|