Error in test for this challenge

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:

Yeah your result is wrong.
You are supposed to only look at numbers BELOW the given number.
Of all the tests, 1000 is the only input divisible by 3 or 5, where the actual result is compared to the expected output → hence it’s the only one failing.
The test with 10 only looks for the datatype, but you would fail that as well, if it were for the result - as your code outputs 33, instead of the expected 23.

2 Likes

Thank you so much!
Shortly I thought it might be an One-Off-Error, but somehow I missed that.
And I was wondering …
Thank you!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.