-
Notifications
You must be signed in to change notification settings - Fork 264
jQuery.merge: add note about it correcting the length
#692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@mzgol WDYT? |
The page still mentions that |
44072ae
to
64a6b90
Compare
So, I updated the entry to use the When updating it I noticed a little issue with 929f9e2, I called the type |
I don't see it mentioned anywhere in the docs that if jQuery modifies an array-like object, its length gets corrected. This would fit perfectly here, though so I'd leave this text. |
@mzgol Updated that. Thanks! At first it sounded quite logical to me so I didn't find an explicit note necessary, but yeah, you're right. WDYT? |
@@ -19,6 +19,7 @@ var newArray = $.merge([], oldArray); | |||
</code></pre> | |||
<p>This shortcut creates a new, empty array and merges the contents of oldArray into it, effectively cloning the array.</p> | |||
<p>Prior to jQuery 1.4, the arguments should be true Javascript Array objects; use <code>$.makeArray</code> if they are not.</p> | |||
<p>Because <code>jQuery.merge()</code> is capable of merging array-like objects it will correct the <code>length</code> property.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a comma before "it". But this note might be better placed near "is destructive" anyway, something like "It alters the length
and numeric index properties of the first parameter to include items from the second."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gibson042 Sounds good. PTAL.
LGTM. |
Fixes #686