Javascript function to encapsulate check if a variable is undefined?
<p>I've been working on a javascript library, and I have a lot of redundant checks like this:</p>

<pre><code>if(typeof foo !== "undefined" &amp;&amp; foo !== null)
</code></pre>

<p>So, I wanted to create a function that will be a shortcut to this unwieldy check. So I came up with this:</p>

<pre><code>function isset(a) 
{
     return (typeof a !== "undefined" &amp;&amp; a !== null) ? true : false;
}
</code></pre>

<p>But, since the value could be undefined, and it attempts to use a possibly undefined variable, it turns out to be useless.</p>

<p>Is there a way to accomplish this without have to extend a native prototype?</p>
