YouTip LogoYouTip

Misc Merge

# jQuery.merge() Method [![Image 4: jQuery Misc Methods](#)jQuery Misc Methods](#) ## Example Merge two arrays, modifying the content of the first parameter $(function(){var arr = $.merge([0,1,2], [2,3,4]); $("span").text(arr.join(", ")); }) [Try it Β»](#) * * * ## Definition and Usage The $.merge() function is used to merge the contents of two arrays into the first array. * * * ## Syntax _$_.merge( first, second ) | Parameter | Description | | :--- | :--- | | _first_ | Array type. The first array to merge. After merging, it will contain the contents of the second array. | | _second_ | Array type. The second array to merge. This array will not be modified. | * * * ![Image 5: Example](#) ## More Examples (#) Merge two arrays, and copy the first parameter. [![Image 6: jQuery Misc Methods](#)jQuery Misc Methods](#)
← Misc ParsejsonMisc Iswindow β†’