Last active
December 22, 2015 18:39
-
-
Save gtrak/6514209 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = ["first", "second", "third", "fourth"] | |
puts "#{a}" | |
puts a[0] | |
puts a[3] | |
b = {"key1" => "value1", | |
"key2" => "value2"} | |
puts "#{b}" | |
puts b['key1'] | |
puts b['key2'] | |
c = [{"nested-key" => "This is Nested Inside An Array"}] | |
puts c[0]['nested-key'] | |
inner = c[0] | |
puts inner['nested-key'] | |
;; prints (don't run this part) | |
["first", "second", "third", "fourth"] | |
first | |
fourth | |
{"key1"=>"value1", "key2"=>"value2"} | |
value1 | |
value2 | |
This is Nested Inside An Array | |
This is Nested Inside An Array |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment