Modify ↓
Ticket #10435 (closed enhancement: wontfix)
jQuery.merge refactor
| Reported by: | MikeS | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | None |
| Component: | core | Version: | 1.7b1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
- the code for guessing that 2nd argument is an object is:
if ( typeof second.length === "number" ) {
it will work incorrectly for strings, plain objects with 'length' property etc. Why not use jQuery.isPlainObject here?
- if both arguments are plain arrays, why no use Array.concat method?
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

The simplicity and speed of merge is much more important than allowing any type of arguments, given its vast usage internally.