Quiz on Blocks
Take a quiz on block concepts.
Technical Quiz
1.
What’s the output of the following code?
p [5, 3, 4, 2, 1].detect { |number| number.even? }
A.
4
B.
2
C.
[4, 2]
D.
nil
1 / 4
...
Take a quiz on block concepts.
What’s the output of the following code?
p [5, 3, 4, 2, 1].detect { |number| number.even? }
4
2
[4, 2]
nil