title: How to make a zero number value count as a truthy value?
body: <p>I've found myself running into the same buggy thing over and over the last couple of weeks, it's when using the <code>||</code> operator to assign a default value if the first value isn't set:</p>
  
  <pre><code>(myVariable || 'somestring')
  </code></pre>
  
  <p>This works whenever <code>myVariable</code> isn't a <code>0</code>, but if it is a <code>0</code> then it becomes problematic since it will then count it as a falsy value. This can be solved by checking if it is a zero, but it quickly becomes an unreadable mess such as <code>(myVariable >= 0 ? myVariable : 'somestring')</code>. </p>
  
  <p>What would be the easiest and most correct way of allowing <code>myVariable</code> to be <code>0</code> but still count as the truthy value? Note that <code>myVariable</code> must still be the original value so using the <code>!!</code> operator for example won't work.</p>