title: Project Euler #1
body: <p>I only started programming about three days ago and I've been working with Javascript. I've been trying to tackle Project Euler <a href="https://projecteuler.net/problem=1" rel="nofollow">Problem 1</a>:</p>
  
  <blockquote>
    <p>Find the sum of all the multiples of 3 or 5 below 1000.</p>
  </blockquote>
  
  <p>And I feel like my program should work, but my answer is still slightly off. Could anyone tell me what's wrong with my code?</p>
  
  <pre><code>var threeSum = [];
  var threeTotal = 0;
  var fiveSum = [];
  var fiveTotal = 0;
  for (i = 0; i &lt; 1000; i += 3) {
      threeSum.push(i);
  }
  for (j = 0; j &lt; threeSum.length; j++) {
      threeTotal = threeTotal + threeSum[j];
  }
  for (a = 0; a &lt; 1000; a += 5) {
      fiveSum.push(a);
  }
  for (r = 0; r &lt; fiveSum.length; r++) {
      fiveTotal = fiveTotal + fiveSum[r];
  }
  console.log(threeTotal + fiveTotal);
  </code></pre>
  
  <p>I get an answer of 266333 when I run this program.</p>