Does jquery `append()` remove duplicate objects?
<p>I'm sorting a table using jQuery, roughly following the code found <a href="https://stackoverflow.com/questions/10543618/jquery-sort-a-table-after-adding-a-row-to-it">here</a>. The code sketch is as follows:</p>

<pre><code>$('.sort-table').click(function(e) {
    // cache objects
    $table  = $('#sort-table'),        // cache the target table DOM element
    $rows   = $('tbody &gt; tr', $table); // cache rows from target table body

    // sort items
    $rows.sort(&lt;my_predicate_function(a,b){...}&gt;);

    // assign to table - what is going on?
    $rows.each(function(index, row){
        $table.append(row);  // &lt;-- how come $table remains the same size?                  
    });
});
</code></pre>

<p>While the code works fine, I'm puzzeled by the code that appends the rows back to the table, which simply iterates over the sorted rows, appending each at the end of <code>$table</code>.<br/><br/>
<strong>At no stage did we emtpy <code>$table</code> from its previous children.</strong></p>

<ul>
<li>Since <code>$table</code> was never emptied, how come <code>$table</code> remains the same size? </li>
<li>Does <code>append()</code> also enforces uniquness in the target container?</li>
</ul>