jQuery Extension accepting a String not just an Object
<p>This might be a silly question, but I can't seem to find a solution...</p>

<p>I just wanted to make a <strong>isNullOrWhiteSpace</strong> extension (same name as the .NET one), to determine if a string is <code>'', '0', 0, undefined, null</code>. Nothing crazy.</p>

<p>Now doing it with a typical jQuery extension, it seems it is always looking for a jQuery <strong>Object</strong> to be passed in. But for in my extension, I need it to work with a simple <strong>string</strong>, but it doesn't work at all when I do.</p>

<pre><code>$.fn.isNullOrWhiteSpace = function () {
    if (['', '0', 0, undefined, null].indexOf($.trim(this)) &gt; -1) {
        return false;
    }
    return true;
};

'testing'.isNullOrWhiteSpace(); // doesn't work
// Uncaught TypeError: Object has no method 'isNullOrWhiteSpace'
</code></pre>

<p><strong>What am I missing here??</strong></p>

<p>-- from answers below, turns out it should be simply:</p>

<p><strong><code>$.isNullOrWhiteSpace</code></strong>, the <code>$.fn.</code> part makes it a jQuery-Object extension as opposed to just a regular extension (like <code>$.isArray()</code>, <code>$.trim()</code> (which I use in my own question... sigh))</p>
