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.
Premature optimisation is a terrable thing, when they come with such a request I will simply refactor
I agree but this will never be production code anyway. This is codewars and the whole game is to produce short code, just to teach others clever ways of doing coding.
That's why there is eslint no-nested-ternary rule that prevents me to commit such rubbish to production code. However it is alright in codewars as this is a platform for streching the limits of what can be done coding wise. I have learned quite a lot from such short nonsense solutions.
It is an antipattern using switch with a true statement
You don't check if the number is Harshad at all.
This comment is hidden because it contains spoiler information about the solution
This solution will replace uppercase letters as well.