From: matz@... (Yukihiro Matsumoto) Date: 2003-02-13T18:15:45+09:00 Subject: Re: hm,... arr[1]["name"] Hi, In message "Re: hm,... arr[1]["name"]" on 03/02/13, "Robert Klemme" writes: |> How to do this in ruby? | |a = [] |10.times do | a.push( { "name" => "daniel", "age" => 20 } ) |end | |You can squeeze it into two lines, if you like: | |a = [] |10.times { a.push( { "name" => "daniel", "age" => 20 } ) } Even in a line: a = (1..10).collect{{"name" => "daniel", "age" => 20}} matz.