Ad
  • Custom User Avatar

    The thing is, c.incr(); // counter is now at 1 doesn't mean that c.incr() should equal 1. It means that the counter (a property, a variable, wherever it is) will now be 1. Calling it again would make that same variable change to 2. Does that make sense?

    If the author intended to show that c.incr() should equal the new number, they would have written a similar statement to those below it: c.incr() // 1. It's probably not the best way of writing those kinds of explanatory statements (I would have gone with c + 1 == 2 or something), but that's what was intended. Hope this helps.

  • Custom User Avatar

    Okay. So you just wrote a new test that isn't in the kata, or mentioned anywhere in the description. Still unsure what you're getting at.

  • Custom User Avatar

    it doesn't return the result as 1 (as expected in the comment)

    Not sure where you're talking about? I couldn't find a reference to this anywhere. Also, it does pass the tests, and so does work. At least theoretically.