title: isLucky task - CodeSignal; keeps running true even with if else statement defaulting to false
body: <p>I'm doing the isLucky task on CodeSignal and my code keeps returning true. What can I do to fix this?</p>
  
  <p>Task: A ticket number is considered lucky if the sum of the first half of the digits is equal to the sum of the second half.</p>
  
  <p>Given a ticket number n, determine if it's lucky or not.</p>
  
  <p>I've tried switching the order of the code using </p>
  
  <pre><code>if(first == second) {
  return true;
  } else { 
  return false;
  }
  
  
  function isLucky(n) {
      var half = n.length/2;
      var first = 0;
      var second = 0;
      for(var i = 0; i &lt; half; i++) {
          first += n[i];
      }
      for(var j = half+1; j &lt; n.length; j++) {
          second += n[j];
      }
      if(first != second) {
          return false;   
      } else {
          return true;
      }
  }
  </code></pre>
  
  <p>One of the practice tests is n = 239017; I expected it to return false, but it returns true.</p>