Ad
  • Custom User Avatar

    I know, but he's actually using it in his code. That's why it fails, and there is also another problem:

    Finish the solution so that it returns the sum of all the multiples of 3 or 5 BELOW the number passed in.

    Maybe this confuses him:

    function test(n, expected) {
      let actual = solution(n) // your function, only one argument
      Test.assertEquals(actual, expected, `Expected ${expected}, got ${actual}`)
    }
    
    Test.describe("basic tests", function(){
      test(10,23) // 10 here is the number passed to your function, and 23 is the expected value, it depends on the number passed to your function.
    })
    
  • Custom User Avatar

    @Chrono79 JS doesn't care. :)

    @plav2019 solveProblem doesn't exist.

    Also, you're overcomplicating things. It's not really that complex. :]

  • Custom User Avatar

    Why are you using a second argument in your function? Your function is always called with a single argument in the tests.

  • Custom User Avatar

    Without seeing your code we can only guess. If you post your code, use markdown formatting and mark your post as having spoiler content.

  • Custom User Avatar

    You're probably printing the result instead of returning it.