Bug Tracker

Ticket #5751 (closed bug: worksforme)

Opened 6 years ago

Last modified 5 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:


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 5 years ago by dmethvin

  • Component changed from unfiled to core

comment:2 Changed 5 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.

Note: See TracTickets for help on using tickets.