Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Perl

Idiom #332 List of the keys of a map

Create the list k containing all the keys of the map m

@k = keys %m;

The keys function extracts the keys from a hash and returns them as a list.
final k = m.keys;

The order of the element depends on the Map implementation

New implementation...
< >
programming-idioms.org