Array.asJSON, when parsed as javascript gives a dictionary with an entry with a 3d array. Do you really need to convert it?
You could build your own array with text from the array before passing it.
global text arrayText = ""
every tick
-- set arrayText to "["
array: for each x
-- add array.curvalue&"," to arrayText
every tick
-- add "]" to arrayText
Then just pass arrayText when you call some js.
You could also build a 1d array from it after passing it, or even just use it directly. I mean say you did:
browser: execute js "myfunction("&array.asJSON&")"
then in that function you'd access stuff like this:
function myfunction(c2array)
{
// access value at x=22
c2array.data[22][0][0];
// access value at x=3, y=2
c2array.data[3][2][0];
// access value at x=13, y=66, z=5
c2array.data[13][66][5];
}
Notice it's always a 3d array.
If you want to convert the 3d array to a 3d one then just go for it. It's the standard type of thing to do when writing code.