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.
Wondering if filter would be more performant.
This comment is hidden because it contains spoiler information about the solution
Exactly what I did.
But since and empty array may be passed as an argument, this becomes mandatory, otherwise you'd get and error.
Yes, thank you very much!
Normally I'd say yes, giving
parseInt
a radix of 10 is best form. However, you really only have to worry about specifying a radix if the string could possibly have a leading"0x"
or"0"
. E.g.Both of those are impossible in this case: we know that the string is a number in string form and the digits are sorted in descending order, so it can't possibly begin with
"0x"
or"0"
(unless the number is 0, and then the radix is irrelevant).I prefer
+n
anyway in most cases, because you can test that the result isn'tNaN
.parseInt
andparseFloat
provide no error handling whatsoever.This comment is hidden because it contains spoiler information about the solution
toFixed
does round.This comment is hidden because it contains spoiler information about the solution
Can anyone explain? Thanks :-)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I submitted this solution and received an error.
Anyone ideas?