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.
Because of that.
This comment is hidden because it contains spoiler information about the solution
Nice kata. I have a translation in Scala that is currently 147 characters long - remarkably short for a strongly typed language. If you allow a Scala translation, I will put it in.
There's
assertEquals
method for equality. If you want to useassertSimilar
, it seems to resemble behaviour of theObject.is
, described in ECMA-262 secion 7.2.9It appears that
Test.assertSimilar()
has an issue with comparing negative and positive zeros in javascript.By definition in ECMA-262 Section 7.2.14
-0 === +0 === true
.However, the
Test.assertSimilar()
method fails for the following test.I'm getting the same error in my tests. I wonder why this is happening when
-0 === 0
returns true in javascript.