title: Possible to loop over each in coffeescript?
body: <p>I'm trying to programmatically create some javascript buttons to toggle visibility on the page (for snappy tag filtering).  This works for one tag:</p>
  
  <pre><code>trigger = ".sales-focus-btn"
  target = ".sales-focus"
  
  jQuery -&gt;   
    $(trigger).toggle -&gt;
      $("#primary-content").find('.container').hide()
      $("#primary-content").find(target).show()
    , -&gt;
      $("#primary-content").find('.container').show()
  </code></pre>
  
  <p>Is it possible to do something similar in coffeescript, but with arrays, e.g.</p>
  
  <pre><code>trigger = [
    ".sales-focus-btn"
    ".service-focus-btn"
    ".other-focus-btn"
    ...
  ]
  target = [
    ...
  ]
  </code></pre>
  
  <p>Is it possible to loop over and create a toggle for each type of tag?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Yes it's possible.  Use the form:</p>
  
  <pre><code>myFunction = (el) -&gt; console.log el
  myFunction elem for elem in array
  </code></pre>