title: Javascript inline condition: major than 0 return result if not return 0
body: <p>It's possible to write in one line something like this?</p>
  
  <pre><code>let value1 = 10;
  let value2 = 20;
  
  let result = ( value1 - value2 ) / ( value1 - 1);
  if (result&lt;0)
   result = 0;
  </code></pre>
  
  <p>Something like this (but without having to rewrite the formula 2 times):</p>
  
  <pre><code>let result = ( ( ( value1 - value2 ) / ( value1 - 1) ) &lt; 0 ) ? 0 : ( ( value1 - value2 ) / ( value1 - 1) );
  </code></pre>