Replace a value if null or undefined in JavaScript
<p>I have a requiremnt to apply the ?? C# operator to JavaScript world and don't know how.
Consider this in C#:</p>

<pre><code>int i?=null;
int j=i ?? 10;//j is now 10
</code></pre>

<p>Now I have this set up in JavaScript:</p>

<pre><code>var options={
       filters:{
          firstName:'abc'
       } 
    };
var filter=options.filters[0]||'';//should get 'abc' here, it doesn't happen
var filter2=options.filters[1]||'';//should get empty string here, because there is only one filter
</code></pre>

<p>How do I do it correctly?</p>

<p>Thanks.</p>

<p>EDIT: I spotted half of the problem: I can't use the 'indexer' notation to objects (my_object[0]). Is there a way to bypass it? (I don't know the names of the filters properties beforehand and don't want to itereate over them).</p>
