Key Concepts

Review core concepts you need to learn to master this subject

Ruby Array

numbers = [1, 2, 3, 4, 5] #An array of Integers words = ["See", "Spot", "run"] #An array of Strings mixed = ["hello", 5, true, 3.0] #An array with a String, Integer, Boolean, and Float empty = [] #An empty array

In Ruby, an array is an ordered collection of Ruby objects separated by commas and enclosed in []. An array can contain the same or different types of Ruby objects, such as Integers, Strings, Floats, etc. An array can also be empty.

Data Structures
Lesson 1 of 2