goose2013

Superb much appreciated!

toicontien

You do not want to use a for-in loop to iterate over an Array object. A for-in loop serves a very different purpose: It iterates over all the properties in an object. You want to use a regular loop when iterating over an Array.

ReFreezed

You're missing a [FONT=courier new]var[/FONT] keyword before the i in the for loop. Without it i will become a global variable. Also, using the array literal notation ([FONT=courier new][][/FONT]) is shorter/faster/cleaner than writing [FONT=courier new]new Array()[/FONT], like so: [FONT=courier new]myArray = [];[/FONT] Just a general tip... Also note that [FONT=courier new]for (var ... in ...)[/FONT] is used to iterate through the members of an object and generally not to loop through an array.

Finally, if you're not using the values in the myBooks and myPrices arrays later in your script then you don't need any arrays here - you can just combine your two loops and save the values returned from the prompts in temporary variables inside the loop: