javascript jquery function that expects a specific type of function as parameter?
<p>In jquery when I run:</p>

<pre><code>$('li').each(some-function(i){});
</code></pre>

<p>The IDE seems to know that some-function is expecting an index.</p>

<p>It leads me to believe I can make a function in javascript/jquery that expects a function as one of it's parameters that expects certain paramters. (I am new to javascript)</p>

<p>I know how to do it in c language.</p>

<p>I am looking for something like this:</p>

<pre><code>void somefuncA ( void (*funcB)(int) ){
    //do stuff with funcB
    (*funcB)(5);
}
</code></pre>

<p>So the function 'somefuncA' expects to get a function funcB that gets one integer as a parameter and then does something.</p>

<p>Hope that makes sense.. thanks
p.s. I know JavaScript is weakly type but I also noticed that <code>.each()</code> expects a function as parameter and not just any function but one with an int as parameter.</p>
