How to know if you have a jQuery object
<p>Two questions really...</p>

<p>Firstly, which is the better coding style when writing jQuery functions which take object params, should the function take a jQuery object or is it better to pass a standard JavaScript object and have the function itself do the wrapping? I guess I'm just asking if there is a standard here, since it might not always be obvious to someone who wants to call the function.</p>

<p>And secondly, how do you test if an object is a jQuery object? Ideally it would be nice if the function could take either, so...</p>

<pre><code>function(obj) {
    var $obj;
    if (isJQuery(obj)) {
        $obj = obj;
    }
    else {
        $obj = $(obj);
    }
    // ....
}
</code></pre>

<p>or do you even need to do this? will <code>$(obj)</code> simply return if the object is already a jQuery object, so you can always attempt to wrap and it doesn't matter?</p>
