Unsure of what combining operators performs in function
<p>I have been programming the following function and have understood everything up until this line.</p>

<pre><code>   cost += nightSurcharge;
</code></pre>

<p>I am using conditionals in my <code>if</code> statement that are used to add the nightSurcharge to the cost between 8pm and 6am. </p>

<p>What I need to understand is whether the <code>+=</code> is simply saying add the nightSurcharge to cost if the condition is met?</p>

<pre><code>// add a parameter called hourOfDay to the function
    var taxiFare = function (milesTraveled, hourOfDay) {
      var baseFare = 2.50;
      var costPerMile = 2.00;
      var nightSurcharge = 0.50; // 8pm to 6am, every night

      var cost = baseFare + (costPerMile * milesTraveled);

      // add the nightSurcharge to the cost starting at 
      // 8pm (20) or if it is before 6am (6)
       if (hourOfDay &gt;= 20 || hourOfDay &lt; 6) {
          cost += nightSurcharge;
      } 

      return cost;

    };
</code></pre>
