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.
i wonder why this very simple solution doesn't get nearly as much "best practice" than the other one above there >^.^<
This comment is hidden because it contains spoiler information about the solution
Nice
This comment is hidden because it contains spoiler information about the solution
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/from
Array.from({length: n+1}) is like creating array as usual by
new Array(length)
(but this is bad approach as it is not recommended to use constructor for creating array). The bad thing with that is that we can't usemap
to define each of it's element because all of them areundefined
. So this what is the feature of theArray.from
I think, that the second parameter is a function which allows us to define each element of the array like you can do it withmap
method.This comment is hidden because it contains spoiler information about the solution
Define "productive" and "sophisticated", considering that it is competitive coding and you are meant to show off ;)
It looks not productive and too sophisticated
It does not look like the same to me and every single array item would be negative on that check.
if replace "0123456789".indexOf(a) on isNaN(a) will be shorter and probably faster is not it ?
I broke my brain )))
I completely agree!