How to get a hash value by numeric index

后端 未结 0 1806
青春惊慌失措
青春惊慌失措 2021-02-11 17:39

Have a hash:

h = {:a => \"val1\", :b => \"val2\", :c => \"val3\"}

I can refer to the hash value:

h[:a], h[:c]


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题