Hashes and Symbols
Learn more about Ruby’s _hash_ data structure including its various syntaxes, relationship with _symbols_, and the commonly used methods it
StartKey Concepts
Review core concepts you need to learn to master this subject
Ruby Symbols
Ruby Symbols
my_bologna = {
:first_name => "Oscar",
:second_name => "Meyer",
:slices => 12
}
puts my_bologna[:second_name] # => Meyer
#Symbols must be valid Ruby variable names and always start with a colon (:).
In Ruby, symbols are immutable names primarily used as hash keys or for referencing method names.
Hashes and Symbols
Lesson 1 of 2