jsonQ.js
function(k, v) {
            var type = objType(v),
                tarType = objType(target[k]);

            if (deep && (type == "array" || type == "object")) {
                target[k] = type == tarType && (tarType == "array" || tarType == "object") ? target[k] : type == "array" ? [] : {};

                //to merge recursively
                jsonQ.merge(deep, target[k], v);
            } else {
                target[k] = v;
            }
        }
function(k, v) {
            var type = objType(v),
                tarType = objType(target[k]);

            if (deep && (type == "array" || type == "object")) {
                target[k] = type == tarType && (tarType == "array" || tarType == "object") ? target[k] : type == "array" ? [] : {};

                //to merge recursively
                jsonQ.merge(deep, target[k], v);
            } else {
                target[k] = v;
            }
        }
function ( k , v ) { var type = objType ( v ) , tarType = objType ( target [ k ] ) ; if ( deep && ( type == "array" || type == "object" ) ) { target [ k ] = type == tarType && ( tarType == "array" || tarType == "object" ) ? target [ k ] : type == "array" ? [ ] : { } ; //to merge recursively jsonQ . merge ( deep , target [ k ] , v ) ; } else { target [ k ] = v ; } }
callback function to recursiveliy merge
callback function to recursiveliy merge