Writing cleaner code by avoiding switch case and nested if in Javascript:
1 min readApr 14, 2022
There are ways in which you can reduce number of lines of code and make the code looks cleaner.
One way is to avoid switch statements and nested loop
for example lets see the below functions: