I have lived under the assumption that there are primitive types and reference types in Javascript. On a day-to-day basis, I’ve never had this impact me but I was just starting to a lot more JS and wanted to update my ‘thinking’. In other words, I would have betted $20 that the following would return 68
var my_obj = {};
var tmp_obj = {};
tmp_obj.my_int = 38;
my_obj.tmp_val = tmp_obj.my_int;
tmp_obj.my_int = 68;
alert('68 means reference, 38 means primitve: ' + my_obj.tmp_val);
but it returns 38.

Are all instances of numbers primitive types even if they exist in the context of a reference type? If y, I’m really surprised and find that odd behavior(and would be out $20). Or is my example not demonstrating what I think it is?
thx in advance
UPDATE #1
Wow, thx for all the answers. Here’s a slight change which helps me a lot in understaning:
var my_obj={};
var tmp_obj={};
var my_obj_2=tmp_obj;
tmp_obj.my_int=38;
my_obj.tmp_val=tmp_obj.my_int;
tmp_obj.my_int=68
alert('68 means reference, 38 means primitve: ' + my_obj.tmp_val); // 38
alert('68 means reference, 38 means primitve: ' + my_obj_2.my_int); // 68
my_obj_2.my_int=78;
alert(tmp_obj.my_int); // tmp_obj is now 78 ie two way
You example would work as expected if you had
Then, all the properties would point to the same reference since there would only be one object.
But when you write
then
my_obj.tmp_valwill take the value that’s stored intmp_obj.my_intbut that doesn’t create a new reference between the 2 objects.