Intermediate Ruby
Q42 / 100

What does the "&block" parameter syntax do in a method definition?

Correct! Well done.

Incorrect.

The correct answer is B) It captures the block passed to the method as an explicit Proc object that can be called with .call or yielded

B

Correct Answer

It captures the block passed to the method as an explicit Proc object that can be called with .call or yielded

Explanation

Prefixing the last parameter with "&" converts an implicit block argument into an explicit Proc object, which can be stored, passed around, or invoked with call/yield.

Progress
42/100