let temp = {
name : '张三',
age : 18,
sex : '男'
}
let arr = [];
for(let i=0;i<10;i++){
const tempI = {};
//tempI = temp;
//console.error(i+'>'+JSON.stringify(tempI))
Object.keys(temp).forEach(function(key){
if(key == 'name'){
tempI.name = temp.name + i;
}else{
tempI[key] = temp[key];
}
//console.log(key,temp[key]);
});
arr.push(tempI)
}
console.error('>'+JSON.stringify(arr))