/**
* Copy all the attributes of s to r
* @param r {Object}
* @param s {Object}
* @param is_overwrite {Boolean} If false is specified, it will not be overwritten. Existing values, other values
* including undefined, all mean that the property with the same name in s will overwrite the value in r
*/
mix : function (r, s, is_overwrite) { //TODO:
if (!s || !r) return r;
for (var p in s) {
if (is_overwrite !== false || !(p in r)) {
r[p] = s[p];
}
}
return r;
}
var a={
aa:1,
ab:2
};
var b={
ba:1,
bb:2
};
$.extend(a,b);
console.info(a);