In Ruby, there are a couple ways to accomplish this. The + operator is the first. This will append one array to the end of another, resulting in a third array containing both arrays' entries. Use the concat technique instead (both the + operator and the concat method are functionally similar).
Array.append() is the syntax
Arrays for adding elements are provided as a parameter. — items to be included
After adding the elements at the end, return: Array.
Share a personalized message with your friends.