Sum of Multiples of 3 or 5 up to 1000 Question:


  Find the sum of multiples of 3 or 5 up to 1000


I have come up with this solution that is bit more generic than the first 1000 per se:

let multiplesSum = n =&gt; {

  let sum = 0

  for (let i = 0; i &lt; n; i++) {
    if (i % 3 === 0 || i % 5 === 0) {
      sum += i
    }
  }
  return sum
}


Instead of pushing everything to an array use a variable and sum the numbers as they are looping.
Implementation
Your implementation is clean, robust and easy to understand. I suggest only small changes:

Declare multiplesSum as const to prevent accidental rebinding / overriding later on.
multiplesSum(n) should compute the sum of multiples of 3 or 5 up to and including n. Sum formulas are usually following this convention.
I prefer terminating statements with semicolons instead of relying on JavaScript's automatic semicolon insertion.

Algorithm
Your algorithm is simple and easy to understand, but comes with a linear runtime complexity of O(n).
An algorithm with constant runtime complexity O(1) exists. Here are some pointers in case you are stuck:

Given a positive integer n, how often do 3 or 5 fit into n? Division and Math.floor give the answer.
Arithmetic sequences such as 3 + 6 + 9 + ... have simple, explicit sum formulas.
By adding (3 + 6 + 9 + ...) + (5 + 10 + 15 + ...), you count some numbers twice, so you need to find and subtract those.