I have an array of objects
object will be in below format
var newUserDetail={"Age":"21","name":"Vicky","UserId":"198303"};
Now I am trying to compare UserId and replace the values
//usersList contains array of newUserDetail kind of objects
jQuery(usersList).each(function(){
if(this.UserId==newUserDetail.UserId){
this=newUserDetail;
}
});
But it throws an error
Invalid left-hand side in assignment