How to remove object from inside .each()
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/4178123/how-to-remove-a-property-from-an-object">How to remove a property from an object?</a>  </p>
</blockquote>



<p>I am comparing two JSON objects and then deleting the old items from a list with this code:</p>

<pre><code>dangerousPeople = ({1:{title:"Jackie Chan", user:"Jackie"}, 2:{title:"Chuck Norris", user:"Chuck"}, 3:{title:"Britney spears", user:"Britney"}});
newDangerousPeople = ({1:{title:"Jackie Chan", user:"Jackie"}, 3:{title:"Britney spears", user:"Britney"}});

$.each(dangerousPeople, function(index)
{
    if(!newDangerousPeople[index]){

         $('#dangerousPeople #id'+index).slideUp("normal", function() { $(this).remove(); } );

         delete dangerousPeople.index;
    }
});
</code></pre>

<p>The part of the script that slidesup the element works, but deleting the element from the object I can't make it work.</p>

<p>I tried with <code>delete dangerousPeople.index</code> but doesn't work, also tried delete <code>$(this)</code> but no luck either. </p>

<p>So how should I remove the element from itself?</p>
