How do I convert a `List<Int>` to an `IntArr...
# getting-started
l
How do I convert a
List<Int>
to an
IntArray
(not
Array<Int>
)?
l
Ah, I was wondering why it doesn't show up in code completion. But I had a
Map<Int, Int>
which I converted using
toList()
and it's obviously a
List<Pair<Int, Int>>
. So I first have to map it to list of the map's keys (for example) 🤦
Thanks for the hint though!
g
map.keys.toIntArray() should do the trick
l
Thanks!