agree.
switches are not bad. and are better then ifs
but it's better to have maps/objects than switches because they can grow more organically without much changes in the code, avoid issues like fallthrough and missing returns/break, better performance (you access directly the value by name/prop not by comparing to all the cases) and overall readability.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
agree.
switches are not bad. and are better then ifs
but it's better to have maps/objects than switches because they can grow more organically without much changes in the code, avoid issues like fallthrough and missing returns/break, better performance (you access directly the value by name/prop not by comparing to all the cases) and overall readability.