0 votes
in Ruby by
Explain ampersand parameter (&block) in Ruby.

1 Answer

0 votes
by

The &block is a way to pass a reference (instead of a local variable) to the block to a method.

Here, block word after the & is just a name for the reference, any other name can be used instead of this.

...