Don’t Use If-Else and Switch in JavaScript, Use Object Literals
Write better conditionals in JavaScript with object literals
Published in
3 min readApr 12, 2021
Writing complex conditionals in JavaScript has always had the potential to create some pretty messy code. Long lists of if/else
statements or switch
cases can get bloated quickly.