Array creation syntax?


Did there used to be syntax like:

  val arr = [1,2,3]

or am I remembering other languages? Is this the shortest way:

  val arr = arrayOf(1,2,3)




I'd say that's the simplest way, yeah. The first way doesn't work.


I was expecting this simple syntax to create an array known from javascript and dart

var list = [1, 2, 3];

sad this is not possible in kotlin