Let me create one simple array.
var a = [5,"e",7];
Is it safe to think that a[0]
just knows the address of some value in memory, and not storing the value it self in that list ( because it some sense it is key
value
pair)? So if I do
a[0] = 4;
I'm creating 4
in memory and pointing to the new place in memory where that value is created, and abandoning the old reference to a memory (5)
and that value (5)
gets garbage-collected because nothing points to that spot of memory. Right?
Basically, can I say that a[0]
, a[1]
... just knows the address of some value somewhere over there?