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.
This comment is hidden because it contains spoiler information about the solution
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.It does not look like the same to me and every single array item would be negative on that check.