3 ms·
disclaimer: I don't know the terminology here, so I might be terribly wrong I thought the main advantage was that you could pass a function to anywhere, wherea
by cubicle67 16y ago
disclaimer: I don't know the terminology here, so I might be terribly wrong
I thought the main advantage was that you could pass a function to anywhere, whereas having explicitly defined tied you then in scope of what could access that function
chosen_numbers = numbers.select{|n| n%3==0 || n%5==0 }
yes, this is a block, but I think is's implemented that same as an anonymous function.