Best way to make sure I get all available options array/loop

Posted by jaz872 on Stack Overflow See other posts from Stack Overflow or by jaz872
Published on 2012-08-28T03:33:29Z Indexed on 2012/08/28 3:38 UTC
Read the original article Hit count: 118

Filed under:
|
|

OK, here is my problem. I'm looking for the best way to loop through a bunch of options to make sure that I hit all available options. Some detail.

I've created a feature that allows a client to build images that are basically other images layered on top of each other. These other images are split up into different groups. They have links on the side of the image that they can click to scroll through all the different images to view them.

I'm now making an automated process that is going to run the function that changes the image when a user clicks one of the links. I need to make sure that every possible combo of the different images is hit during this process.

So I have an array with the number of options for each group. The current array is [3, 9, 3, 3]

My question is what is the best way to loop through this to make sure that all possible options will be shown?

I apologize if this seems simple for someone out there, but I'm just having trouble wrapping my head around it. Hopefully if that person is out there, they can give a helping hand :)

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about arrays