title: Replace a value if null or undefined in JavaScript
body: <p>I have a requirement to apply the <code>??</code> C# operator to JavaScript and I 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 (<code>my_object[0]</code>). Is there a way to bypass it? (I don't know the names of the filters properties beforehand and don't want to iterate over them).</p>