knapsack3
Oct 12th 2007, 6:37 am
Hi,
I have a javascript object. I pass it to a function where certain attributes are changed and displayed on screen. Once I am out of that function, I need to get the original object back so that I can do further processing.
I did this:
OrijObj : (Object declaration, with attirbutes and values)
copyObj = OrijObj;
Later in the code, when I try to access the 'copyObj', it is also affected, as javascript uses pass by reference.
Is there any way I can make sure the copyObj is not affected at all?
Thanks.
I have a javascript object. I pass it to a function where certain attributes are changed and displayed on screen. Once I am out of that function, I need to get the original object back so that I can do further processing.
I did this:
OrijObj : (Object declaration, with attirbutes and values)
copyObj = OrijObj;
Later in the code, when I try to access the 'copyObj', it is also affected, as javascript uses pass by reference.
Is there any way I can make sure the copyObj is not affected at all?
Thanks.