https://tutorial.eyehunts.com/js/how-to-avoid-if-else-in-javascript/
How to avoid if else in JavaScript