Tell us what’s happening:
Every condition has been accomplished except for the third:
multiplesOf3and5(1000) should return 233168).
What is wrong with my code?
Your code so far
function multiplesOf3and5(number) {
let sum = 0;
for (number; number >= 0; number--) {
(number % 3 === 0 || number % 5 === 0) && (sum += number);
};
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/86.0.4240.198 Safari/537.36.
Challenge: Problem 1: Multiples of 3 and 5
Link to the challenge: