Logo

Programming-Idioms

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

Idiom #332 List of the keys of a map

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

final k = m.keys;

The order of the element depends on the Map implementation
import "golang.org/x/exp/maps"
k := maps.Keys(m)

k will be in an indeterminate order

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