Edentity Web Systems
You solve creative. We crack code.
/Header/WhoWeAre.jpg
 

12/03/2009 Copy by value for JSON objects
Posted by Henry Ji

In Javascript, if you assign a reference object to another object, you actually copy it by reference. Therefore, when I wanted to create a new JSON object to have the same structure as an existing object, I tried to find a deep copy function in JavaScript first. And then I found out another way to tackle it - I stringify the existing JSON object and eval the resultant string to the new JSON object. It works just like copy by value.

Here you can find an JSON stringify function.

« Back to Blog Main Page |

0 Comment(s)

Leave Comment

Name:
Comment:  
 
Edentity Web Systems Inc.
Suite 201
40 Spadina Ave.
Toronto ON
M5V 2H8
Tel:
416.591.2500
Fax:
416.352.5270

From Our Blog

02/09/2010
Amazon S3 – Now with Versioning! Posted by Joel Varty
02/02/2010
01/19/2010
411 Length Required in Firefox 3 Posted by Andre Small
Home | Who We Are | What We Do | Clients & Brands | Careers | Contact

Copyright © 2010 Edentity Web Systems Inc. Privacy Policy