How to combine/join arrays using jQuery

In this post, we will see that "how to join or combine arrays using jQuery".

Earlier I had posted about jQuery solution to remove item from array, split an array and Find index of element in array, And In this post, find how to combine/join arrays with example.

Below jQuery code joins the two arrays using jQuery.
$(document).ready(function() {
  var arrFirst = [50, 10, 19, 22];
  var arrSecond = [6, 74]; 
  var arrJoin = arrFirst.concat(arrSecond);

In this jQuery code, I have used the concat() method. contact() is the method of an array object and it is invoked on the first array and the second array is passed to it as a parameter. And it returns another array which is combination of both the arrays elements.

See result below.

Feel free to contact me for any help related to jQuery, I will gladly help you.

Nothing shocks me, I'm a Software Engineer. And I am not young enough to know everything. I live in World Wide Web and from there take care of this website. This website communicates about my work, learning and experience. I believe life is short, and it is for loving, sharing, learning and connecting. So lets connect..