my @test = ( {id => 1}, {id => 2} );
my @arr = map $_->{id}, @test;
say 1 ~~ @arr;
and this doesn't (namely context in matching is scalar):
my @test = ( {id => 1}, {id => 2} );
say 1 ~~ map $_->{id}, @test;
?In reply to map and smart match by toapole
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |