Filtering duplicate array entries with JQuery

Posted by systempuntoout on Stack Overflow See other posts from Stack Overflow or by systempuntoout
Published on 2010-04-26T23:46:10Z Indexed on 2010/04/27 0:03 UTC
Read the original article Hit count: 242

Filed under:

How do i filter duplicates of two arrays before appending entries to a DOM node (#list)?

(function($) { 
    $(document).ready(function() { 
        var item_category1 = $('li.category1').get(); 
        var item_category2 = $('li.category2').get(); 
        $('#list') 
            .append( $(item_category1).clone() ) 
            .append( $(item_category2).clone() ); 
    }); 
})(jQuery); 

© Stack Overflow or respective owner

Related posts about jQuery