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 is incorrect. I didn't take the time to read through all of the code in jsfiddle, but every resource will typically tell you that if/else is good for two discrete values, but switch statements win for performance for anything larger than two values. That said it's really miniscule in performance and the best option is the one that's most readable.
https://www.oreilly.com/library/view/high-performance-javascript/9781449382308/ch04.html#:~:text=As%20it%20turns%20out%2C%20the,than%20it%20is%20for%20switch%20.
https://stackoverflow.com/questions/767821/is-else-if-faster-than-switch-case
https://www.geeksforgeeks.org/switch-vs-else/
Not best practice: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#never_use_eval!
But clever
Insanity
This comment is hidden because it contains spoiler information about the solution