Ad
  • Custom User Avatar

    4 years later, Node 18. is the one and only default version, closing this one

  • Default User Avatar
  • Default User Avatar

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

  • Custom User Avatar
  • Custom User Avatar

    Those are two different cases and you should read this note:

    Note: the list may be null and can hold any type of value.

    There is your problem.

  • Custom User Avatar

    input '888a 999a'
    Visual Studio Code (highest possible js version) sort with localeCompare => 888a 999a
    JS version 8 (highest possible js version for this very kata) => 999a 888a

  • Custom User Avatar

    I was wondering about this.. the problem describes this corner case but doesnt test for it when you submit? This code doesnt appear to handle that case.

  • Custom User Avatar

    Hello,
    My Javascript code is failing for some random tests by the test set up here. However, this this giving correct answer in my personal compueter sublime editor. I am using eval function and for rounding to nearest integer I using Math.round().

    Ex: 586c5 9x7711 885y8 761z3 3b896 87b7 6x98 d86475 100a0 9327a1 9206z3
    Codewar showing : It should work for random inputs too - Expected: -84271, instead got: -80447
    my own test environment showing : Result = -84271

    Is there any idea what am I missing ?

    Sort Update : I was using "localeCompare" function for string compare and now changed to string.prototype.charCodeAt() function for the comparision. BUt nothing changed in codewar. I am still failing here but passing in my own system.

  • Custom User Avatar

    Not an issue. Your logic is incorrect.

  • Custom User Avatar

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

  • Custom User Avatar

    @rowcased It's not about code not working on different versions, it's that the TESTS themselves aren't functional for specific one (because they're written poorly, and node 10 says no to that). Granted, there's no issues when attempting all test cases, this is a minor issue, but I'd rather see 2 lines added than see more issues raised from people who don't know how to deal with errors like this.

    With that said, I do agree with what you're saying in principle.

  • Custom User Avatar

    Thank you. Yes, very silly of me.

  • Custom User Avatar

    I'm not so sure it is an issue? Doesn't seem fair to offer multiple nodes and expect a valid solution in one to work in all/others. It reminds me of criticism of functional Python 2 code where people say, "yeah, but this doesn't work in Python 3", whereas in many cases Python 3 had not been even been enabled at the time of the solving. Anyway, just my thoughts.

  • Default User Avatar

    JavaScript Completions 2106

    This is only node 10 issue, and it's only for the sample test. If you hit submit, it works fine. (try it with node 8 and it's gonna work)

    It's because node 10 runner uses test framework that requires describe and it blocks for tests (as far as I understand)

    But yes, it is an issue :/

  • Custom User Avatar

    As my own solution was not working, I unlocked the solution and tested couple of popular solution. However, they are too giving error,

    "No output was produced.
    Make sure tests are written properly using describe and it (required for Node 10)."

    Has anyone successfully completed this kata using Javscript ?

  • Loading more items...