Bug Tracker

Opened 16 years ago

Closed 16 years ago

#1270 closed bug (worksforme)

$.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:


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.

Change History (1)

comment:1 Changed 16 years ago by john

Resolution: worksforme
Status: newclosed

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

Note: See TracTickets for help on using tickets.