Ad
  • Default User Avatar

    Thank you, guys, I will check thngs out ...expecially - arguments[1]
    ...indeed! the case was with it...I have subsided it with plain figure - 23 and
    get it passed...
    Thank you all!

  • 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

    Ranks can't be changed.

  • 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.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • 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.

  • Default User Avatar

    return resNum.pop();
    ...maybe put here the code - so someone could check?
    ...with spoiler tag?...

  • Default User Avatar

    ...no - the return ...;
    is present -

  • Custom User Avatar

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

  • Default User Avatar

    JavaScript...
    Hi guys!
    Icannot pass test for the KATA - see below...
    I have tested on in GOOGLE Dev.tools
    and the result is that of expected, - but
    I cannot pass it here...
    I end up with single number - say 23 for (10,23) and 14 for (8,23)
    but test states - 'undefined'
    what can it be?

    thenks in advance

    Description:
    If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
    Finish the solution so that it returns the sum of all the multiples of 3 or 5 below the number passed in.
    Note: If the number is a multiple of both 3 and 5, only count it once.