Javascript, the union of two objects.
Now I do this:
jQuery.extend({}, obj1, obj2); It does not work as it should, because obj1 , obj2 this type:
obj1 = {child_obj,child_obj,child_obj,child_obj,child_obj}; obj2 = {child_obj,child_obj,child_obj,child_obj,child_obj}; As a result, I get this type:
Object {0: Object, 1: Object, 2: Object, 3: Object, 4: Object} The problem is that I do not need the numbering of new objects, but to have everything, as in obj1 , obj2 , only already merged.
Thank.
.extend(src, dst)method. - Sergiks