Javascript structure syntax's picture

I wanted to write a very simple JS to make nested structures of x,y,z rotational values for the 3d transform patch.

I searched a bunch of .qtz and JS sites for the correct syntax and could not find it – ended up coding it in XML and using XML downloader patch.

I'd still like to know how to declare a structure in a structure in JS. It was just a data port. He's the XML:

<?xml version="1.0" encoding="UTF-8"?>
   <name>Rotational Positions</name>

If somebody could give the essential JS lines I would be most grateful. Keys (xRot, yRot, zRot ) would be nice but not necessary :).

Here is my lame JS – a combination of attempts after many trials and revisions, just to give idea of where I was coming from (or not :/) .

function (__structure outputNumber) main (inputNumber)
   var result = new Object();
//   result[0] =  rotCoords(720,180,45);
   result[1] = [720,0,45];
/*   result[2] = (135,45,0);
   result[3] = (415,135,-45);
   result[4] = (90,180,135);
   result[5] = (30,60,30);
   return result;
function rotCoords (Xrot,Yrot,Zrot)
   var result = new Array(Xrot, Yrot, Zrot);
   return result;

Sorry for the lame question but it's giving me grief that I can't do this simplest of things with JS.