Parameters: This function accept two parameters as mentioned above and described below:
- array: It is an array to which values are to be added.
- values: It is the Array of values that is to be added to the original array.
Note: The array value can also contain arrays of array or simple a single object to be added to original array.
Return Value: This function returns the array after concatenation.
Few examples are given below for better understanding of the function.
Example 2: Adding array of array to original array.
Example 3: This example adding the object to the array.