Javascript/JQuery arguments by type
<p>I'm not quite sure if the title is correct because I'm not sure how to describe my question, but basically I'm wondering how jQuery can handle functions that take things like <code>("Some String", true, function(){})</code> and <code>("Some String", function() {})</code>. IE, it seems like it's an overloaded function, I'd expect the function to be something like</p>

<pre><code>function DoSomething(theStr, theBool, theFunc) {
    //...
}
</code></pre>

<p>but that doesn't explain how it can handle the 2 argument call, at least to me. Anyone able to explain, or is it just a lot of if/else.</p>
