title: SyntaxError: Unexpected token { in javascript
body: <p>I am having an issue on my problem where the console is saying</p>
  
  <pre><code>SyntaxError: Unexpected token {
  </code></pre>
  
  <p>and I'm not sure where it's coming from. I am a JS newbie, just learning this stuff. Would you mind pointing out where I am going wrong with my brackets please.</p>
  
  <pre><code>var myArray = [4, 6, 23, 10, 1, 3];
  
  var arrayAdditon = function (arr) {
      var largestNumber = arr[0];
      var sumTotal;
      for (var i = 0; i &lt; arr.length; i += 1) {
          if (arr[i] &gt; largestNumber) {
              largestNumber = arr[i];
          }
      }
      for (var i = 0; i &lt; arr.length; i += 1) {
          if (largestNumber) {
              console.log(largestNumber);
          } else (arr[i] != largestNumber) {
              sumTotal += arr[i];   
          }
      }
      if (largestNumber === sumTotal) {
          return true;
      } else {
          return false;
      }
  }
  </code></pre>