Initialize object within Hash

前端 未结 0 1473
一整个雨季
一整个雨季 2021-02-03 14:00

Which way is better? Or do you know more better way?

data = Hash.new { |h, k| h[k] = Hash.new { |h2, k2| h2[k2] = [] } } # 5 or more times

or

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