From: felix chang Date: 2011-03-24T07:37:58+09:00 Subject: iteration question Dear all: This is my code: data = Array.new(5,[]) 0.upto(4) do |i| data[i].push(i) end p data the output is : [[0, 1, 2, 3, 4], [0, 1, 2, 3, 4], [0, 1, 2, 3, 4], [0, 1, 2, 3, 4], [0, 1, 2, 3, 4]] I am so confused why the output is not that showed below [[0],[1],[2],[3],[4]] -- Posted via http://www.ruby-forum.com/.