What is the difference of these two snippets of code? And how to decide which one to use?
var array = arrayOf(1,2,3,4,5)
and
var list = listOf(1,2,3,4,5)
With both codes I could access it by its index like this
println(array[0]) // Outputs 1
println(list[0]) // Outputs 1