In Play 2.3 framework, the response is parsed as JSON. Given the following data:
{"content": [1, 2, 3, 4, 5, 6]}
I tried to access every other elements of the array (i.e. 1, 3, 5) by
// Scala
val array = (response \ "content").as[JsArray].value
for (i <- 0 until array.size / 2)
println(array(i * 2))
But array(i*2) raised error. What would be the canonical approach of access JsArray via index?
Array[Int]instead ofJsArray.