Bet this code does something you didn't expect: array = http://Array.new (100, "") array.each {|x| x.prepend("Hello world") }
-
-
Replying to @schneems
I'll take "creates an array of 100 elements all pointing at the same string of 'Hello world' repeated 100 times" for $500, Alex
2 replies 0 retweets 4 likes -
Replying to @sgrif
winner! you can fix it with a block
2 replies 0 retweets 2 likes
Replying to @schneems
Also with `# frozen-string-literals: true` ;)
2:20 PM - 15 Sep 2017
0 replies
0 retweets
2 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.