Quiz on Blocks
Take a quiz on block concepts.
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
Question 1 of 40 attempted
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