title: Javascript loop through collection of objects
body: <pre><code>var squares = [1, 2, 4,  8];
  var cubes = [1, 4, 9, 16];
  var north,east,south,west;
  
  north = getClass(squares[0], cubes[0]);
  east  = getClass(squares[1], cubes[1]);
  south = getClass(squares[2], cubes[2]);
  west  = getClass(squares[3], cubes[3]);
  
  $('.' + north).doStuff()
  $('.' + east).doStuff()
  $('.' + south).doStuff()
  $('.' + west).doStuff()
  </code></pre>
  
  <p>I'm writing some code in javascript and it feels like I should be able to refactor this section but I don't know how to do it.</p>
  
  <p>I think what I want to do is make north,east,south,west into some sort of collection so that i can iterate through it?</p>
  
  <p>How would you recommend I do this with javascript?</p>