Lessons
Projects
Bootcamp
Blog
Previous Lesson
Ruby Basics
Collections
Next Lesson
No site found for codelikethis.herokuapp.com; using CodeLikeThis content.
Slides
Collections
Arrays
Hashes
Ranges
Ref. WGR Chapter 9, Collection and container objects
Array vs. Hash
Array
Hash
ordered list of values
unordered set of key/value pairs
has an
index
that must be an integer
has a
key
that can be any object
(symbol, number, string, another hash, etc.)
also called List, Vector, Stack(?)
Hash is also called Map, Dictionary
literals are defined with [ ]
literals are defined with { }
accessed with [ ]
also
accessed with [ ]
Outline
Collections
Array vs. Hash
Show Slides
Previous Lesson
Ruby Basics
Collections
Next Lesson