Let us say, we have a Array that contains three names, Mohan, Kriti and Salim. And we want to insert a new Array with two names Sia and Andrew at the end of the Array.
Well! Two arrays can be joined by using the + operator
Let us see with the below example.
x = ["Mohan", "Kriti", "Salim"] y = ["Sia", "Andrew"] z = x + y puts z
So, in the above code we have created a Array and initialised to the variable x.
x = ["Mohan", "Kriti", "Salim"]
Below is how the values are positioned in the Array,
Also we have another Array that contains, Sia and Andrew.
y = ["Sia", "Andrew"]
Next, we have used the + operator to add the the Arrays x and y.
z = x + y
And the Arrays x and yis joined and initialised to a new Array z.
And the new array z looks like,
['Mohan', 'Kriti', 'Salim', 'Sia', 'Andrew']