Filtering Out Duplicate Array Entries with jQuery.unique - J Query

Problem
You have two jQuery DOM collections that need to have duplicate elements removed:

Solution

Discussion
jQuery’s$.unique() function will remove duplicate DOM elements from an array or collection. In the previous recipe, we combine the animals and horses arrays using $.merge(). jQuery makes use of $.unique() throughout most of its core and internal functions such as .find() and .add(). Thus, the most common use case for this method is when operating on an array of elements not constructed with jQuery.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

J Query Topics