Sunday, October 2, 2011

$.unique(Array)

$.unique(Array array) returns Array
Reduce an array (of jQuery objects only) to its unique elements.

Example:

Reduces the arrays of jQuery objects to unique elements by removing the duplicates of x2 and x3
$.unique( [x1, x2, x3, x2, x3] )

Result:
[x1, x2, x3]

No comments:

Post a Comment