Ofir Bar
04/14/2020, 5:34 PMval arrayList : ArrayList<String> = arrayListOf()
for(person in 0..listOfPersonsIndex){
arrayList.add(person[i])
}
I would like to no do that declaration of empty arraylist and the assign it.
Is there a cleaner way to immediately assign a value for it in the stdlib?jw
04/14/2020, 5:37 PMOrhan Tozan
04/14/2020, 6:04 PMlistOfPersonsIndex.toList()
would be all you need.Zach Klippenstein (he/him) [MOD]
04/14/2020, 6:04 PMList(n) { person[it] }
or best of all, just person.toMutableList()