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 found this kinda funny, the title literally say "Lost Without a Map", but here you are using a "Map()" xDD
its still a good solution tho
These solutions showing me how I need to think differently and not overcomplicate things lol.
i think so 👀
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This is so smart. Thank you for sharing that. Also good point on the effects of sorting for larger arrays
same here. One day...
it is returning a new array, you don't need to name it
But the system is saying that it should be another array, not the initial one.
Very strange.
This comment is hidden because it contains spoiler information about the solution
If the execution in your
if
statement is a return, you don't need anelse
block after it, because the function will not continue to execute once it's returned.And with the spread operator, you can now simplify the use of Math.min and Math.max to
Math.min(...array)
andMath.max(...array)
, respectively.This comment is hidden because it contains spoiler information about the solution
If your parameter is undefined will your code work?
I mean when arguments like Nothing, None are passed into the function will it work?
You don't need to reassign the array variable like this 'array = array.sort', because sort() is already mutating the array, also be afraid that it will mutate the initial array from the argument, hence better to do something like this 'const innerArray = [...array] and work with it.
but this doesn't create a new Array, only replaces existing one?
Loading more items...