DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR RUBY
difference between Hash.new and Hash.new { |h, k| h[k] = [] }
h = Hash.new { |h, k| h[k] = [] } h[:a] # => {:a=>[]} h[:b] << 123 # => {:a=>[], :b=>[123]}
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#difference
ADD COMMENT
Topic
COMMENT
Name
8+4 =
Submit