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.
I remember not being able to come up with a test case for this. As far as I can tell, you get the same result with either type of division because of the integer division in the top-level calculation. Consider the following scenario:
If we divide the HP "wrong", we get:
((299.9 + 150) + 0) / (2 + 0) = 449.9 / 2 = 224 /* 224.95 rounded down */
If we divide the HP "right", we get:
((299 + 150) + 0) / (2 + 0) = 449 / 2 = 224 /* 224.5 rounded down */
If there were another decimal in the calculation, we could get a different result, but:
Anything I'm missing?
This should be fixed now.
I've added
NaN
/false
/0
/''
tests under "Object tests". Thenull
/undefined
cases were already there.I've added those test cases.
Stringify function is incorrect for
Set
: it stringifiesSet
instances asSet([])
instead ofnew Set([])
, so the stringified value will always throw an error. Other primitive wrappers correctly containsnew
.Needs additional fixed test cases for matching falsy values with
{}
:Also needs more tests for
Set
s:This
1/10
uses integer division too, right? This can lead to different results in very specific edge cases, which should be clarified and (IMO should be) tested. The current edge cases doesn't specifically test for this part.thx. fixed
This comment is hidden because it contains spoiler information about the solution
Thanks for the advice, fixed!
Giving hints is not even that necessary I think, but don't force people to
Train
to see examples.Give the example tests in the
Description
.Thanks for the advice, having looked at the task with a fresh look and realized that it is very difficult. I have updated the description of the kata, and I hope now it has become a little more clear how to solve it
I think this could be improved by giving more information about what the puzzle is in the description. I had no idea what I would be looking at until I hit Train.
The wording for this is now "
null
matches if the input isnull
".Loading more items...