Bet this code does something you didn't expect: array = http://Array.new (100, "") array.each {|x| x.prepend("Hello world") }
-
-
winner! you can fix it with a block
-
Also with `# frozen-string-literals: true` ;)
End of conversation
New conversation -
-
-
Ahhhhhh. Same instance of that string. Shit that’s trippy.
-
It actually makes more sense than `.dup` IMO, given the lack of any deep copy in Ruby
- 1 more reply
New conversation -
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.