Use for in loop to go through an array
<html> <head> <title>A Simple Page</title> <script language="JavaScript"> var myarray = new Array(5); myarray[0] = 5 myarray[1] = 8 myarray[2] = 10 myarray[3] = 18 myarray[4] = 180 for (x in myarray) { myarray[x] = ++myarray[x]; } alert(myarray); alert(x); </script> </head> <body> </body> </html>