Ad
  • Custom User Avatar

    Yes, and for that, I show and explain in description that 1 job in the kata, is diff between a normal number, and a NaN, and return an explicit case type for it.

  • Custom User Avatar

    Ok, I'll fix it, I didn't understand the first request. Thanks for the help and clarification.

  • Custom User Avatar

    The idea is too to diff between typeof and instanceof, nor just "return Array.isArray(value) ? Array.isArray(value) : typeof value"
    And between a literal object, or other objects that have inheritance with Object, but have their own constructor.
    Too to show that a NaN is a typeof number, when is a "Not a Number" explicit name description.

    Neither NaN, Array, Null, contructor Objects/classes, are my own types. They are explicit js/ts types that are not typeof básics.

    How I told you, maybe I missexplained the kata, my English is not the better, but the idea es that a newbie can diff between typeof and others, nor just an array/null from other kind of objects, and that they start to fight or probe with other kind of instances, with something more basic that generic types.

  • Custom User Avatar

    Its more..... Look your link.... do you think this kata is the same... really do you think is the same?
    It this "duplicate" kata, diff between objects created with constructors, or just with literals or just Objects classes?
    It diff between null, or NaN?

    Maybe can you explain me better what do you expect. But i think the description is easy to understand. It's possible I missexplain correctly.

    Or maybe you expect I complex the kata setting for types like Date, RegExps, Errors, Enums...

    Enums is not a native js literal too... but is a ts creation type.

    Then is not duplicate, either right now, or either if I complex it, then maybe a 6kyu kata.

  • Custom User Avatar

    Please, reply me exactly, I dont understand you properly.

    I dont know if you are showing me an error, or maybe the testcase logs dont show as expected.

    Maybe I have errors, but when I tests cases in the post kata, I look it as I where expected.

    Maybe you can show me or explain me to fix that you are looking bad and show It in the best case.

  • Custom User Avatar

    Array is my own type?
    classObject and an implicit object are the same?
    Null is an object or is just a typeof object?
    is Not a Number (NaN) like a number?
    That are abstract types... ask it for isNaN(value) ... or a NaN === NaN is it?

    I Could complex it, with enums, dates, regexp, or other basic types... I think I abstract so low types for basic, for a easy kata.

    Or you just quest about native js types? Cause this kata isn't for native literals.

    Maybe people who is working with js everylife knows it, but newbies, arent.

  • Custom User Avatar

    And Not A Number is a number?

    just for it is a explicit case.
    Types show the expected types.

  • Custom User Avatar

    And Not A Number is a number?

    just for it is a explicit case.
    Types show the expected types.

  • Custom User Avatar

    I were permuted the table and It muted the original array.

    Solved, ty :)!

  • Custom User Avatar

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

  • Custom User Avatar

    Im afraid with this ternary

  • Default User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    I did it, but I dont think the kata is for 6kyu in Ts.

  • Custom User Avatar

    Maybe im dumb... but I pass more than 100 tests, but everytime I fail some randoms... like that

    For example some random tests results... ->

    Log
    {

    island:[
        '..8.$$...1$$4$.....25$4.',
        '$..$....2....1.$$5.$$..0',
        '.91.2..4..$..2...$$3.0..',
        '.......9.......$....$..0',
        '$......$$....7..$.......'
    ],
    

    coordinates: [ 1, 1 ],
    steps: 2
    }

    expected 10 to equal 9


    or like that

    Log
    {

    island:[
        '...2',
        '.5..',
        '....', 
        '....' 
    ],
    

    coordinates: [ 2, 2 ],
    steps: 2
    }

    expected 5 to equal +0


    And every try the same, ridiculus bad tests, or Im crazy or I dont know.

    In that 2 examples. Doing as my self...

    1 - Start in position 1,1 with 2 steps... 1 step going down, other going right -> 10 food... the test expect 9???

    2 - Position 2,2...with 2 steps... 1 step going up, other left... nothing more... 5 food... the test expect 0???

    I could show more and more random tests fail examples.

    Maybe Im so tired and I understand nothing. If somebody could help or tell me what are failing? Or simply somebody could fix that? Ty

  • Loading more items...