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