title: Find all combinations of options in a loop
body: <p>I'm looking for the best way to loop through a bunch of options to make sure that I hit all available options.</p>
  
  <p>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.</p>
  
  <p>Now I'm 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.</p>
  
  <p>Say there are 3 different hats, 4 different shirts, 5 different pairs of pants and 6 different pairs of shoes. I can represent this as an array with the number of options for each group. The current array is <code>[3, 4, 5, 6]</code>.</p>
  
  <p>What is the best way to loop through this array to make sure that all possible options will be shown?</p>