hey everyone I start to solve project euler code problem. first question ask me finding

all number divide 3 or 5 within consist(sequentiol like 1,2,3…100) of given number for this I write my solution on bottom

```
function multiplesOf3and5(n) {
let sum = 0;
for(let i = 0; i <= n; i++){
if(i%3==0 || i%5==0){
sum += i;
}
}
return sum;
}
```

1.first create variable to store sum for each divided number

2.I use to for loop to simulate each number come until n

3.select number to divide 3 or 5 with if condition

4. after filter numbers, sum each number dived 3 or 5

5.return result of sum

I use this approach to solve that problem and it work to, but some reason it doesn’t look return for multiplesOf3and5(1000), but it’s return I check with console . I wonder why section accept this solution some can help me understand why accept this solution.

you can check problem from here https://www.freecodecamp.org/learn/coding-interview-prep/project-euler/problem-1-multiples-of-3-and-5