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.
Mutating an argument is the worst thing you can do.
This is what I did. Awesome job!
you can do this if you have exactly one parameter.
cool , I did this the same way but put the 'list' parameter into parenthesis,dindn't know I could do it without it.
Yes, I would very much like to know the difference as well... Have you tried stackoverflow @vlakas
You deleted the Python examples which need to be restored. The description is shared between all languages. In order to show descriptions for multiple languages you just stack them next to each other, the system will filter out the ones that are not relevant to the language being trained on.
This comment is hidden because it contains spoiler information about the solution
circleArea("1")
should returnfalse
as "If the radius is not positive or not a number, return false.", but it returns3.14
.toFixed
does round.The "Boolean primitive" is a boolean. ToNumber is well defined on booleans. And isNaN works in terms of
ToNumber
.That being said, the kata is underspecified at that point, as it isn't clear if the type of the argument should be checked. After all, it says only that "[i]f the radius is [...] not a number, return
false
". And that can be easily interpreted asisNaN
returns true. The the abstract relational comparison algorithm makes sure that the inintial comparison is true if and only ifradius
was actually a number (or convertable withToNumber
).The solution provided by ColbyDauph et al is therefore perfectly valid for any input, as long as you concur with the definition of "number" given above. If you object that defintiion, suggest a kata edit to clear that issue.
Passing true to the function should result in false (as the the Boolean primitive is NaN), however the result returned is 3.14
Sometimes unknown error occured
Tests are failing