Bug Tracker

Ticket #1270 (closed bug: worksforme)

Opened 8 years ago

Last modified 7 years ago

$.map removes duplicates

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

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.

Change History

comment:1 Changed 7 years ago by john

  • Status changed from new to closed
  • Version changed from 1.1.2 to 1.1.3
  • Resolution set to worksforme
  • Milestone changed from 1.1.3 to 1.1.4

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

Note: See TracTickets for help on using tickets.