scala> javascript { val l = Array("1"); for (x <- l) { console.log(x); } }.asString
res18: String =
{
var l = ["1"];
for (x in l) console.log(x);
}
scala> javascript { val l = Array(1); for (x <- l) { console.log(x); } }.asString
<console>:11: error: exception during macro expansion:
scala.MatchError: scala.this.Predef.intArrayOps(l).foreach[Unit] (of class scala.reflect.internal.Trees$TypeApply)
but you can iterate over Array[Array[Int]]:
scala> javascript { val l = Array(Array(1)); for (x <- l) { console.log(x); } }.asString
res20: String =
{
var l = [[1]];
for (x in l) console.log(x);
}
but you can iterate over
Array[Array[Int]]
: