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 looking for a data merge, though, that would get you started.

Thanks,

Mr. Hericus
[email protected]
http://www.hericus.com/


Kanugula wrote:
> 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 Qx 0.7.2. Has
> nothing to do thi anyway.
>
> Thank you.
> Kanugula.
>   



------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to