title: What is the difference between $.each(selector) and $(selector).each()
body: <p>What is the difference between this:</p>
  
  <pre><code>$.each($('#myTable input[name="deleteItem[]"]:checked').do_something());
  </code></pre>
  
  <p>and this:</p>
  
  <pre><code>$('#myTable input[name="deleteItem[]"]:checked').each(function() { do_something });
  </code></pre>
  
  <p>The html for the table cell that is being selected and acted upon looks like this:</p>
  
  <pre><code>&lt;td width="20px"&gt;&lt;input type="checkbox" class="chkDeleteItem" name="deleteItem[]" value="' . $rowItem['itemID'] . '" /&gt;&lt;/td&gt;
  </code></pre>
  
  <p>I've gone over the jQuery documentation, but I still don't understand the difference. (Is it me or is that documentation sometimes slightly "nebulous" in clarity of content?)</p>
  
  <p><strong>Added Info:</strong></p>
  
  <p>Apparently my attempt a generic examples is confusing people! Along with the (previously) missing parenthesis in the first example. :(</p>
  
  <p>The first example comes from a line in my code that removes the &lt;tbody&gt; for any rows with a checkbox that is checked:</p>
  
  <pre><code>$.each($('#classesTable input[name="deleteClasses[]"]:checked').parent().parent().parent().remove());
  </code></pre>
  
  <p>The second example comes from a situation where I look through the #classesTable for any checked checkboxes and remove its matching item in a dropdown.</p>
  
  <pre><code>$('#classesTable input[name="deleteClasses[]"]:checked').each(function(){
      $('#classesList option[value="' + $(this).attr('value') + '"]').remove();
  });
  </code></pre>
  
  <p>I understand that they do two different things, but not to the point that I'd be able to say "I need to use $.each() in this case and .each(function() {}) in another case.</p>
  
  <p>Are they interchangeable at all? Only in some cases? Never?</p>