function return??


    Mar 28 2013 | 3:54 pm
    hi all, I am quite new js, I am trying to make a simple function which outputs an array, composed of four arrays.
    so if I have:
    pOne = z;
    pTwo = z;
    pThree = z;
    pFour = z;
    array = new Array(pOne, pTwo, pThree, pFour);
    return array;
    it works!
    and if I try:
    pOne = new Array((x-scal), (y+scal), z);
    pTwo = new Array((x+scal), (y+scal), z);
    pThree = new Array((x+scal), (y-scal), z);
    pFour = new Array((x-scal), (y-scal), z);
    array = new Array(pOne, pTwo, pThree, pFour);
    return array;
    it outputs:
    jsobject 141293048 jsobject 141293072 jsobject 141293096 jsobject 141293120
    ???
    can anyone help me?

    • Mar 28 2013 | 6:45 pm
      That's because each element in your array is an array, so Max can't interpret this.
      If you do return array[0]; you'll get your first array. Are you trying to join all the elements in a single array ?
    • Mar 28 2013 | 8:05 pm
      Hell! I should have thought about that! :(
      I must separate arrays when I call the function! And then output it.
      thanks a lot for your help!