Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
List<K> k = copyOf(m.keySet());
Immutable
k := make([]K, 0, len(m))
for key := range m {
k = append(k, key)
}
The keys have type K
k will be in an indeterminate order
k will be in an indeterminate order
@k = keys %m;
The keys function extracts the keys from a hash and returns them as a list.
k = [*m.keys()]
k = list(m.keys())