How can I check if a localstorage variable is null or undefined?
<p>I have this code:</p>

<pre><code>var sideBar = localStorage.getItem('Sidebar');
</code></pre>

<p>I want to check if sideBar is defined and not null in an if statement. I am a bit confused I know there's a: <code>sideBar == undefined</code> and <code>sideBar != null</code> </p>

<p>but is there a good way for me to do this test for both of these inside an if:</p>

<pre><code>if (??) 
</code></pre>
