title: jQuery.each() - passing extra argument to the callback parameter
body: <p>This is a fragment of a plugin that I'm using on my site:</p>
  
  <pre><code>$.fn.extend({
      limiter: function(limit, elem) {
          $(this).on("keyup focus", function() {
              setCount(this, elem);
          });
          function setCount(src, elem) {
              ...
          }
      }
  });
  </code></pre>
  
  <p>The <code>setCount()</code> function works well only if the <code>elem</code> property in <strong>not</strong> an array - only single values are accepted.</p>
  
  <p>I'd like to change it so that I can pass arrays (multiple selection in my case) to the <code>setCount()</code> function.</p>
  
  <p>I thought that a solution would be to use <code>jQuery.each()</code> iterator like so:</p>
  
  <pre><code>$.fn.extend({
      limiter: function(limit, elem) {
          $(this).on("keyup focus", function() {
              $.each(elem, setCount)
          });
          function setCount(src, elem) {
              ...
          }
      }
  });
  </code></pre>
  
  <p>The problem is that I also have to pass the <code>this</code> object which points to the object that received <code>"keyup focus"</code> as is the case in the first snippet.</p>
  
  <p>How do I pass <code>this</code> object to the callback property of <code>$.each()</code> in the given scenario?</p>