RosettaCodeData/Task/Associative-array-Creation/Brat/associative-array-creation.brat
Ingy döt Net 518da4a923 B
2013-04-10 16:19:29 -07:00

8 lines
164 B
Text

h = [:] #Empty hash
h[:a] = 1 #Assign value
h[:b] = [1 2 3] #Assign another value
h2 = [a: 1, b: [1 2 3], 10 : "ten"] #Initialized hash
h2[:b][2] #Returns 3