jQuery: Any better way to write this block of .each()?
<pre><code>$('.list-links-nested a').each(function(){      
  currentPage(this);
});

$("#menu-main &gt; li &gt; a").each(function(){
  currentPage(this);  
});

$("#menu-sub a").each(function(){      
  currentPage(this);        
});
</code></pre>

<p>Any suggestion on how to write it better instead of repeating the function called?</p>

<p>Updated code and it works:</p>

<pre><code>var links = $(".list-links-nested a, #menu-main &gt; li &gt; a");
links.each(currentPage);
</code></pre>
