Latest web development tutorials

jQuery.merge () method

jQuery Misc Methods jQuery Misc Methods

Examples

Merge two arrays, modify the contents of the first parameter

$ (Function () { var arr = $. merge ( [0, 1, 2], [2, 3, 4] ); $ (.. "Span ") text (arr join ( ","));})

try it"

Definition and Usage

$ .merge () Function is used to merge the contents of two arrays into the first array.


grammar

$.merge( first, second )

参数 描述
first Array类型 第一个用于合并的数组,合并后将包含第二个数组的内容
second Array类型 第二个用于合并的数组,该数组不会被修改


Examples

More examples

Merge two arrays
Merge two arrays, and the first parameter copy.

jQuery Misc Methods jQuery Misc Methods