Are anonymous functions more effecient over calling functions?
<p>I'm just starting to learn about jQuery. I'm more of a html+css web designer so you can probably tell functions will take a little bit to adapt to, especially anonymous ones. </p>

<p>So what's the difference if between  </p>

<pre><code>$('p.expander').toggle(
   function() {
    $(this).prev().addClass('open');
   },
   function() {
    $(this).prev().removeClass('open');
  }
);
</code></pre>

<p>and say... </p>

<pre><code> function toggle1 () {  $(this).prev().addClass('open');}
 function toggle2 () {  $(this).prev().removeClass('open');}
 $('p.expander').toggle(toggle1, toggle2); 
</code></pre>

<p>Do you use anonymous functions if you're using it once? And if you're going to use functions more than once, you should call it? </p>

<p>And as the title states, is one more effecient than the other? Because it seems like 99% of the articles use anonymous articles. I find it hard to read the code sometimes because I forget what a semicolon or parenthesis is for. </p>
