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 ```js function rating(rating) { if (rating === "five") { return "you are a super genius" } else if (rating === "four") { return "you are very smart" } else if (rating === "three") { return...
JavaScript