Ad
  • Custom User Avatar

    Spend yestrd evening and today's morning.
    not gonna make it to be developer but atleast QA automation atleast. i hope.

  • Default User Avatar
  • Custom User Avatar

    I think to not have it available is the point of this kata.

  • Custom User Avatar

    im too stupid to understand a task. cant get exmple even

  • Custom User Avatar

    glad u haven't see my solution

  • Custom User Avatar

    This is caused by outdated and confusing formatting of test cases layout. Fixed in update of the tests.

  • Custom User Avatar

    that's the way i understand. it's just not easy sometimes to explain me things. Now i just one line and code i wrote worked. prolly i won't get points cuz skipped already but still and i learned.thank you!

  • Custom User Avatar

    It's not a good idea to just tell the answer, or you don't learn much from it. But Chrono79 told you what the problem is exactly, and I tried showing you small steps, so you could find the problem on your own ( but you didn't seem to try them :/ ).

    If you do recursion, and use console.log in it, you will get the answer in console, but nothing will be returned to you from the initial function call, so you get undefined as the final answer. CodeWars tests work with returned values, and not output from console.

    It doesn't mean you can't use console.log, but you should understand that your code doesn't stop on that line. That's why I suggest looking at recursion online, compare with your code, and see if something is missing.

  • Custom User Avatar

    i don't mean to be rude or say i can't be wrong. just no one points me a mistake and i can't see atm. i facing some issues in other katas mb once i realise my issue i will come b to fix code of this one.

  • Custom User Avatar

    Well, it's your choice to believe in some fairytales, and not the truth. However, don't be surprised to see the same thing when you do another kata involving recursion :P As a popular phrase goes: "you can lead a horse to water, but you can't make it drink"

  • Custom User Avatar

    for some other reason

  • Custom User Avatar

    having console.log shouldn't be a problem anyhow

    Actually, that's the entire problem... And if you don't think it is, why is your solution not accepted?

  • Custom User Avatar

    js shows undefined return in codepen works ok

    That's because you don't understand the difference between console.log and return.

    Please read this: https://docs.codewars.com/training/troubleshooting/#expected-the-same

  • Custom User Avatar

    all right. having console.log shouldn't be a problem anyhow. if log show correct answer and followed with return statement then should ok. i guess u test for soluton which fits ur specific pattern.
    not a pleasure to deal with kata.i'll just skip it. have a nice day

  • Custom User Avatar

    You still have console.logs in your solution. There shouldn't be any. And from what I see the problem is the same, your recursion is wrong.

  • Loading more items...