jQuery.merge( first, second )Возвращает: Array
Описание: Объединяет содержимое двух массивов. Результат объединения записывается в первый из этих массивов (он же будет возвращен в качестве результата выполнения функции).
-
Добавлен в версии: 1.0jQuery.merge( first, second )
-
firstТип: ArrayLikeObjectThe first array-like object to merge, the elements of second added.
-
secondТип: ArrayLikeObjectThe second array-like object to merge into the first, unaltered.
-
The $.merge()
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 $.merge()
function is destructive. It alters the length
and numeric index properties of the first object to include items from the second.
If you need the original first array, make a copy of it before calling $.merge()
. Fortunately, $.merge()
itself can be used for this duplication:
1
|
|
This shortcut creates a new, empty array and merges the contents of oldArray into it, effectively cloning the array.
Prior to jQuery 1.4, the arguments should be true Javascript Array objects; use $.makeArray
if they are not.