Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
The thing is,
c.incr(); // counter is now at 1
doesn't mean thatc.incr()
should equal1
. 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 withc + 1 == 2
or something), but that's what was intended. Hope this helps.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.
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.