2021-01-17から1日間の記事一覧
配列とハッシュが混在しているとき値の取り出し方が混乱したのでまとめました。 <配列> student = ["taro", "ichiro", "jiro"] puts student [1] # => ichiro <ハッシュ> profile = {age: 12, height: 160, weight: 50} puts profile [:age] # => 12 <…
配列とハッシュが混在しているとき値の取り出し方が混乱したのでまとめました。 <配列> student = ["taro", "ichiro", "jiro"] puts student [1] # => ichiro <ハッシュ> profile = {age: 12, height: 160, weight: 50} puts profile [:age] # => 12 <…