I'm new to Kotlin and have difficulty understanding how the init function works in context of an Array. Specifically, if I'm trying to make an array of String type using:
val a = Array<String>(a_size){"n = $it"}
This works, but what does
"n = $it"mean? This doesn't look like theinitfunction as it is within curly braces and not inside the parenthesis.If I want an Array of
Intwhat would theinitfunction or the part inside the curly braces look like?