actively avoiding if-else / switch statements WIP
const listOfStuff = []
const mapOfStuff = []
as an exercise, I will try implementing switch cases as Maps to get comfortable with both of them.
ref
- (as of Dec 2018, Maps are the slowest performing method, while switch cases are the fastest across browsers) https://medium.com/front-end-weekly/switch-case-if-else-or-a-lookup-map-a-study-case-de1c801d944
- https://medium.com/@bartsis/foo-vs-bar-switch-vs-maps-in-javascript-3894ac00b58f
- mentioned by a colleague at work