Test3 is failing :
multiplesOf3and5(1000)
is failing, while tests testing higher numbers than 1000 don’t fail. But that cannot be logically. Therefore the test itself must bear a mistake.
With me it gives:
234168
but in test,
233168
is required.
**Your code so far**
function multiplesOf3and5(number) {
let sum = 0;
while (number > 0) {
if (number % 5 === 0 || number % 3 === 0) {
sum += number;
}
number = number - 1;
}
return sum;
}
console.log(multiplesOf3and5(1000));
multiplesOf3and5(1000);
**Your browser information:**
User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:89.0) Gecko/20100101 Firefox/89.0
Challenge: Problem 1: Multiples of 3 and 5
Link to the challenge: