Forum Discussion

VasanthVijay's avatar
VasanthVijay
Contributor
12 years ago

Reg:Array

I have an array of a = new array("a","b","c")

                                b = new array('0','10'',123'')

                                 c = new arrray(''0,'123','154');

                            axis(a,b,c);

axis is a method it assing value of min"0" and max "0"

like that it follows but i want in single array.Is it possible.
  • Philip_Baird's avatar
    Philip_Baird
    Community Expert

    Hi Vasanth, do mean you want to pass a single, multi-dimensional Array into the axis() method?


     


    If so, in JScript, which doesn't support multi-dimensional Arrays, you can use an Array of Arrays as shown:


     


    var a = new Array( [ "a", "b", "c" ],


                       [ 0, 10, 13 ],


                       [ 0, 123, 154 ] );


                         


    Log.Message( a[1][2] ); // Logs 13


     


    An alternative syntax to acheive that same result is:


     


    var a = [ [ "a", "b", "c" ],


              [ 0, 10, 13 ],


              [ 0, 123, 154 ] ];


     


    You could then refactor the axis() method to be called as such: axis( a );


     


    Hope this is of some assistance


     


    Regards,


    Phil