//调用方法: var targetObject = [{name:"11",age:11}]; var sourceObject = [{name:"22",age:22}]; var result = $.extend(true,targetObject,sourceObject); //手写拼接: var str1=[{name:"11",age:11}]; var str2=[{name:"22",age:22}]; var str3 = []; for (var i = 0; i < str1.length; i++) { str3.push(str1[i]); } for (var i = 0; i < str2.length; i++) { str3.push(str2[i]); } -------------- var str3 = str1.concat(str2);
时间: 2024-10-03 23:58:54