Ad
  • Default User Avatar

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

  • Default User Avatar

    The test description is wrong:

    creates a timer and stores a reference to it as a class property `this.timeId`
    

    the actual testcase tested the class property this.timerId. Notice timer vs time.

    Got me stuck for a long time...

  • Default User Avatar

    I seem to have misunderstood the question and never used React.createElement method.
    Even though I read "wrapper method", somehow my brain translates it into "reimplement React.createElement"

    I completed the kata using functional-component declaration, different from many of the solutions.

    Perhaps a test case that checks for class-component properties that functional components does not have, will help right my tunnel vision during submission.

  • Default User Avatar

    I think this kata's test cases are incomplete.

    For my submitted (incorrect) solution, I've actually just submitted the beast value input by the test case in the beginning. The form input element's value is not used.

    In a practical world where humans are inputing the form, I would have to read the form input value, then submit and run the requested function using that value.
    The test cases did not use the input element to input value, hence I found my "wrong" solution accepted just using the test-case-injected value.

    Also, please update to >= React v16.4.x

    There is React.createRef already. Kinda confusing when following the current (v16.11.x) documentation, but the React.createRef returns error upon testing.

  • Default User Avatar

    Pardon me, but I think this question, at current state, is not too clear due to cognitive dissonance from reading the kata title, the code function naming, and the instructions.

    Title is "Sum of two lowest positive integers"
    Code function name is "sumTwoSmallestNumbers"

    See the dissonance?

    Please correct me if I am wrong. Let me explain one way of interpretation as below:

    "Two lowest positive integers" is not "Two smallest numbers".

    "Lowest positive integers", mathematically, is the set of natural numbers starting from 1 to positive infinity i.e. [1, +∞)
    "Two smallest numbers", is the set of numbers that is more than just integers, includes rational numbers (i.e. numbers that can be expressed in fraction form of a/b e.g. ½), irrational numbers (e.g. square root of √2), as well as all negative numbers! It means the set of possible numbers stretches from negative infinity to positive infinity (-∞, +∞).

    The more confusing part is that the definition of "positive integer" is not clear.
    Whether it is the mathematical definition (does not include zero) or the "convenient" computer science definition flavour (unsigned integer data type == positive integer, includes zero) needs to be clarified in the instructions.

    Maybe this kata has been edited a few times by different hands since publishing, and it became just a little bit incoherent.
    Perhaps, a little more clarification and clean up in the instructions in addition to synchronizing the function name with kata title will go a long way.