title: Understanding the use of || in the code
body: <p>I am relatively new to Javascript and I was trying to understand the use of <strong>||</strong> in the current code. </p>
  
  <p>So, I was going through this <a href="https://medium.freecodecamp.org/reduce-f47a7da511a9" rel="nofollow noreferrer">amazing article on web about reduce</a> in Javascript where he wrote this example </p>
  
  <pre><code>const fruitBasket = ['banana', 'cherry', 'orange', 'apple', 'cherry', 'orange', 'apple', 'banana', 'cherry', 'orange', 'fig' ];
  
  const count = fruitBasket.reduce( (tally, fruit) =&gt; {
    tally[fruit] = (tally[fruit] || 0) + 1 ;
    return tally;
  } , {})
  
  count // { banana: 2, cherry: 3, orange: 3, apple: 2, fig: 1 }
  </code></pre>
  
  <p><strong>[Question]</strong> Here, I am unable to understand two things </p>
  
  <pre><code>tally[fruit] = (tally[fruit] || 0) + 1 ; 
  </code></pre>
  
  <p>What is this <code>||</code> doing here and why did he used it? <em>(I know this is an or operator)</em></p>
  
  <p>And secondly what does this mean <code>, {})</code> at the end of function? </p>