Stop using If else and Switch statements
This is quite difficult to explain, because I don't completely disagree with the use of if-else. The main reason for the existence of the switch statement was to avoid if-else structure in certain cases. Sometimes we have more than 1 comparison to do, since there could be many cases to evaluate, and at this point these statements become something tremendously verbose. Using if-else Using switch Just a friendy reminder: when switch contained all value, the default case will never execute. So in this case, it is not necessary. Using Object Structure notation What do you think about this? Now...
JavaScript