Using fewer “if”s in Javascript
Using a state machine instead. As we developers evolve, hopefully, we realize that our coding habits must improve. This happens to me all the time. When I see code that I wrote a year ago as I go back to add new things, sometimes I feel that it needs rewriting. Sometimes I…