Array Initialization: Difference between revisions

(add Ruby)
Line 444:
 
 
a = heightArray.times.collectnew(height) {width Array.times.collectnew(width) {0} } # => [[0, 0, 0], [0, 0, 0]]
a[0].equal? a[1] # => false -- phew!
a[0][0] = 1
Anonymous user