let obj={
name:'jack',
age:18,
sex:'girl'
}
let obj2={
name:'rose',
age:18,
sex:'boy'
}
var str={}
for(let key in obj){
for(let keys in obj2){
if(obj[key]!=obj2[key]){
str[key]=obj2[key]
}
}
}
console.log(str) //{name: "rose", sex: "boy"}