Need some help with array(?)

ok so obviously i don’t know all about as 2.0. what i need is to be able to reference a set of numbers (variables) but have them be offset…?.. basically i have a loop going through and among other things, it’s pulling a specific number each time it goes through… what i need to do is reference the number of the previous loop… so, it will go and say loop 1 = 20 loop 2 = 13 loop 3 = 9 and so on… i need to on loop 2 be able to retrieve loop 1’s value… i tried creating an array that uses the push function to append but instead i get loop 1, then undefined, loop 2 then undefined, undefined, loop 3… wtf! so I guess i cant get these values to stay put within the loop itself because it just rewrites them, from what i can tell, so then if there is no way to do it in this manner or something, is there a way to have these values output or simply set aside and then reference the stored numbers the next time around in the loop? Thanks for any help you guys can give me…