title: Formatting phone number give wrong output
body: <p>My output is not formatted how I want it.</p>
  
  <p>I get <code>(123) 4567890-</code> but I want <code>(123) 456-7890</code></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>  // Display as Phone number: (123) 456-7890
      var num = [1, 2, 3, 4, 5, 6, 7, 8, 9 , 0];
  
      var zip = [];
      var mid = [];
      var last = [];
  
      for (i=0; i&lt; 10; i++) {
       if (i &lt; 3) {
        zip.push(num[i]);
       } else if (2 &lt; i &lt; 6) {
        mid.push(num[i]);
       } else {
        last.push(num[i]);
       }
  
      }
  
      console.log('(' + zip.join("") + ') ' + mid.join("") + '-' + last.join(""));</code></pre>
  </div>
  </div>
  </p>