Bug Tracker

Modify

Ticket #5751 (closed bug: worksforme)

Opened 4 years ago

Last modified 4 years ago

null value in array makes jQuery.merge ignore rest of array

Reported by: jfix Owned by:
Priority: minor Milestone: 1.4
Component: core Version: 1.3.2
Keywords: Cc:
Blocking: Blocked by:

Description

this expression:

jQuery.merge([1, 2], [3, null, 4, 5])

should return

[1, 2, 3, null, 4, 5]

but returns

[1, 2, 3]

everything after (and including the null value) is ignored. I don't think this is the expected behaviour, at least it's not documented as such.

Change History

comment:1 Changed 4 years ago by dmethvin

  • Component changed from unfiled to core

comment:2 Changed 4 years ago by addyosmani

  • Status changed from new to closed
  • Resolution set to worksforme

I've recreated your submitted test case here:  http://jsfiddle.net/addyosmani/XVXGY/2/ and run this against IE6, IE7, IE8, FireFox 3.6.10 and Webkit browsers (Chrome, Safari). All of these browsers returned the correct result [1, 2, 3, null, 4, 5].

I'm closing this ticket as worksforme, but please feel free to re-submit if you are able to provide further information regarding this particular bug.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.