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.
Not an issue.
Same here.
Non, "If such an element is found, some immediately returns true. Otherwise, ..."
some returns -1
right?
some executes the callback function once for each element present in the array until it finds one where callback returns a true value. If such an element is found, some immediately returns true. Otherwise, some returns false.
There is currently no test case that checks the semantics stated in the description.
The function must not call the iterator function after the match is found.
The following test will break even the most popular solution (ha-ha).
Some incorrect solutions use
String#trim
to get rid of whitespace.Please add the following simple test:
The slope of a vertical line is not infinity, it does not exist.
\s
catches newline characters, no need for\n
in your first RE.The trick is so clever!
This is because toFixed() returns a string but number is expected.
+n.toFixed(3)
works perfectly.Nice excercise. Would have liked an explanation of what the "slope" is in the description, just to be clear. But otherwise, works quite well.
assertSimilar
can't distinguish-Infinity
,+Infinity
, and"null"
from actualnull
, and therefore some incorrect solutions pass. I would either state the requirements explicitly or useassertEquals
instead.Also I think it would make sense to expect
Infinity
in case of a vertical line andnull
in case of equal points.I can add that it is not stated in the description at all that an empty tag name indicates a text node. Killed some time and finally cheated to discover this requirement.
FYI,
Math.pow(10, -7)
can be written in literal form as1e-7
.This is not what katas are designed for.
Loading more items...