is godot store the actual object or its pointer ref in variable

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By unlasting

HI everyone.
I am quite a newbie for programming and also Godot

so I just wonder about Godot variable stores the actual object or its pointer reference.

for instance
if i have an object called “SomeObject” and it has a property a = 1, so I assign it to variables item_1 and item_2

var item_1 = SomeObject
var item_2 = SomeObject

print(item_1.a)
# 1

item_2.a = 100
print(item1.a)
#??? what will be printed 1 or 100 ? 

thanks in advance for your answers.

:bust_in_silhouette: Reply From: Zylann

It will print 100. Objects, Arrays and Dictionaries are passed by reference, while primitive types like int, bool, float, Vector2, Vector3, Transform2D and Transform are passed by value.