Re: [qooxdoo-devel] merging objects

2009-06-02 Thread Kanugula
ll your needs. Maybe you have to check if one > attribute already exists or something else. > > Greetings, > Andreas > > -Ursprüngliche Nachricht----- > Von: Kanugula [mailto:venkata.kanug...@barcap.com] > Gesendet: Dienstag, 2. Juni 2009 00:23 > An: qooxdoo-devel@lists.

Re: [qooxdoo-devel] merging objects

2009-06-02 Thread Fink, Andreas
ebug(obj2); I'm not sure if this fits all your needs. Maybe you have to check if one attribute already exists or something else. Greetings, Andreas -Ursprüngliche Nachricht- Von: Kanugula [mailto:venkata.kanug...@barcap.com] Gesendet: Dienstag, 2. Juni 2009 00:23 An: qooxdoo-devel@lists

Re: [qooxdoo-devel] merging objects

2009-06-01 Thread Mr. Hericus
You could do something simple, like: var obj3 = {}; for( var n in obj1){ if(obj1.hasOwnProperty(n)){ obj3[n] = obj1[n]; } } for( var n in obj2){ if(obj2.hasOwnProperty(n)){ obj3[n] = obj2[n]; } } This, of course, won't copy over any methods or anything like that. If you're just

[qooxdoo-devel] merging objects

2009-06-01 Thread Kanugula
Hi there, I want to merge two javascript objects. var obj1 = {"a":"1", "b":2"} var obj2 = an object of some type which can be converted (let's assume it) to something like {"c":"3", "d":"4"} Do you know how to concatenate obj1 and obj2? I do not what is there in obj1 and obj2 at runtime? I use