How MutableList() {} works?

I have the habit to using MutableList(size) { readln().toInt() } this is the same that MutableList(size) { it ā†’ readln().toInt() } I am passing a lambda to populate the mutable list?

Iā€™m not sure if I understand the question correctly. Yes, you pass a lambda which is invoked repeatedly to generate all items.

1 Like

where is the documentation about that, you might show me. I search, but not found

1 Like

You can also Ctrl+Click in your IDE on the method to see its definition

2 Likes