function mergeRecursive(obj1, obj2) {

    for (var p in obj2) {
      try {
        // Property in destination object set; update its value.
        if (obj1[p].constructor == Object && obj2[p].constructor == Object) {
          obj1[p] = mergeRecursive(obj1[p], obj2[p]);

        } else {
          obj1[p] = obj2[p];

        }

      } catch (e) {
        // Property in destination object not set; create it and set its value.
        obj1[p] = obj2[p];

      }
    }

    return obj1;
  }
/*
  * Recursively merge properties of two objects 
  */
Recursively merge properties of two objects
Recursively merge properties of two objects
function mergeRecursive(obj1, obj2) {
    for (var p in obj2) {
      try {
        if (obj1[p].constructor == Object && obj2[p].constructor == Object) {
          obj1[p] = mergeRecursive(obj1[p], obj2[p]);
        } else {
          obj1[p] = obj2[p];
        }
      } catch (e) {
        obj1[p] = obj2[p];
      }
    }
    return obj1;
  }
function mergeRecursive ( obj1 , obj2 ) { for ( var p in obj2 ) { try { if ( obj1 [ p ] . constructor == Object && obj2 [ p ] . constructor == Object ) { obj1 [ p ] = mergeRecursive ( obj1 [ p ] , obj2 [ p ] ) ; } else { obj1 [ p ] = obj2 [ p ] ; } } catch ( e ) { obj1 [ p ] = obj2 [ p ] ; } } return obj1 ; }
Recursively merge properties of two objects
Recursively merge properties of two objects
// Property in destination object set; update its value. // Property in destination object not set; create it and set its value.