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.
As of January 21, 2025, padStart is experimental. I don't think using it is a good practice. Regarding min/max: a variant with normal conditions (see my solution) would be more readable
wouldn't a match be preferable in this case?
Please tell me how are "==" and 0 related? Everything works for me with "===".
I agree. The habit of checking the matching of variable types will also protect you from unobvious errors in the future.
for the readability of the conditional operator, it is better to put curly braces
it's better to make d * 40 a constant (because it's a repeat) and get rid of else
It is better to do without reverse, it will be less expensive.
This comment is hidden because it contains spoiler information about the solution
Which is preferable: this solution or with a ternary if? If this, please explain why