2 Replies Latest reply on Jun 22, 2010 12:27 PM by 843789

    Array Question

      Hi guys,

      Is it possible to do the following thing with arrays:

      Let's say we have 3 elements in array1 (2, 4, 5). Now what i am trying to do is, Math.pow all the elements in array1 and save it in array2. So i just wrote:

      Math.pow(array1[0], 2);
      Math.pow(array1[1], 2);
      Math.pow(array1[2], 2);

      and then tried to: array1[] = array2[];

      Whenever i print out array2[] i get this output: 2, 4, 5. What i want to get in array2 are the elements of array1 in power of 2.

      Please advice.