0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Ruby ハッシュ 基本を復習

Posted at

ハッシュの中身は

hash = { キー:値 }

hash = {key:value}

です。

中にいくつかのキーと値があるとして

hash = {key1:value1,key2:value2,key3:value3}

それらをオブジェクト.keysつまりこの場合では、puts hash.keysで

key1

key2

key3

と出力されます。

valueにもあり、puts hash.valuesで

value1

value2

value3

 出力されます。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?