Learn Ruby
Array
14.7
Lesson

Using double arrow to add an item to an array

In the earlier lesson we saw that we can add to an array by using push.

Instead of using push we can also use << to add to an array. Here are some examples.

We can also add another array to an array.