Ruby Collections

Not CompletedHow to Use Arrays in Ruby

Arrays are a common data structure that can be utilized in Ruby programs to store a collection of data types, including: integers, floats, strings, and more.

Not CompletedHow to Delete Items from Arrays in Ruby

Now that we know how to create an array and add elements to it, we are now going to see how to delete items from it.

Not CompletedHow to Use Push and Pop for Arrays in Ruby

A popular way to work with arrays is to push and pop elements. Pushing is when you add an element to the end of the array while popping is when you pop that item off the array. It's similar to inserting and deleting, except that it happens at the end of the array.

Not CompletedRuby Hash Tutorial

For complex collections, the **Hash data structure** is a powerful tool in Ruby programs. Hashes are **key/value** based and let you access data elements with more than a pure index, such as with arrays.

Not CompletedHow to Delete Elements from a Ruby Hash

In this lesson, you'll learn how to delete from a Ruby hash.

Not CompletedIterating Over a Hash for a Key or Value in Ruby

We have already learned how to iterate through a hash in one of our previous lessons, however it's a very critical task that you'll be using quite often, so I'm going to go discuss how it works in more detail. Also, I'm going to show you how you can iterate over just a key or a value.

Not CompletedTop Hash Methods in Ruby

Since hashes are an integral part of Ruby, I want to go through some helpful methods that can be quite handy in development.


Ruby Collections
    Unsupported Browser

    devCamp does not support ancient browsers.
    Install a modern version for best experience.