Prev: Something I expected to work, but didn't!
Next: Scope
From: Chandramouli Parasuraman on 4 May 2010 08:16 Great, now I understand. Works fine now with both Array.new(1000) {|i| i+1} and the inject. Thanks everyone. -- Posted via http://www.ruby-forum.com/.
From: Thomas Volkmar Worm on 12 May 2010 19:46
(1..1000).select{|n| n % 3 == 0 or n % 5 == 0}.inject{|sum,n| sum + n } |