Skip to main content

Bug Tracker

Side navigation

#1270 closed bug (worksforme)

Opened June 05, 2007 10:31PM UTC

Closed July 21, 2007 02:37AM UTC

$.map removes duplicates

Reported by: dhull Owned by:
Priority: minor Milestone: 1.1.4
Component: core Version: 1.1.3
Keywords: map Cc:
Blocked by: Blocking:
Description

The documentation for $.map has the following example:

 $.map( [0,1,2], function(n){
   return [ n, n + 1 ];
 });

It says that the result should be:

[0, 1, 1, 2, 2, 3]

However in version 1.1.2, the jQuery.map function has code to remove duplicates. The actual result from jQuery 1.1.2 is:

[0, 1, 2, 3]

Actually, looking at the trunk, it appears that this bug was already fixed with the code change in revision 1576, but I'm going to report it anyway, in case a regression test should be created.

Attachments (0)
Change History (1)

Changed July 21, 2007 02:37AM UTC by john comment:1

milestone: 1.1.31.1.4
resolution: → worksforme
status: newclosed
version: 1.1.21.1.3

This is no longer the case. $.map() only merges the results.