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
Loading collection data...
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