|
|
|
|
|
by _zagj
536 days ago
|
|
> In Ruby 3.4, it has been added as a default name for the first parameter passed to a block. Rather than specifying a name in trivial cases like the one above, you can now write: > [ > "beige chinos", > "blue jorts", > "rainbow jorts", > ].filter { it =~ /jorts/ } > # => ["blue jorts", "rainbow jorts"] This reminds me of Perl's $_ (which in Ruby is last line read from STDIN). |
|