$.extends 继承原理

<script type="text/javascript">
function mixs (){
var arg = arguments;
var i = 1;
target = arg[0];
for (; i < arg.length;i++) {
var a = arg[i];
for (var key in a) {
target[key] = a[key];
}
}
return target;
}

var json = {username:‘keke‘,password:‘1231‘};
var json2 = {tel:‘13123122‘,username:‘jer‘,password:‘12555‘};
alert(JSON.stringify(mixs(json,json2)));
</script>

时间: 2024-08-04 23:47:51