Bug Tracker

Ticket #1270 (closed bug: worksforme)

Opened 1 year ago

Last modified 1 year ago

$.map removes duplicates

Reported by: dhull Assigned to: anonymous
Type: bug Priority: minor
Milestone: 1.1.4 Component: core
Version: 1.1.3 Keywords: map
Cc: Needs: Review

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

Change History

Changed 1 year 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.