Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 293 Bytes

associative-arrays.md

File metadata and controls

24 lines (16 loc) · 293 Bytes

Associative arrays

aa = [ %w[Someone 1],
      %w[Bla 2]]

p aa.assoc("Someone")
p aa.assoc("Bla")

# Result:
# ["Someone", "1"]
# ["Bla", "2"]

p aa.rassoc("1")
p aa.rassoc("2")

# Result:
# ["Someone", "1"]
# ["Bla", "2"]

View Source