Hashes
Goals
Step 1
Type this in irb:states = {"CA" => "California", "DE" => "Delaware"}Type this in irb:states.keys states.valuesType this in irb:states['CA'] states['DE']
Step 2
Type this in irb:bike_1 = {'make' => 'Trek', 'color' => 'Silver'} bike_2 = {'make' => 'Cannondale', 'color' => 'Blue'} bikes = [bike_1, bike_2]Type this in irb:bikes[0]['make'] bikes[1]['color']
Explanation
Further Reading
Ruby's documentation for Hash
Next Step:
Go on to Loops
Back to nil