It turns out this was a bug in the docs, not in the code. jQuery.unique only supports an array of DOM elements. See related thread:
[jquery-dev] unique(array) function - bug ticket 1747 http://groups.google.com/group/jquery-dev/browse_thread/thread/92b8c0230efd739 Docs have been updated and ticket closed:invalid. - Richard On 9/28/07, Richard D. Worth <[EMAIL PROTECTED]> wrote: > > It looks like $.unique(array) is only working for arrays of objects at the > moment, which does look like a bug. I've created a ticket: > > http://dev.jquery.com/ticket/1747 > > The ticket has a patch attached including unit tests and a possible fix. > > - Richard > > On 9/27/07, Sparticat < [EMAIL PROTECTED]> wrote: > > > > > > > > Whenever I try to use the $.unique() function it just returns the array > > without removing the duplicates. > > > > $.unique([0,1,1,2,2,3]); returns [0,1,1,2,2,3] instead of [0,1,2,3] as > > described at: http://docs.jquery.com/Utilities/jQuery.unique#array > > > > Is this a bug or am I missing something? > > > > I'm currently using jQuery 1.2 > > -- > > View this message in context: > > http://www.nabble.com/Problem-with-jQuery.unique%28-array-%29-tf4529331s15494.html#a12924415 > > Sent from the JQuery mailing list archive at Nabble.com. > > > > >