#8516 closed enhancement (wontfix)
Multiple arguments to jQuery.merge
Reported by: | anonymous | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | 1.next |
Component: | unfiled | Version: | 1.5.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I found it strange that jQuery.merge could only handle two arguments resulting in code such as $.merge($.merge([], first), second) which was taken straight out of the documentation.
I am proposing a multiple arguments version of the function, much like $.extend such that the above code can read $.merge([], first, second)
Change History (3)
comment:1 Changed 13 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:2 Changed 12 years ago by
Not sure if this is the correct forum for this, but I find the reasoning given for "WONTFIX"ing this bug a little weak. Just because it isn't needed by "core" (whatever that is), doesn't mean it wouldn't be a super-useful utility function for jQuery users. It would certainly serve as a nice bit of sugar on what is there right now and at first blush, doesn't seem like the implementation would add any significant overhead.
Straight from the documentation on merging two arrays into a third one:
var c = $.merge($.merge([], a), b);
Awkward to say the least. It could become:
c = $.merge([], a, b);
So much more legible.
Please re-consider.
comment:3 Changed 12 years ago by
Feel free to use this handy plugin: http://jsfiddle.net/rwaldron/JfsYx/
This isn't needed by core so we're closing it.