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.
"Should return null for invalid arguments" The last check yields a number, but should return null. I used the isNaN method, but it doesn't work. Are you using standard primitive data in your test?
My solutions fails in 3 tests when radius, arc and angle are given and instead of null, in 2 tests solution gives false and in 1 - instead of true gives false
This one definitely was hiding under the radar.
An easy six, although the input validation is a nuisance.
Approved by someone
Are you sure those are actually numbers?
This comment is hidden because it contains spoiler information about the solution
Julia translation
Added limited random tests ( expected value
true
will be generated exceedingly rarely. relying on fixed tests for that ).Smile, you missed an edge condition where you're returning
NaN
instead ofnull
. You're not going to fix that anymore, I know. :PAnd approved.
This comment is hidden because it contains spoiler information about the solution
If you're going to write a wrapper function for testing, make sure it can't be hijacked by solver ( defining it with
const
is one way to do that ).Native
Math
does not have enumerable properties. In keeping with this, and to teach good habits, defined methods should not be enumerable, and this should be tested for.toFixed
does rounding differently fromMath.round
( and weirdly in general ). This behaviour should be warned for andtoFixed
should ideally be discouraged and tested against.Rounding is not the appropriate solution for floating point representation inaccuracy. This has been dissed as an issue below, but again, it's teaching bad habits.
Not an issue
Updated description.
This is fixed, though not ideal.
What kind of rounding is expected for values ending with
5
?Existing solutions return different results for
Math.toRadians(-60.87676573264997)
and they all pass the tests.No really integers...
Loading more items...