Skip to content

Commit c0e5d54

Browse files
committed
jQuery.merge: accept array-like objects instead of arrays
Fixes jquerygh-686 Closes jquerygh-692
1 parent e0f1e22 commit c0e5d54

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

entries/jQuery.merge.xml

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
<desc>Merge the contents of two arrays together into the first array. </desc>
55
<signature>
66
<added>1.0</added>
7-
<argument name="first" type="Array">
8-
<desc>The first array to merge, the elements of second added.</desc>
7+
<argument name="first" type="ArrayLikeObjects">
8+
<desc>The first array-like object to merge, the elements of second added.</desc>
99
</argument>
10-
<argument name="second" type="Array">
11-
<desc>The second array to merge into the first, unaltered.</desc>
10+
<argument name="second" type="ArrayLikeObjects">
11+
<desc>The second array-like object to merge into the first, unaltered.</desc>
1212
</argument>
1313
</signature>
1414
<longdesc>
15-
<p>The <code>$.merge()</code> operation forms an array that contains all elements from the two arrays. The orders of items in the arrays are preserved, with items from the second array appended. The <code>$.merge()</code> function is destructive. It alters the first parameter to add the items from the second. </p>
15+
<p>The <code>$.merge()</code> operation forms an array that contains all elements from the two arrays. The orders of items in the arrays are preserved, with items from the second array appended. The <code>$.merge()</code> function is destructive. It alters the <code>length</code> and numeric index properties of the first object to include items from the second.</p>
1616
<p>If you need the original first array, make a copy of it before calling <code>$.merge()</code>. Fortunately, <code>$.merge()</code> itself can be used for this duplication:</p>
1717
<pre><code>
1818
var newArray = $.merge([], oldArray);

0 commit comments

Comments
 (0)