Kotlin declare nested array
If you have nested arrays structure (for instance, val array: Array<Array<out Int?>> = arrayOf(arrayOf(1), arrayOf(2), arrayOf(3, null, 4))
), you can just use flatten
extension method:
println(array.flatten().filterNotNull())