Tell us what’s happening:
Hello,
I am trying to complete the first problem for Project Euler, but the test cases are not working.
Your code so far
function multiplesOf3and5(number) {
let sum = 0;
for (let i = 3; i < number; i++) {
if (i % 3 == 0||i % 5 == 0) sum = sum + i;
}
return sum;
}
multiplesOf3and5(1000);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36
Challenge Information:
Project Euler Problems 1 to 100 - Problem 1: Multiples of 3 or 5