Rethinking JavaScript: Eliminate the switch statement for better code
Joel Thoms
1K25

Yeah “better code” is dubious. Case/Switch is highly performant compared to if statements and is also much more readable.

But, deconstructing a Switch statement with ES6’s functional techniques and breaking it down into reusable expressions is interesting and insightful. This is a cool read and shows how powerful the arrow operator can be.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.